server

package
v0.0.0-...-9b6346a Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthInterceptor

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

AuthInterceptor enforces JWT based authentication on gRPC services

func NewAuthInterceptor

func NewAuthInterceptor(log utilities.Logger, tokenService *services.TokenService, accessibleRoles map[string][]string) *AuthInterceptor

NewAuthInterceptor constructs an AuthInterceptor

func (*AuthInterceptor) Stream

Stream creates and returns a gRPC stream server interceptor

func (*AuthInterceptor) Unary

Unary method creates and returns a gRPC unary server interceptor

type LoggerInterceptor

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

LoggerInterceptor struct

func NewLoggerInterceptor

func NewLoggerInterceptor(logger utilities.Logger, cfg *config.Configuration) *LoggerInterceptor

NewLoggerInterceptor constructs a LoggerInterceptor

func (*LoggerInterceptor) Logger

func (i *LoggerInterceptor) Logger(
	ctx context.Context,
	req interface{},
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (resp interface{}, err error)

Logger Interceptor

type Server

type Server struct {
	TokenService     *services.TokenService
	UserDataService  services.UserDataService
	GroupDataService services.GroupDataService
	TaskDataService  services.TaskDataService
	FileDataService  services.FileDataService
	// contains filtered or unexported fields
}

Server is a struct that stores the API Apps high level attributes such as the router, config, and services

func NewServer

NewServer is a function used to initialize a new Server struct

func (*Server) Start

func (s *Server) Start() error

Start starts the initialized Server

func (*Server) StartTest

func (s *Server) StartTest(ctx context.Context) (*grpc.ClientConn, func())

StartTest starts the initialized Server in a test state

Jump to

Keyboard shortcuts

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