grpc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BroadcastListen

func BroadcastListen(server *Server)

func CreateClientFile

func CreateClientFile(c *Server, targetProject ...string)

创建最初的Client文件

func CreateProto

func CreateProto(c *Server)

func CreateProtoBatFile

func CreateProtoBatFile(c *Server, cmd string)

创建最初的Client文件

func CreateServerFile

func CreateServerFile(c *Server, targetProject ...string)

创建最初的Server文件

func HeartBeat

func HeartBeat(server *Server)

func SetTwig

func SetTwig(tg *twig.Twig)

Types

type Api

type Api struct {
	Name     string
	Describe string
	InPut    []Field
	OutPut   []Field
}

func NewApi

func NewApi() *Api

func (*Api) AddDescribe

func (c *Api) AddDescribe(content string) *Api

func (*Api) AddIn

func (c *Api) AddIn(name string) Field

func (*Api) AddOut

func (c *Api) AddOut(name string) Field

type BaseType

type BaseType struct {
	Name     string
	Index    int
	Type     string
	Describe string
}

func (*BaseType) GetDescribe

func (b *BaseType) GetDescribe() string

func (*BaseType) GetIndex

func (b *BaseType) GetIndex() int

func (*BaseType) GetName

func (b *BaseType) GetName() string

func (*BaseType) GetType

func (b *BaseType) GetType() string

func (*BaseType) IsBool

func (b *BaseType) IsBool() Field

func (*BaseType) IsFloat

func (b *BaseType) IsFloat() Field

func (*BaseType) IsFloat64

func (b *BaseType) IsFloat64() Field

func (*BaseType) IsInt

func (b *BaseType) IsInt() Field

func (*BaseType) IsInt64

func (b *BaseType) IsInt64() Field

func (*BaseType) IsString

func (b *BaseType) IsString() Field

func (*BaseType) SetDescribe

func (b *BaseType) SetDescribe(des string) Field

func (*BaseType) SetIndex

func (b *BaseType) SetIndex(i int) Field

func (*BaseType) SetName

func (b *BaseType) SetName(n string) Field

func (*BaseType) SetType

func (b *BaseType) SetType(t string) Field

type Field

type Field interface {
	SetName(n string) Field
	GetName() string
	SetIndex(i int) Field
	GetIndex() int
	SetType(t string) Field
	GetType() string
	SetDescribe(des string) Field
	GetDescribe() string
	IsInt() Field
	IsInt64() Field
	IsString() Field
	IsFloat() Field
	IsFloat64() Field
	IsBool() Field
}

func NewField

func NewField(name string) Field

type Server

type Server struct {
	Name     string
	Api      []*Api
	InjectTo []string //将gprc代码注入到指定模块内
}

func CreateServer

func CreateServer(name string) *Server

func (*Server) AddApi

func (s *Server) AddApi(name string) *Api

func (*Server) AddToTargetProject

func (s *Server) AddToTargetProject(name string)

func (*Server) Generate

func (c *Server) Generate()

Jump to

Keyboard shortcuts

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