models

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CookieName_Token = "token"
)

Variables

This section is empty.

Functions

func GetToken

func GetToken(req *http.Request) (token *string, err error)

GetToken tries to read a token. If a token is not found, null is returned.

func NewArrayFromScannableSource

func NewArrayFromScannableSource[T any](src IScannableSequence) (values []T, err error)

func NewValueFromScannableSource

func NewValueFromScannableSource[T any](src IScannable) (*T, error)

Types

type IApplication

type IApplication interface {
	Use() error
}

type IScannable

type IScannable interface {
	Scan(dest ...any) error
}

type IScannableSequence

type IScannableSequence interface {
	IScannable
	Next() bool // = HasNextValue()
}

type IServer

type IServer interface {
	Start() error
	ReportStart()
	Stop() error
	GetStopChannel() *chan bool
	UseConstructor(ISettings) (IServer, error)
}

type ISettings

type ISettings interface {
	Check() error
	UseConstructor(string, *ver.Versioneer) (ISettings, error)
}

type UserParameters

type UserParameters struct {
	Id           uint      `json:"id"`
	PreRegTime   time.Time `json:"preRegTime"`
	Email        string    `json:"email"`
	Name         string    `json:"name"`
	ApprovalTime time.Time `json:"approvalTime"`
	RegTime      time.Time `json:"regTime"`
	UserRoles
	LastBadLogInTime  *time.Time `json:"lastBadLogInTime"`
	BanTime           *time.Time `json:"banTime"`
	LastBadActionTime *time.Time `json:"lastBadActionTime"`
}

func NewUserParameters

func NewUserParameters() (up *UserParameters)

func NewUserParametersFromScannableSource

func NewUserParametersFromScannableSource(src IScannable) (up *UserParameters, err error)

type UserRoles

type UserRoles struct {
	IsAdministrator bool `json:"isAdministrator"`
	IsModerator     bool `json:"isModerator"`
	IsAuthor        bool `json:"isAuthor"`
	IsWriter        bool `json:"isWriter"`
	IsReader        bool `json:"isReader"`
	CanLogIn        bool `json:"canLogIn"`
}

func NewUserRoles

func NewUserRoles() (ur *UserRoles)

func NewUserRolesFromScannableSource

func NewUserRolesFromScannableSource(src IScannable) (ur *UserRoles, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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