implementation

package
v0.0.0-...-cc5cd34 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DEFAULT = map[string]interface{}{
	"REDIS_ADDR":       "localhost:6379",
	"REDIS_PASSWORD":   "",
	"REDIS_DB":         0,
	"SERVICE_HOST":     "localhost",
	"SERVICE_PORT":     1234,
	"JWT_SIGNING_KEY":  "HolaEnfermera",
	"POSTGRES_CONNSTR": "postgres://postgres:123123@192.168.0.19/postgres?sslmode=disable",
}

Functions

func NewAuthUserPostgresStorage

func NewAuthUserPostgresStorage(conf PostgresConf) *authUserPostgresStorage

func NewAuthenticator

func NewAuthenticator() *authenticator

func NewEndpoint

func NewEndpoint(path string, handler func(http.ResponseWriter, *http.Request), methods []string) *endpoint

func NewHttpRouter

func NewHttpRouter() *httpRouter

func NewRedisStringStorage

func NewRedisStringStorage(conf RedisConf) *redisStringStorage

func NewRegisterUserApp

func NewRegisterUserApp(registerUserUC usecases.RegisterUserUC) *registerUserApp

Public constructor

Types

type AuthData

type AuthData struct {
	AuthMethod string
	Password   string
}

type EnvOrDefaultConf

type EnvOrDefaultConf struct{}

func NewEnvOrDefaultConf

func NewEnvOrDefaultConf() *EnvOrDefaultConf

func (*EnvOrDefaultConf) GetConnStr

func (c *EnvOrDefaultConf) GetConnStr() string

func (*EnvOrDefaultConf) GetHost

func (c *EnvOrDefaultConf) GetHost() string

func (*EnvOrDefaultConf) GetPort

func (c *EnvOrDefaultConf) GetPort() int

func (*EnvOrDefaultConf) GetRedisAddr

func (c *EnvOrDefaultConf) GetRedisAddr() string

func (*EnvOrDefaultConf) GetRedisDB

func (c *EnvOrDefaultConf) GetRedisDB() int

func (*EnvOrDefaultConf) GetRedisPassword

func (c *EnvOrDefaultConf) GetRedisPassword() string

func (*EnvOrDefaultConf) GetSigningKey

func (c *EnvOrDefaultConf) GetSigningKey() string

type HttpApp

type HttpApp interface {
	GetEndpoints() []*endpoint
}

type HttpServer

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

func (*HttpServer) Init

func (server *HttpServer) Init(conf ServerConf, router *httpRouter)

func (*HttpServer) Start

func (server *HttpServer) Start()

type JWTConfiguration

type JWTConfiguration interface {
	GetSigningKey() string
}

type JWTGenerator

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

func NewJWTGenerator

func NewJWTGenerator(conf JWTConfiguration) *JWTGenerator

func (*JWTGenerator) GetToken

func (self *JWTGenerator) GetToken(issuer string) (string, error)

type LoginApp

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

func NewLoginApp

func NewLoginApp(loginUC usecases.LoginUC) *LoginApp

Public constructor

func (*LoginApp) GetEndpoints

func (app *LoginApp) GetEndpoints() []*endpoint

type PostgresConf

type PostgresConf interface {
	GetConnStr() string
}

type RedisConf

type RedisConf interface {
	GetRedisAddr() string
	GetRedisPassword() string
	GetRedisDB() int
}

type RequestData

type RequestData struct {
	Id          string
	Data        interface{}
	LoginMethod string
	AuthData    interface{}
	LoginData   interface{}
}

type ServerConf

type ServerConf interface {
	GetHost() string
	GetPort() int
}

Jump to

Keyboard shortcuts

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