Documentation ¶
Index ¶
- Constants
- Variables
- func InitializeDB(dbname string)
- func ValidNumberOrEmpty(field string) error
- func ValidateLanguage(language string) error
- func ValidateRoles(roles []string) error
- func ValidateType(memberType string) error
- type CastellModel
- func (c *CastellModel) AttachToEvent(ctx context.Context, e *Event) error
- func (c *CastellModel) Create(ctx context.Context) error
- func (c *CastellModel) Delete(ctx context.Context) error
- func (c *CastellModel) DettachFromEvent(ctx context.Context, e *Event) error
- func (c *CastellModel) Edit(ctx context.Context) error
- func (c *CastellModel) Get(ctx context.Context) error
- func (c *CastellModel) GetAll(ctx context.Context) ([]CastellModel, error)
- func (c *CastellModel) GetAllFromEvent(ctx context.Context, event Event) ([]CastellModel, error)
- type CastellModelEvent
- type CastellPosition
- type CastellPositionMembers
- type CastellType
- type Credentials
- type Event
- func (e *Event) CreateEvent(ctx context.Context) error
- func (e *Event) DeleteEvent(ctx context.Context) error
- func (e *Event) Get(ctx context.Context) error
- func (e *Event) GetAll(ctx context.Context, page, limit int, pastEvents bool) ([]Event, error)
- func (e *Event) GetAttendance(ctx context.Context) error
- func (e *Event) GetUpcomingEventsWithoutNotification(ctx context.Context, eventType string) ([]Event, error)
- func (e *Event) UpdateEvent(ctx context.Context) error
- type LatLng
- type Member
- func (m *Member) AddDependent(ctx context.Context, dependent *Member) error
- func (m *Member) CreateMember(ctx context.Context) error
- func (m *Member) DeleteMember(ctx context.Context) error
- func (m *Member) EditMember(ctx context.Context) error
- func (m *Member) Get(ctx context.Context) error
- func (m *Member) GetAll(ctx context.Context, memberStatusList, memberTypeList []string) ([]Member, error)
- func (m *Member) GetByEmail(ctx context.Context) error
- func (m *Member) GetDependents(ctx context.Context) ([]Member, error)
- func (m *Member) GetMemberLastParticipation(ctx context.Context) (Event, error)
- func (m *Member) RemoveDependent(ctx context.Context, dependent *Member) error
- func (m *Member) SetStatus(ctx context.Context, status string) error
- type Notification
- type Participation
- type Recurring
- type RecurringEvent
Constants ¶
View Source
const ( CASTELLTYPESVIEW = "castell_types_view" CASTELLTYPESTABLE = "castell_types" CASTELLPOSITIONSTABLE = "castell_positions" CASTELLMODELSTABLE = "castell_models" CASTELLMODELSVIEW = "castell_models_view" CASTELLMEMBERPOSITIONSTABLE = "castell_members_positions" CASTELLMODELSINEVENTSTABLE = "castell_models_in_events" CASTELLMODELSINEVENTSVIEW = "castell_models_with_events_view" )
View Source
const ( MEMBERSTABLE = "members" MEMBERSCREDENTIALSTABLE = "members_credentials" MEMBERSDEPENDANTSTABLE = "members_dependent" MEMBERSTYPEADMIN = "admin" MEMBERSTYPEREGULAR = "member" MEMBERSTYPECANALLA = "canalla" MEMBERSTYPEGUEST = "guest" MEMBERSSTATUSCREATED = "created" MEMBERSSTATUSACTIVATED = "active" MEMBERSSTATUSPAUSED = "paused" MEMBERSSTATUSDELETED = "deleted" MEMBERSSTATUSPURGED = "purged" MEMBERSEMAILNOTFOUNDMESSAGE = "no member found with this email" )
View Source
const EVENTS_TABLE = "events"
View Source
const NotificationDeliveryFailure = 2
View Source
const NotificationDeliveryInProgress = 99
View Source
const NotificationDeliveryPartialFailure = 3
View Source
const NotificationDeliverySuccess = 1
View Source
const NotificationNotDelivered = 0
View Source
const NotificationTooLate = 98
View Source
const PARTICIPATION_TABLE = "participation"
View Source
const RECURRING_EVENTS_TABLE = "recurring_events"
View Source
const TypeEventCreated = "eventCreated"
View Source
const TypeEventDeleted = "eventDeleted"
View Source
const TypeEventModified = "eventModified"
View Source
const TypeForgotPassword = "forgotPassword"
View Source
const TypeMemberRegistration = "memberRegistration"
View Source
const TypeSummaryEvent = "summaryEvent"
View Source
const TypeUpcomingEvent = "upcomingEvent"
Variables ¶
View Source
var ValidEventTypes = []string{
"presentation",
"practice",
"social",
}
View Source
var ValidLanguageList = []string{
"fr",
"en",
"cat",
}
View Source
var ValidMemberTypes = []string{ MEMBERSTYPEADMIN, MEMBERSTYPEREGULAR, MEMBERSTYPEGUEST, MEMBERSTYPECANALLA, }
View Source
var ValidRoleList = []string{
"baix",
"contrafort",
"primera mà",
"segona mà",
"lateral",
"vent",
"agulla",
"crossa",
"segon",
"terç",
"quart",
"dos",
"acotxador",
"enxaneta",
"pinya",
}
Functions ¶
func InitializeDB ¶
func InitializeDB(dbname string)
func ValidNumberOrEmpty ¶
func ValidateLanguage ¶
func ValidateRoles ¶
func ValidateType ¶
Types ¶
type CastellModel ¶
type CastellModel struct { UUID string `json:"uuid"` Name string `json:"name"` Type string `json:"type"` // Will be the name of the castell type, ie: 3d6 PositionMembers []CastellPositionMembers `json:"position_members,omitempty"` Event CastellModelEvent `json:"event,omitempty"` }
func (*CastellModel) AttachToEvent ¶
func (c *CastellModel) AttachToEvent(ctx context.Context, e *Event) error
func (*CastellModel) DettachFromEvent ¶
func (c *CastellModel) DettachFromEvent(ctx context.Context, e *Event) error
func (*CastellModel) GetAll ¶
func (c *CastellModel) GetAll(ctx context.Context) ([]CastellModel, error)
func (*CastellModel) GetAllFromEvent ¶
func (c *CastellModel) GetAllFromEvent(ctx context.Context, event Event) ([]CastellModel, error)
type CastellModelEvent ¶
type CastellPosition ¶
type CastellPositionMembers ¶
type CastellPositionMembers struct { MemberUUID string `json:"member_uuid"` Position CastellPosition `json:"position"` }
type CastellType ¶
type CastellType struct { Name string `json:"name"` Positions []CastellPosition `json:"positions"` }
func (*CastellType) GetTypeList ¶
func (c *CastellType) GetTypeList(ctx context.Context) ([]string, error)
type Credentials ¶
type Credentials struct { UUID string `json:"-"` Username string `json:"username"` Password string `json:"password"` PasswordHashed []byte `json:"-"` }
func (*Credentials) GetCredentials ¶
func (c *Credentials) GetCredentials(ctx context.Context) error
func (*Credentials) GetCredentialsByUUID ¶
func (c *Credentials) GetCredentialsByUUID(ctx context.Context) error
func (*Credentials) ResetCredentials ¶
type Event ¶
type Event struct { UUID string `json:"uuid"` Name string `json:"name"` Description string `json:"description"` StartDate uint `json:"startDate"` EndDate uint `json:"endDate"` Recurring Recurring `json:"recurring"` Type string `json:"type"` Participation string `json:"participation"` Attendance uint `json:"attendance"` Location LatLng `json:"location"` LocationName string `json:"locationName"` RecurringEvent string }
func (*Event) GetUpcomingEventsWithoutNotification ¶
type Member ¶
type Member struct { UUID string `json:"uuid"` FirstName string `json:"firstName"` // Encrypted LastName string `json:"lastName"` // Encrypted Height string `json:"height"` // Encrypted Weight string `json:"weight"` // Encrypted Roles []string `json:"roles"` // Encrypted Extra string `json:"extra"` // Encrypted Email string `json:"email"` // Encrypted Contact string `json:"contact"` // Encrypted Type string `json:"type"` Status string `json:"status"` Subscribed int `json:"subscribed"` Language string `json:"language"` Participation string `json:"participation"` Presence string `json:"presence"` }
func (*Member) AddDependent ¶
func (*Member) GetDependents ¶
func (*Member) GetMemberLastParticipation ¶
func (*Member) RemoveDependent ¶
type Notification ¶
type Notification struct { ID int NotificationType string ObjectUUID string // TODO: remove this field SendDate int Delivered int Payload []byte }
func (*Notification) CreateNotification ¶
func (n *Notification) CreateNotification(ctx context.Context) error
func (*Notification) GetNotificationsReady ¶
func (n *Notification) GetNotificationsReady(ctx context.Context) ([]Notification, error)
func (*Notification) UpdateNotificationStatus ¶
func (n *Notification) UpdateNotificationStatus(ctx context.Context) error
type Participation ¶
type Participation struct { EventUUID string `json:"eventUuid"` MemberUUID string `json:"memberUuid"` Answer string `json:"answer"` Presence string `json:"presence"` }
func (*Participation) GetParticipation ¶
func (p *Participation) GetParticipation(ctx context.Context) error
func (*Participation) Participate ¶
func (p *Participation) Participate(ctx context.Context) error
A member will say if he or she participates BEFORE the event: We always insert in the table
type RecurringEvent ¶
func (*RecurringEvent) CreateRecurringEvent ¶
func (r *RecurringEvent) CreateRecurringEvent(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.