server

package module
v0.0.0-...-845d9a5 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetReady

func SetReady(readiness bool)

Types

type UserServerAPI

type UserServerAPI struct {
	ServerHTTP *http.Server
	ServerGRPC *grpc.Server
	// contains filtered or unexported fields
}

UserServerAPI contains the HTTP and GRPC servers which will run the whole user api server. This structure is mainly used as a configuration component that uses a http.Server and grpc.Server objects, themself containing a router/handler for their requests.

func NewUserServerAPI

func NewUserServerAPI() (usersrv UserServerAPI, err error)

NewUserServerAPI will create a new UserServerAPI object. It will initiate the HTTP and GRPC servers by calling the setServerHTTP and serServerGRPC package functions. The function returns an UserServerAPI which will be ready to use, if no error is returned, by calling either usersrv.RunServerHTTP() or usersrv.RunServerGRPC().

TODO: give parameters to the function in order to tune the servers.

func (*UserServerAPI) RunServerGRPC

func (usersrv *UserServerAPI) RunServerGRPC() (err error)

RunServerGRPC starts the grpc service.

func (*UserServerAPI) RunServerHTTP

func (usersrv *UserServerAPI) RunServerHTTP() (err error)

RunServerHTTP starts the http service.

Jump to

Keyboard shortcuts

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