server

package
v0.0.0-...-8671a8c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// for convenience
	SIGHUP  = syscall.SIGHUP
	SIGINT  = syscall.SIGINT
	SIGTERM = syscall.SIGTERM
	SIGUSR1 = syscall.SIGUSR1
	SIGUSR2 = syscall.SIGUSR2
)

Variables

This section is empty.

Functions

func WaitForSignals

func WaitForSignals(sigs ...os.Signal) <-chan os.Signal

wait for terminate signals this method can only be used at one place at then same time

func WithAuth

func WithAuth(ctx context.Context, appId, appSecret string) context.Context

func WithMD

func WithMD(ctx context.Context, kv ...string) context.Context

Types

type Call

type Call struct {
	log.Recorder
	// these fields can be truested
	AppId     string
	UserId    string
	RoleId    string
	RoleIndex int32
}

func FromIncomingContext

func FromIncomingContext(ctx context.Context) (call *Call, ok bool)

type Client

type Client struct {
	Gateway     v1pb.GatewayClient
	Database    v1pb.DatabaseClient
	Mailbox     v1pb.MailboxClient
	Distlock    v1pb.DistlockClient
	Leaderboard v1pb.LeaderboardClient
	BubbleChart v1pb.BubbleChartClient
	// contains filtered or unexported fields
}

func Dial

func Dial(addr string, opts ...grpc.DialOption) (_ *Client, err error)

func (*Client) AddAuth

func (cli *Client) AddAuth(appId, appSecret string)

type Server

type Server struct {
	grpc.ServiceRegistrar
	// contains filtered or unexported fields
}

func NewServer

func NewServer(opts ...grpc.ServerOption) *Server

func (*Server) Done

func (srv *Server) Done() <-chan struct{}

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe(addr string) (err error)

func (*Server) Serve

func (srv *Server) Serve(lis net.Listener) (err error)

func (*Server) Stop

func (srv *Server) Stop()

Jump to

Keyboard shortcuts

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