cmd

package
v0.0.0-...-cee1f35 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2020 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotExist = errors.New("config does not exist")

Functions

This section is empty.

Types

type App

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

App holds all the repository and gRPC server methods

func (*App) Initialise

func (a *App) Initialise(configPath string) (err error)

Initialise the repository and create the gRPC server

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context) error

Shutdown the connection to the repository and close the gRPC server

func (*App) Start

func (a *App) Start() error

Start serving the gRPC server

type CipherConfig

type CipherConfig struct {
	SaltLength int
	Keys       []string
}

type Configuration

type Configuration struct {
	Address string
	Repo    RepositoryConfig
	Cipher  CipherConfig
	Token   TokenConfig
}

func ParseConfig

func ParseConfig(path string) (*Configuration, error)

ParseConfig will look for a config file in a specified directory. Returns ErrConfigNotExist when the configuration file can't be found

func (*Configuration) SetDefaults

func (c *Configuration) SetDefaults()

SetDefaults will set the defaults for our config struct

type JWTConfig

type JWTConfig struct {
	Expiration int
}

type RefreshConfig

type RefreshConfig struct {
	Length     int
	Expiration int
}

type RepositoryConfig

type RepositoryConfig struct {
	Address       string
	FlushInterval int
}

type TokenConfig

type TokenConfig struct {
	Refresh RefreshConfig
	Jwt     JWTConfig
}

Jump to

Keyboard shortcuts

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