server

package
v0.0.0-...-4676a12 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthenticatingGrpcServer

func CreateAuthenticatingGrpcServer(users users.Users) *grpc.Server

CreateAuthenticatingGrpcServer returns a grpc.Server set up with authenticating interceptors from the grpc_auth package.

func CreateServer

func CreateServer(users u.Users, tables *t.Tables, config ServerConfig) *grpc.Server

func GetAuthenticatedUser

func GetAuthenticatedUser(ctx context.Context) (user users.AccountData, success bool)

GetAuthenticatedUser returns the users.AccountData identified by the valid session token in the grpc metadata. If the token is missing or invalid, the success flag returned is false.

func WrapServerForGrpcWeb

func WrapServerForGrpcWeb(grpcServer *grpc.Server, staticDirectory string, allowedOriginHostname string) *http.Server

WrapServerForGrpcWeb wraps a grpc.Server in an http.Server that handles grpc-web requests (and also passes plain grpc to the wrapped server). When not the empty string, files in staticDirectory will be served for non-grpc requests. Remote grpc-web requests will pass CORS when the remote hostname (excluding port) equals allowedOriginHostname.

Types

type ClientStream

type ClientStream struct {
	// contains filtered or unexported fields
}

type ClientStreams

type ClientStreams struct {
	// contains filtered or unexported fields
}

func NewClientStreams

func NewClientStreams() ClientStreams

func (*ClientStreams) IsOnline

func (cs *ClientStreams) IsOnline(user u.Id) bool

func (*ClientStreams) Send

func (cs *ClientStreams) Send(users []u.Id, event *pb.Event)

Send synchronously sends an event to a list of users.

func (*ClientStreams) SendSingle

func (cs *ClientStreams) SendSingle(user u.Id, event *pb.Event)

SendSingle synchronously sends an event to a single user stream.

func (*ClientStreams) StartNew

func (cs *ClientStreams) StartNew(srv pb.Doko_StartSessionServer, user u.Id) chan int

type ServerConfig

type ServerConfig struct {
	Tables TablesConfig
}

type TablesConfig

type TablesConfig struct {
	InputSeed int64
}

func (*TablesConfig) Seed

func (cfg *TablesConfig) Seed() int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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