service

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildContainer

func BuildContainer(router *mux.Router) *dig.Container

Here is where service container is built. As you can see the service container is provided by Uber DIG library. Se its documentation (https://godoc.org/go.uber.org/dig) to implement extra services.

func CreateSessionStore

func CreateSessionStore(cfg config.Conf) *sessions.CookieStore

Create session CookieStore

func GetHttpServer

func GetHttpServer(router *mux.Router, cfg config.Conf) *http.Server

Prepare HTTP server for Service Container

Types

type Auth

type Auth struct {
	User  model.User `json:"user"`
	Token string
	Conf  config.Conf
}

func SetAuth

func SetAuth(conf config.Conf) *Auth

Prepare Auth structure for Service Container

func (*Auth) GetUser

func (c *Auth) GetUser(req *http.Request)

Get user struct from authentication token (JWT)

func (*Auth) NewToken

func (c *Auth) NewToken() bool

Issue new JWT token

func (*Auth) RefreshToken

func (c *Auth) RefreshToken() bool

Refresh JWT token

Jump to

Keyboard shortcuts

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