libgrpc

package
v0.0.0-...-437541a Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 11 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 Definition

type Definition struct {
	Translator     *libtranslator.ServiceDefinition
	GenDomain      string
	Create         *RequestConfig
	Update         *RequestConfig
	Delete         *RequestConfig
	CustomQueries  []*libtranslator.CustomRequest
	CustomCommands []*libtranslator.CustomRequest
	DisableSelect  bool
	DisableCreate  bool
	DisableUpdate  bool
	DisableDelete  bool
	Event          bool
	// contains filtered or unexported fields
}

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

func (*Definition) Aggregate

func (*Definition) CustomRequests

func (d *Definition) CustomRequests() []*libtranslator.CustomRequest

type Definitions

type Definitions struct {
	Prefix         string
	Name           string
	Repository     string
	TranslatorPath string
	Tenant         bool
	Auth           bool
	// contains filtered or unexported fields
}

Definitions contains all the graphql definitions in the service.

func (*Definitions) GetByID

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

GetByID return the specified definition by its ID.

func (*Definitions) GetTitle

func (ds *Definitions) GetTitle() string

GetTitle is used to return the name of the definition with InitCap

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 RequestConfig

type RequestConfig struct{}

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.

type Translation

type Translation struct {
	Key         gclient.String
	Translation gclient.String
}

type TranslationInput

type TranslationInput struct {
	Key         gclient.String
	Translation gclient.String
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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