libgrpc

package
v0.0.0-...-fda232b Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GrpcServer *grpc.Server

GrpcServer need to be call from the main file of the service, to launch the grpc server.

Functions

func NewServer

func NewServer(tracer opentracing.Tracer)

Types

type Arg

type Arg struct {
	Name     string
	Type     libdata.FieldType
	Required bool
}

Arg represent the argument of a custom function.

type ArgData

type ArgData struct {
	Name     string
	Title    string
	Type     string
	Required bool
	Arg      *Arg
}

ArgData represent the argument of a custom function, in a format usable by templates.

type CustomFunc

type CustomFunc struct {
	Name   string
	Args   []*Arg
	Result *Arg
}

CustomFunc represent a custom function.

func (*CustomFunc) GetCustomFuncData

func (c *CustomFunc) GetCustomFuncData() *CustomFuncData

GetCustomFuncData return the custom function information, in a format usable by templates.

type CustomFuncData

type CustomFuncData struct {
	Name   string
	Title  string
	Args   []*ArgData
	Result *ArgData
}

CustomFuncData represent a custom function, in a format usable by templates.

type Definition

type Definition struct {
	ORM         *liborm.Definition
	CustomFuncs []*liborm.CustomFunc
	// contains filtered or unexported fields
}

Definition is used to declare the information of a model, so it can generate its code.

func (*Definition) GetCustomFuncByName

func (d *Definition) GetCustomFuncByName(name string) *liborm.CustomFunc

GetCustomFuncByName return the custom function by it's name

type Definitions

type Definitions struct {
	Prefix     string
	Repository string
	// contains filtered or unexported fields
}

Definitions contains all the grpc definitions in the service.

func (*Definitions) GenClient

func (defs *Definitions) GenClient()

GenClient will generate the grpc client files. nolint: dupl

func (*Definitions) GenProtos

func (defs *Definitions) GenProtos()

GenProtos will generate the grpc proto files.

func (*Definitions) GenServer

func (defs *Definitions) GenServer()

GenServer will generate the grpc server files. nolint: dupl

func (*Definitions) GetByID

func (ds *Definitions) GetByID(id string) *Definition

GetByID return the specified definition by its ID.

func (*Definitions) Register

func (ds *Definitions) Register(d *Definition)

Register is used to register a new definition into the service.

func (*Definitions) Slice

func (ds *Definitions) Slice() []*Definition

Slice return the definitions as a slice.

type Server

type Server struct {
}

Server need to be call from the main file of the service, to launch the grpc server.

func (*Server) Listen

func (s *Server) Listen(port int) error

Listen start the grpc server on the specified port.

Jump to

Keyboard shortcuts

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