utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCookie

func DeleteCookie(ctx *gin.Context, name string)

Types

type SessionData

type SessionData struct {
	SessionUUID string `json:"session_uuid"`
	UserUUID    string `json:"user_uuid"`
	Email       string `json:"email"`
	Name        string `json:"name"`
	Role        string `json:"role"`
	AvatarURL   string `json:"avatar"`
}

func ByteSliceToSessionData

func ByteSliceToSessionData(b []byte) (*SessionData, error)

func NewSessionData

func NewSessionData(sessionUUID, userUUID, email, name, role, avatarURL string) *SessionData

type Whitelist

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

func (*Whitelist) AddGeneralUser

func (w *Whitelist) AddGeneralUser(email string)

func (*Whitelist) AdminEmails

func (w *Whitelist) AdminEmails() []string

func (*Whitelist) EmailDomains

func (w *Whitelist) EmailDomains() []string

func (*Whitelist) GeneralEmails

func (w *Whitelist) GeneralEmails() []string

func (*Whitelist) IsAdminUser

func (w *Whitelist) IsAdminUser(email string) bool

func (*Whitelist) IsDomainUser

func (w *Whitelist) IsDomainUser(email string) bool

func (*Whitelist) IsGeneralUser

func (w *Whitelist) IsGeneralUser(email string) bool

func (*Whitelist) IsUser

func (w *Whitelist) IsUser(email string) bool

func (*Whitelist) Users

func (w *Whitelist) Users() []string

type WhitelistInfo

type WhitelistInfo interface {
	Users() []string
	GeneralEmails() []string
	AdminEmails() []string
	EmailDomains() []string
	IsUser(email string) bool
	IsDomainUser(email string) bool
	IsGeneralUser(email string) bool
	IsAdminUser(email string) bool
	AddGeneralUser(email string)
}

func NewWhitelist

func NewWhitelist(userRepo repos.UserRepo) (WhitelistInfo, error)

Jump to

Keyboard shortcuts

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