ticks24

package module
v0.0.0-...-23d2696 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: MIT, MIT Imports: 17 Imported by: 0

README

User Management Service

It is a generic service which could be used by implementation providers to create custom user management service. But for simplicity there is a sample implementation also provided.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	Config         config.Config `json:"Config"`
	Engine         *gin.Engine
	RootRouter     *gin.RouterGroup
	AppDB          mongo.AppDB
	AuthMiddleware *jwt.GinJWTMiddleware
}

func GetInstance

func GetInstance() (*Service, error)

This returns a new Instance of User Management Service

func (*Service) GetRootRouter

func (this *Service) GetRootRouter() (*gin.RouterGroup, error)

func (*Service) InitService

func (this *Service) InitService() (bool, error)

func (*Service) ReStart

func (this *Service) ReStart() (bool, error)

This function is used to Re-Start the service

func (*Service) SetCmdArgs

func (this *Service) SetCmdArgs() (bool, error)

This sets configuration from command line arguments. Use this when you think your users might want to give command line arguments. Call this after SetConfig if you want it to have more priority.

func (*Service) SetConfigFile

func (this *Service) SetConfigFile(filePath string) (bool, error)

This SetConfig function takes filePath of the config file and loads the User Management Service Instance with specified settings if some error occurs it throws error. if no file is sent in filePath param then default settings are loaded

func (*Service) Start

func (this *Service) Start(isBlocking bool)

This function is used to start-up the service with given settings or default settings If you send isblocking true then the system waits for the server to end first before return Else the call starts the server and returns, then it is up to you to hold the system to keep the service running.

func (*Service) Stop

func (this *Service) Stop() (bool, error)

This function is used to stop the service

Directories

Path Synopsis
db
example
src
microServices
middleware
models
api

Jump to

Keyboard shortcuts

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