Documentation ¶
Index ¶
- func VerifyPassword(hashedPassword, password string) error
- type Base
- type Comment
- func (c *Comment) Count(db *gorm.DB) (int, error)
- func (c *Comment) Delete(db *gorm.DB) error
- func (c *Comment) FindAll(db *gorm.DB) (*[]Object, error)
- func (c *Comment) FindByID(db *gorm.DB, uid uuid.UUID) error
- func (c *Comment) GetCreatedAt() time.Time
- func (c *Comment) GetID() uuid.UUID
- func (c *Comment) Save(db *gorm.DB) error
- func (c *Comment) SetCreatedAt(createdAt time.Time)
- func (c *Comment) Update(db *gorm.DB) error
- func (c *Comment) Validate(action string) error
- type Event
- func (e *Event) Count(db *gorm.DB) (int, error)
- func (e *Event) Delete(db *gorm.DB) error
- func (e *Event) FindAll(db *gorm.DB) (*[]Object, error)
- func (e *Event) FindByID(db *gorm.DB, uid uuid.UUID) error
- func (e *Event) GetCreatedAt() time.Time
- func (e *Event) GetID() uuid.UUID
- func (e *Event) Save(db *gorm.DB) error
- func (e *Event) SetCreatedAt(createdAt time.Time)
- func (e *Event) Update(db *gorm.DB) error
- func (e *Event) Validate(action string) error
- type List
- type Object
- type Session
- func (s *Session) Count(db *gorm.DB) (int, error)
- func (s *Session) Delete(db *gorm.DB) error
- func (s *Session) FindAll(db *gorm.DB) (*[]Object, error)
- func (s *Session) FindByID(db *gorm.DB, uid uuid.UUID) error
- func (s *Session) GetCreatedAt() time.Time
- func (s *Session) GetID() uuid.UUID
- func (s *Session) Save(db *gorm.DB) error
- func (s *Session) SetCreatedAt(createdAt time.Time)
- func (s *Session) Update(db *gorm.DB) error
- func (s *Session) Validate(action string) error
- type Subscription
- func (s *Subscription) Count(db *gorm.DB) (int, error)
- func (s *Subscription) Delete(db *gorm.DB) error
- func (s *Subscription) FindAll(db *gorm.DB) (*[]Object, error)
- func (s *Subscription) FindByID(db *gorm.DB, uid uuid.UUID) error
- func (s *Subscription) GetCreatedAt() time.Time
- func (s *Subscription) GetID() uuid.UUID
- func (s *Subscription) Save(db *gorm.DB) error
- func (s *Subscription) SetCreatedAt(createdAt time.Time)
- func (s *Subscription) Update(db *gorm.DB) error
- func (s *Subscription) Validate(action string) error
- type User
- func (u *User) Count(db *gorm.DB) (int, error)
- func (u *User) Delete(db *gorm.DB) error
- func (u *User) FindAll(db *gorm.DB) (*[]Object, error)
- func (u *User) FindByID(db *gorm.DB, uid uuid.UUID) error
- func (u *User) GetCreatedAt() time.Time
- func (u *User) GetID() uuid.UUID
- func (u *User) Save(db *gorm.DB) error
- func (u *User) SetCreatedAt(createdAt time.Time)
- func (u *User) Update(db *gorm.DB) error
- func (u *User) Validate(action string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyPassword ¶
VerifyPassword checks the known password hash against the hashed string that was provided
Types ¶
type Base ¶
type Base struct { ID uuid.UUID `gorm:"type:uuid;primary_key;" json:"id"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
Base holds technical fields
type Comment ¶
type Comment struct { Base Message string `gorm:"size:255;not null" json:"message"` User User `json:"author"` UserID uuid.UUID Session Session `json:"session"` SessionID uuid.UUID }
Comment represents an user comment in a session
func (*Comment) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt
func (*Comment) SetCreatedAt ¶
SetCreatedAt sets the CreatedAt
type Event ¶
type Event struct { Base Name string `gorm:"size:255;not null;unique" json:"name"` Year string `gorm:"size:4;not null" json:"year"` Sessions []Session `gorm:"foreignkey:EventID"` }
Event represents an event
func (*Event) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt
func (*Event) SetCreatedAt ¶
SetCreatedAt sets the CreatedAt
type Object ¶
type Object interface { GetID() uuid.UUID GetCreatedAt() time.Time SetCreatedAt(createdAt time.Time) Save(db *gorm.DB) error Count(db *gorm.DB) (int, error) FindAll(db *gorm.DB) (*[]Object, error) FindByID(db *gorm.DB, uid uuid.UUID) error Update(db *gorm.DB) error Delete(db *gorm.DB) error }
Object is an abstration of all Base objects
type Session ¶
type Session struct { Base Name string `gorm:"size:255;not null;unique" json:"name"` User User `json:"author"` UserID uuid.UUID Event Event `json:"event"` EventID uuid.UUID Subscriptions []Subscription `gorm:"foreignkey:SessionID"` Comments []Comment `gorm:"foreignkey:SessionID"` }
Session represents a session
func (*Session) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt
func (*Session) SetCreatedAt ¶
SetCreatedAt sets the CreatedAt
type Subscription ¶
type Subscription struct { Base User User `json:"user"` UserID uuid.UUID Session Session `json:"session"` SessionID uuid.UUID }
Subscription represents a session subscription
func (*Subscription) Count ¶
func (s *Subscription) Count(db *gorm.DB) (int, error)
Count returns count of all known objects of this type
func (*Subscription) Delete ¶
func (s *Subscription) Delete(db *gorm.DB) error
Delete is removing existing objects
func (*Subscription) FindAll ¶
func (s *Subscription) FindAll(db *gorm.DB) (*[]Object, error)
FindAll returns all known objects of this type
func (*Subscription) GetCreatedAt ¶
func (s *Subscription) GetCreatedAt() time.Time
GetCreatedAt returns the CreatedAt
func (*Subscription) Save ¶
func (s *Subscription) Save(db *gorm.DB) error
Save saves the structure as new object
func (*Subscription) SetCreatedAt ¶
func (s *Subscription) SetCreatedAt(createdAt time.Time)
SetCreatedAt sets the CreatedAt
func (*Subscription) Update ¶
func (s *Subscription) Update(db *gorm.DB) error
Update updates the existing objects
func (*Subscription) Validate ¶
func (s *Subscription) Validate(action string) error
Validate checks structure consistency
type User ¶
type User struct { Base Name string `gorm:"size:255;not null;unique" json:"name"` Email string `gorm:"size:100;not null;unique" json:"email"` Password string `gorm:"size:100;not null;" json:"password"` Subscriptions []Subscription `gorm:"foreignkey:UserID"` Sessions []Session `gorm:"foreignkey:UserID"` Comments []Comment `gorm:"foreignkey:UserID"` }
User represents an user
func (*User) GetCreatedAt ¶
GetCreatedAt returns the CreatedAt
func (*User) SetCreatedAt ¶
SetCreatedAt sets the CreatedAt