service

package
v0.0.0-...-660482d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	Config *domain.Config
}

AuthService provides authenticates users and handles JWT tokens

func (*AuthService) GenerateJWT

func (a *AuthService) GenerateJWT() (string, error)

GenerateJWT generates a JWT token from user credentials

type ConfigService

type ConfigService struct {
	Config   *domain.Config
	Location string
}

ConfigService loads and stores app configurations

func (*ConfigService) Reload

func (s *ConfigService) Reload() error

Reload reads the config and applies changes

func (*ConfigService) Watch

func (s *ConfigService) Watch(d time.Duration)

Watch reloads the config every d duration

type DAL

type DAL struct {
	Client *mongo.Client
	Config *domain.Config
	DB     *mongo.Database
	Ctx    context.Context
}

DAL stores shared data access resources

func (*DAL) Connect

func (d *DAL) Connect()

Connect inits MongoDB connection

Jump to

Keyboard shortcuts

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