controller

package
v0.0.0-...-3a56714 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERRORGETCASTELLTYPE       = "error getting castell type"
	ERRORGETCASTELLLIST       = "error getting castell list"
	ERRORGETCASTELLMODEL      = "error getting castell model"
	ERRORCASTELLMODELNOTFOUND = "castell model not found"
	ERRORCASTELLTYPENOTFOUND  = "castell type not found"
	ERRORDELETECASTELLMODEL   = "error deleting castell model"
	ERRORCREATECASTELLMODEL   = "error creating castell model"
	ERRORUPDATECASTELLMODEL   = "error editing castell model"
	ERRORADDCASTELLTOEVENT    = "error adding castell model to event"
	ERRORREMOVECASTELLTOEVENT = "error removing castell model from event"
)
View Source
const (
	ERRORINVALIDPAYLOAD = "invalid request payload"
	ERRORINTERNAL       = "internal error"
	ERRORNOTIFICATION   = "error creating notification"
	ERRORAUTHENTICATION = "error with the provided token"
	ERRORMISSINGFIELDS  = "missing fields in request payload"
	ERRORUNAUTHORIZED   = "you are not authorized to perform this action."
)
View Source
const (
	ERROREVENTNOTFOUND        = "event not found"
	ERRORGETEVENT             = "error getting event"
	ERRORGETEVENTS            = "error getting events"
	ERRORGETPRESENCE          = "error getting presence"
	ERRORGETATTENDANCE        = "error getting attendance"
	ERRORCREATERECURRINGEVENT = "error creating recurring event"
	ERRORGETTINGTIMEZONE      = "error getting timezone"
	ERRORUPDATEEVENT          = "error updating event"
	ERRORDELETEEVENT          = "error deleting event"
)
View Source
const (
	ERRORCREATETOKEN      = "error creating the token"
	ERRORREFRESHTOKEN     = "error refreshing token"
	ERRORTOKENEXPIRED     = "token has expired"
	ERRORTOKENINVALID     = "token is invalid"
	ERRORGUESTCANNOTLOGIN = "guests cannot login"
)
View Source
const (
	ERRORGETMEMBER              = "error getting member"
	ERRORGETMEMBERS             = "error getting members"
	ERRORCREATEMEMBER           = "error creating member"
	ERRORMEMBERNOTFOUND         = "member not found"
	ERRORMEMBERHEIGHT           = "error with provided height"
	ERRORMEMBERWEIGHT           = "error with the provided weight"
	ERRORMEMBERROLES            = "error with the roles provided"
	ERRORMEMBERLANGUAGE         = "error with the language provided"
	ERRORMEMBERTYPE             = "error with the type provided"
	ERRORUPDATEMEMBER           = "error updating member"
	ERRORDELETEMEMBER           = "error deleting member"
	ERRORREGISTRATIONEMAIL      = "error sending the registration email"
	ERRORRESETCREDENTIALS       = "error resetting credentials"
	ERROREMAILUNAVAILABLE       = "this email is already used by another member."
	ERRORGUESTREGISTRATIONEMAIL = "guests cannot receive the registration email."
	ERRORUPDATEMEMBERTYPE       = "error changing the type of the member"
	ERRORACTIVATINGMEMBER       = "error setting the member as active"
	ERRORCHANGINGMEMBERSTATUS   = "error changing the status of the member"
	ERRORADDINGDEPENDENT        = "error while adding a dependent"
)
View Source
const (
	ERRORPARTICIPATEEVENT = "Error setting participation to event"
	ERRORPRESENCEEVENT    = "Error setting presence to event"
	ERRORGETPARTICIPATION = "Error getting participation"
)
View Source
const DEFAULT_LIMIT = 10
View Source
const (
	ERRORAPPALREADYINITIALIZED = "the app is already initialized"
)
View Source
const MAX_LIMIT = 100
View Source
const ParticipateEventPermission = "participate_event"
View Source
const ResetCredentialsPermission = "reset_credentials"

Variables

View Source
var RedisClient *redis.Client

Functions

func AddRemoveDependent

func AddRemoveDependent(w http.ResponseWriter, r *http.Request)

func AttachCastellModelToEvent

func AttachCastellModelToEvent(w http.ResponseWriter, r *http.Request)

func CreateCastellModel

func CreateCastellModel(w http.ResponseWriter, r *http.Request)

func CreateEvent

func CreateEvent(w http.ResponseWriter, r *http.Request)

func CreateMember

func CreateMember(w http.ResponseWriter, r *http.Request)

func DeleteCastellModel

func DeleteCastellModel(w http.ResponseWriter, r *http.Request)

func DeleteEvent

func DeleteEvent(w http.ResponseWriter, r *http.Request)

func DeleteMember

func DeleteMember(w http.ResponseWriter, r *http.Request)

func DettachCastellModelFromEvent

func DettachCastellModelFromEvent(w http.ResponseWriter, r *http.Request)

func EditCastellModel

func EditCastellModel(w http.ResponseWriter, r *http.Request)

func EditMember

func EditMember(w http.ResponseWriter, r *http.Request)

func ForgotPassword

func ForgotPassword(w http.ResponseWriter, r *http.Request)

func GetCastellModel

func GetCastellModel(w http.ResponseWriter, r *http.Request)

func GetCastellModels

func GetCastellModels(w http.ResponseWriter, r *http.Request)

func GetCastellType

func GetCastellType(w http.ResponseWriter, r *http.Request)

func GetCastellTypeList

func GetCastellTypeList(w http.ResponseWriter, r *http.Request)

func GetEvent

func GetEvent(w http.ResponseWriter, r *http.Request)

func GetEventParticipation

func GetEventParticipation(w http.ResponseWriter, r *http.Request)

func GetEvents

func GetEvents(w http.ResponseWriter, r *http.Request)

func GetMember

func GetMember(w http.ResponseWriter, r *http.Request)

func GetMembers

func GetMembers(w http.ResponseWriter, r *http.Request)

func GetRoles

func GetRoles(w http.ResponseWriter, r *http.Request)

func Initialize

func Initialize(w http.ResponseWriter, r *http.Request)

func InitializeRedis

func InitializeRedis()

func IsInitialized

func IsInitialized(w http.ResponseWriter, r *http.Request)

func Login

func Login(w http.ResponseWriter, r *http.Request)

func Logout

func Logout(w http.ResponseWriter, r *http.Request)

func ParticipateEvent

func ParticipateEvent(w http.ResponseWriter, r *http.Request)

func ParticipateEventToken

func ParticipateEventToken(ctx context.Context, uuid string, ttl int) (string, error)

func PresenceEvent

func PresenceEvent(w http.ResponseWriter, r *http.Request)

func RefreshToken

func RefreshToken(w http.ResponseWriter, r *http.Request)

func ResetCredentials

func ResetCredentials(w http.ResponseWriter, r *http.Request)

func ResetCredentialsToken

func ResetCredentialsToken(ctx context.Context, uuid string, email string, ttl int) (string, error)

func RespondWithError

func RespondWithError(w http.ResponseWriter, code int, message string)

func RespondWithJSON

func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})

func SendRegistrationEmail

func SendRegistrationEmail(w http.ResponseWriter, r *http.Request)

func UpdateEvent

func UpdateEvent(w http.ResponseWriter, r *http.Request)

func Version

func Version(w http.ResponseWriter, r *http.Request)

Types

type AccessTokenDetails

type AccessTokenDetails struct {
	TokenUuid   string
	RefreshUuid string
	UserId      string
	Permissions []string
}

func ExtractToken

func ExtractToken(ctx context.Context, r *http.Request) (*AccessTokenDetails, error)

type Scheduler

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

func (*Scheduler) Start

func (s *Scheduler) Start()

type TokenDetails

type TokenDetails struct {
	AccessToken  string
	RefreshToken string
	AccessUuid   string
	RefreshUuid  string
	AtExpires    int64
	RtExpires    int64
}

Jump to

Keyboard shortcuts

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