server

package
v0.0.0-...-98550de Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiServer

type ApiServer struct {
	pb.UnimplementedApiServiceServer
	// contains filtered or unexported fields
}

func NewApiServer

func NewApiServer(jwtManager service.JWTManagerProtol, roomStore repository.RoomStore, messageStore repository.MessageStore, amqpManager service.AMQPProducer) *ApiServer

func (*ApiServer) CreateRoom

func (s *ApiServer) CreateRoom(ctx context.Context, req *pb.CreateRoomRequest) (*pb.CreateRoomStatus, error)

func (*ApiServer) ListMessages

func (*ApiServer) ListRooms

func (s *ApiServer) ListRooms(ctx context.Context, req *pb.ListRoomsRequest) (*pb.ListRoomsResponse, error)

func (*ApiServer) SendMessage

func (s *ApiServer) SendMessage(ctx context.Context, req *pb.MessageRequest) (*pb.MessageResponse, error)

type AuthInterceptor

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

func NewAuthInterceptor

func NewAuthInterceptor(jwtManager service.JWTManagerProtol, endpointRoles EndpointRoles) *AuthInterceptor

func (*AuthInterceptor) Stream

func (*AuthInterceptor) Unary

type AuthServer

type AuthServer struct {
	pb.UnimplementedAuthServiceServer
	// contains filtered or unexported fields
}

func NewAuthServer

func NewAuthServer(userStore repository.UserStore, refreshTokenStore repository.RefreshTokenStore, jwtManager service.JWTManagerProtol) *AuthServer

func (*AuthServer) Login

func (s *AuthServer) Login(ctx context.Context, req *pb.LoginRequest) (*pb.TokenResponse, error)

func (*AuthServer) Refresh

func (s *AuthServer) Refresh(ctx context.Context, req *pb.RefreshRequest) (*pb.TokenResponse, error)

func (*AuthServer) Register

func (s *AuthServer) Register(ctx context.Context, req *pb.RegisterRequest) (*pb.TokenResponse, error)

type EndpointRoles

type EndpointRoles = map[string][]string

func NewEndpointRoles

func NewEndpointRoles(endpoints *Endpoints) EndpointRoles

type Endpoints

type Endpoints struct {
	ApiService     apiServiceEndpoints
	AuthService    authServiceEndpoints
	MessageService messageServiceEndpoints
}

func NewEndpoints

func NewEndpoints() *Endpoints

type Env

type Env struct {
	API_HOST                   string
	MESSAGE_HOST               string
	POSTGRES_DB                string
	POSTGRES_USER              string
	POSTGRES_PASSWORD          string
	PGADMIN_DEFAULT_EMAIL      string
	PGADMIN_DEFAULT_PASSWORD   string
	PGADMIN_CONFIG_SERVER_MODE string
	JWT_SECRET                 string
	RABBITMQ_DEFAULT_USER      string
	RABBITMQ_DEFAULT_PASS      string
	JWT_DURATION_MIN           int
	REFRESH_DURATION_DAYS      int
}

func NewEnv

func NewEnv() *Env

type MessageServer

type MessageServer struct {
	pb.UnimplementedMessageServiceServer
	// contains filtered or unexported fields
}

func NewMessageServer

func NewMessageServer(jwtManager *service.JWTManager, sessionStore repository.SessionStore) *MessageServer

func (*MessageServer) GetMessages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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