utils

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 8 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)

func ToUserInfoResponse added in v0.1.3

func ToUserInfoResponse(users []usermodels.UserInfo) []usermodels.UserResponse

func ValidateToAchievementArgs added in v0.1.3

func ValidateToAchievementArgs(models []clubmodels.AchievementRequest) []string

func ValidateToActivityDetailArgs added in v0.1.3

func ValidateToActivityDetailArgs(models []clubmodels.ActivityDetailRequest) []repos.ActivityDetailArgs

func ValidateToContentArgs added in v0.1.3

func ValidateToContentArgs(models []clubmodels.ContentRequest) []string

func ValidateToImageArgs added in v0.1.3

func ValidateToImageArgs(models []clubmodels.ImageRequest) []uint32

func ValidateToLinksArgs added in v0.1.3

func ValidateToLinksArgs(models []clubmodels.LinkRequest) []repos.ClubLinkArgs

func ValidateToPlaceArgs added in v0.1.3

func ValidateToPlaceArgs(models []clubmodels.ActivityDetailRequest) []repos.ClubPlaceArgs

func ValidateToScheduleArgs added in v0.1.3

func ValidateToScheduleArgs(models []clubmodels.ScheduleRequest) []repos.ClubScheduleArgs

func ValidateToTPRemarkArgs added in v0.1.3

func ValidateToTPRemarkArgs(models []clubmodels.ActivityDetailRequest) []repos.ClubTPRemarkArgs

func ValidateToTimeArgs added in v0.1.3

func ValidateToTimeArgs(models []clubmodels.ActivityDetailRequest) []repos.ClubTimeArgs

func ValidateToVideoArgs added in v0.1.3

func ValidateToVideoArgs(models []clubmodels.VideoRequest) []string

Types

type IGeneralUserGetter added in v0.1.3

type IGeneralUserGetter interface {
	GetAllGeneralUser() ([]models.GeneralUser, error)
}

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(getterFn IGeneralUserGetter) (WhitelistInfo, error)

Jump to

Keyboard shortcuts

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