model

package
v0.0.0-...-3669430 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	Email string `json:"Email"`
	Id    string `json:"Id"`
	jwt.StandardClaims
}

type LoginRequest

type LoginRequest struct {
	Email    string `json:"Email"`
	Password string `json:"Password"`
}

type Organisation

type Organisation struct {
	gorm.Model
	ID          uuid.UUID `json:"ID" gorm:"type:char(36);primary_key;"`
	Name        string    `json:"Name"`
	IconHash    *string   `json:"IconHash"`
	Description string    `json:"Description"`
	Moderators  []*User   `json:"Moderators" gorm:"many2many:organisation_moderators;"`
	OwnerID     string    `json:"Owner"`
}

func (*Organisation) BeforeCreate

func (organisation *Organisation) BeforeCreate(tx *gorm.DB) (err error)

type Response

type Response struct {
	Status int         `json:"status"`
	Body   interface{} `json:"body"`
}

type TokenResponse

type TokenResponse struct {
	Token      string    `json:"token"`
	Expiration time.Time `json:"expiration"`
}

type User

type User struct {
	gorm.Model
	ID                 uuid.UUID       `json:"ID" gorm:"type:char(36);primary_key;"`
	Email              string          `json:"Email"`
	Password           string          `json:"Password"`
	OrganisationMods   []*Organisation `json:"Organisations" gorm:"many2many:organisation_moderators;"`
	OwnedOrganisations []*Organisation `json:"OwnedOrganisations" gorm:"foreignKey:OwnerID;"`
}

func (*User) BeforeCreate

func (user *User) BeforeCreate(tx *gorm.DB) (err error)

Jump to

Keyboard shortcuts

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