Git Product home page Git Product logo

cin's Introduction

GitHub tag (latest by date) GitHub go.mod Go version GitHub last commit

cin

简体中文

This repostory has been deprecated. new repostory: go-cam/cam

The http and websocket server's framework.

Inspiration come form yii2.

Dependencies

  • github.com/go-sql-driver/mysql v1.4.1
  • github.com/go-xorm/xorm v0.7.9
  • github.com/golang-migrate/migrate/v4 v4.7.0
  • github.com/gorilla/sessions v1.2.0
  • github.com/gorilla/websocket v1.4.1
  • github.com/tidwall/gjson v1.3.4

Getting started

Edit file: main.go

package main

import (
    "github.com/cinling/cin"
    "github.com/cinling/cin/core/base"
)

func main() {
	config := cin.NewConfig()
    config.ComponentDict = map[string]base.ConfigComponentInterface{
        "ws":      cin.NewConfigWebsocketServer(24600),
        "http":    cin.NewConfigHttpServer(24601).SetSessionName("test"),
        "db":      cin.NewConfigDatabase("mysql", "127.0.0.1", "3306", "cin", "root", "root"),
        "console": cin.NewConfigConsole(),
    }
    cin.App.AddConfig(config)
    cin.App.Run()
}

Run go module to download dependency.

go mod tidy

Compiled code.

go build main.go

Run bin file

./main.exe or ./main

Migrations

After Compiled code, run the following command to create migration's file.

./main.exe migrate/create [filename]

cin's People

Contributors

cinling avatar 281093509 avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

cin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.