saas_api

package
v0.0.0-...-67e3d2d Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Logger   saas_logger.Logger
	Event    saas_event.Event
	Security saas_security.Security
	Database *saas_database.Database
	Origins  []string
	Jwt      *Jwt
	Tls      *Tls
	Port     string
	Mode     string
	*sync.RWMutex
	// contains filtered or unexported fields
}

func (*Api) Extend

func (api *Api) Extend(handler func(api *Api))

func (*Api) GetAuthMiddleware

func (api *Api) GetAuthMiddleware() *jwt.GinJWTMiddleware

func (*Api) GetDatabase

func (api *Api) GetDatabase() *saas_database.Database

func (*Api) GetEngine

func (api *Api) GetEngine() *gin.Engine

func (*Api) GetEvent

func (api *Api) GetEvent() saas_event.Event

func (*Api) GetLogger

func (api *Api) GetLogger() saas_logger.Logger

func (*Api) GetSecurity

func (api *Api) GetSecurity() saas_security.Security

func (*Api) GetUserId

func (api *Api) GetUserId(c *gin.Context) (uint, error)

GetUserId returns the current jwt user id if exists

func (*Api) Response

func (api *Api) Response(error, data interface{}) gin.H

func (*Api) Start

func (api *Api) Start() error

type Jwt

type Jwt struct {
	Key string
	*sync.RWMutex
}

type Tls

type Tls struct {
	CertPath string
	KeyPath  string
	*sync.RWMutex
}

Jump to

Keyboard shortcuts

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