Documentation ¶
Index ¶
- func CreateAuthenticatingGrpcServer(users users.Users) *grpc.Server
- func CreateServer(users u.Users, tables *t.Tables, config ServerConfig) *grpc.Server
- func GetAuthenticatedUser(ctx context.Context) (user users.AccountData, success bool)
- func WrapServerForGrpcWeb(grpcServer *grpc.Server, staticDirectory string, allowedOriginHostname string) *http.Server
- type ClientStream
- type ClientStreams
- type ServerConfig
- type TablesConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAuthenticatingGrpcServer ¶
CreateAuthenticatingGrpcServer returns a grpc.Server set up with authenticating interceptors from the grpc_auth package.
func CreateServer ¶
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) 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