hsessionsvs

package
v1.1.44 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateTokenRequest added in v1.1.0

type CreateTokenRequest struct {
	core.SlotRequestBase

	Expire *int    `json:"expire"`
	User   *string `json:"user" param:"require"`
	IP     *string `json:"ip"`
	Agent  *string `json:"agent"`
}

type RevokeTokenRequest added in v1.1.0

type RevokeTokenRequest struct {
	core.SlotRequestBase

	Token *string `json:"token" param:"require"`
}

type Service

type Service struct {
	core.Service
	// contains filtered or unexported fields
}

func New

func New() *Service

func (*Service) Config

func (this *Service) Config() core.IEntityConf

func (*Service) CreateToken

func (this *Service) CreateToken(req *CreateTokenRequest, res *core.SlotResponse)

func (*Service) EntityStub

func (this *Service) EntityStub() *core.EntityStub

func (*Service) Objects

func (this *Service) Objects() []interface{}

func (*Service) Open

func (this *Service) Open(s core.IServer, instance core.IService, options htypes.Any) *herrors.Error

func (*Service) RevokeToken

func (this *Service) RevokeToken(req *RevokeTokenRequest, res *core.SlotResponse)

func (*Service) VerifyToken

func (this *Service) VerifyToken(req *VerifyTokenRequest, res *core.SlotResponse)

type SessionService

type SessionService struct {
	core.ServiceConf

	DatabaseKey     string
	AutoMigrate     bool
	TokenExpire     int
	SessionsPerUser int
	CheckIP         bool
	CheckUser       bool
	CheckAgent      bool
	MagicToken      string
}

type SvsSessionToken

type SvsSessionToken struct {
	ID       uint      `json:"id"`
	Value    string    `gorm:"size:40;index" json:"value"`
	Agent    string    `json:"agent"`
	IP       string    `gorm:"size:15;index" json:"ip"`
	User     string    `gorm:"size:50;index" json:"user"`
	Validity time.Time `json:"validity"`
}

type VerifyTokenRequest added in v1.1.0

type VerifyTokenRequest struct {
	core.SlotRequestBase

	Token *string `json:"token" param:"require"`
	User  *string `json:"user" param:"require"`
	IP    *string `json:"ip"`
	Agent *string `json:"agent"`
}

Jump to

Keyboard shortcuts

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