hub

package
v0.0.0-...-2d52d2e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultThemeColorDark = "#00bfff"

DefaultThemeColorDark for new users

View Source
var DefaultThemeColorLight = "#0057ad"

DefaultThemeColorLight for new users

View Source
var ErrInvalidLogin = errors.New("Invalid Login")

ErrInvalidLogin is when the login credentials are incorrect

View Source
var ErrMissingValidSession = errors.New("No Valid Session")

ErrMissingValidSession is when there is no valid session

View Source
var ErrServerAlreadySetup = errors.New("Server Already Setup")

ErrServerAlreadySetup is when the server is already setup

Functions

This section is empty.

Types

type Service

type Service struct {
	Logger      *log.Logger
	HTTPLogger  *log.Logger
	ErrorLogger *log.Logger
	AuditLogger *log.Logger
	DebugLogger *log.Logger
	Rollbar     *rollbar.Client
	// contains filtered or unexported fields
}

Service is the internal API of Hub

func NewService

func NewService(newConfig *hubconfig.Config, newContainer container.Container) *Service

NewService returns a production instance of the service

func (*Service) CreateUser

func (s *Service) CreateUser(request entity.UserCreateRequest) (entity.UserContext, error)

CreateUser creates a User

func (*Service) DeleteUser

func (s *Service) DeleteUser(uuid string) error

DeleteUser deletes a user

func (*Service) GetCurrentSession

func (s *Service) GetCurrentSession(token string) (entity.Session, error)

GetCurrentSession gets the current session

func (*Service) GetServerStatus

func (s *Service) GetServerStatus() (entity.ServerStatus, error)

GetServerStatus gets the status for the server

func (*Service) GetUserContextByUUID

func (s *Service) GetUserContextByUUID(uuid string) (entity.UserContext, error)

GetUserContextByUUID by UUID and get the full conext

func (*Service) ListUsers

func (s *Service) ListUsers() ([]entity.User, error)

ListUsers gets all users

func (*Service) Login

func (s *Service) Login(loginRequest entity.UserLoginRequest) (entity.Session, error)

Login attempts to create a session

func (*Service) SaveSession

func (s *Service) SaveSession(sessionID string, userContext entity.UserContext) (entity.Session, error)

SaveSession saves a session

func (*Service) SetupServer

func (s *Service) SetupServer(createUserRequest entity.UserCreateRequest) (entity.Session, error)

SetupServer sets up the server

func (*Service) UpdateUser

func (s *Service) UpdateUser(request entity.UserUpdateRequest) (entity.UserContext, error)

UpdateUser updates the full user context

Jump to

Keyboard shortcuts

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