api

package
v0.0.0-...-606cdbc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionClosed

type ConnectionClosed struct{}

func (ConnectionClosed) Error

func (e ConnectionClosed) Error() string

type GRPCApi

type GRPCApi struct {
	S *grpc.Server

	pb.UnimplementedAuthServer
	pb.UnimplementedMessagesServer
	// contains filtered or unexported fields
}

func (*GRPCApi) Bufconn

func (api *GRPCApi) Bufconn() *bufconn.Listener

func (GRPCApi) GetMessageHistory

func (api GRPCApi) GetMessageHistory(ctx context.Context, history *pb.RequestMessageHistory) (*pb.MessageHistory, error)

func (*GRPCApi) HandleMessages

func (api *GRPCApi) HandleMessages(stream pb.Messages_HandleMessagesServer) error

func (*GRPCApi) Listen

func (api *GRPCApi) Listen(lis net.Listener)

func (*GRPCApi) Login

func (api *GRPCApi) Login(ctx context.Context, in *pb.ClientAuth) (*pb.AuthAck, error)

gRPC doesn't have any way of identifying clients, other than client metadata. To avoid cluttering all the protobuf requests with token parameters, and to avoid messy bidirectional stream workarounds, Fenix uses session tokens in metadata. Clients are expected to log in and then keep that session token in metadata, and renew when it expires. If anyone has a better solution, open an issue.

func (*GRPCApi) Prepare

func (api *GRPCApi) Prepare()

func (*GRPCApi) Serve

func (api *GRPCApi) Serve()

type InvalidUsername

type InvalidUsername struct{}

func (InvalidUsername) Error

func (e InvalidUsername) Error() string

Jump to

Keyboard shortcuts

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