grit

package module
v0.0.0-...-d08609b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 17 Imported by: 0

README

grit

介绍

golang 微服务框架

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
码云特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. 码云官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解码云上的优秀开源项目
  4. GVP 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
  5. 码云官方提供的使用手册 https://gitee.com/help
  6. 码云封面人物是一档用来展示码云会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//当前系统的注册管理器
	CurrentRegistry registry.Registry
)

Functions

func NewGateHttp

func NewGateHttp(opts ...conf.SetConfigItem) *gatehttp.GateHttp

Types

type Service

type Service interface {
	// The service name
	//Name() string
	// Init initialises options
	Init(...conf.SetConfigItem)

	Server() *grpc.Server

	Register() registry.Registry
	// Options returns the current options
	//Options() Options
	// Client is used to call services
	//	Client() client.Client
	// Server is for handling requests and events
	//	Server() server.Server
	// Run the service
	Run() error
}

func NewService

func NewService(opts ...conf.SetConfigItem) Service
type Options struct {
	Port      int
	Name      string
	ServiceID string
	Version   string
	Registry  registry.Registry
}
func Port(port int) Option {
	return func(o *Options) {
		o.Port = port
	}
}
func Name(name string) Option {
	return func(o *Options) {
		o.Name = name
	}
}
func ServiceID(sid string) Option {
	return func(o *Options) {
		o.ServiceID = sid
	}
}
func newOptions(opts ...Option) Options {
	//var wdPath, confPath, Logdir, BIdir *string
	//var ProcessID *string
	opt := Options{
		Port:     9003,
		Registry: consule.NewConsulRegistry(), //.DefaultRegistry,
	}
	for _, o := range opts {
		o(&opt)
	}
	return opt
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL