Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticationProvider ¶
type AuthenticationProvider struct { // Inherit properties from base model. Model Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii" gorm:"size:200;unique_index"` ClientKey string `json:"client_key,omitempty" validate:"required,min=1,max=200" gorm:"size:200"` ClientSecret string `json:"client_secret,omitempty" validate:"required,min=1,max=200" gorm:"size:200"` Provider string `json:"provider,omitempty" validate:"required,max=200,oneof=gitlab google" gorm:"size:200"` Global bool `json:"global,omitempty"` }
AuthenticationProvider represents an OAuth 2.0 or OpenID Connect provider, such as Azure AD, GitLab or Google.
func (*AuthenticationProvider) BeforeCreate ¶
func (a *AuthenticationProvider) BeforeCreate(scope *gorm.Scope) error
BeforeCreate will set a UUID rather than numeric ID.
func (*AuthenticationProvider) BeforeSave ¶
func (a *AuthenticationProvider) BeforeSave(scope *gorm.Scope) error
BeforeSave will sanitize fields to remove potentially dangerous characters.
type AuthenticationProviderPayload ¶
type AuthenticationProviderPayload struct { Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii" gorm:"size:200;unique_index"` ClientKey string `json:"client_key,omitempty" validate:"required,min=1,max=200" gorm:"size:200"` ClientSecret string `json:"client_secret,omitempty" validate:"required,min=1,max=200" gorm:"size:200"` Provider string `json:"provider,omitempty" validate:"required,max=200,oneof=gitlab google" gorm:"size:200"` Global bool `json:"global,omitempty"` }
AuthenticationProviderPayload is the data that is accessible via the request body.
type Model ¶
type Model struct { ID string `json:"id" validate:"-" gorm:"primary_key"` CreatedAt time.Time `json:"created_at" validate:"-" gorm:"index"` UpdatedAt time.Time `json:"updated_at" validate:"-" gorm:"index"` DeletedAt *time.Time `json:"deleted_at,omitempty" validate:"-" gorm:"index"` }
Model is the base model which includes all shared properties.
type Organisation ¶
type Organisation struct { // Inherit properties from base model. Model Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii,ne=guest,ne=global" gorm:"size:200;unique_index"` Description string `json:"description,omitempty" validate:"omitempty,max=1000" gorm:"size:1000"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` Projects []Project `json:"-"` }
Organisation can be a company, a group or a legal entity.
func (*Organisation) BeforeCreate ¶
func (o *Organisation) BeforeCreate(scope *gorm.Scope) error
BeforeCreate will set a UUID rather than numeric ID.
func (*Organisation) BeforeSave ¶
func (o *Organisation) BeforeSave(scope *gorm.Scope) error
BeforeSave will sanitize fields to remove potentially dangerous characters.
type OrganisationPayload ¶
type OrganisationPayload struct { Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii,ne=guest,ne=global" gorm:"size:200;unique_index"` Description string `json:"description,omitempty" validate:"omitempty,max=1000" gorm:"size:1000"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` }
OrganisationPayload is the data that is accessible via the request body.
type Project ¶
type Project struct { // Inherit properties from base model. Model Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii" gorm:"size:200;unique_index"` Description string `json:"description,omitempty" validate:"omitempty,max=1000" gorm:"size:1000"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` OrganisationID string `json:"organisation_id,omitempty" validate:"required,uuid4"` }
Project groups assets within an organisation.
func (*Project) BeforeCreate ¶
BeforeCreate will set a UUID rather than numeric ID.
type ProjectPayload ¶
type ProjectPayload struct { Name string `json:"name,omitempty" validate:"required,min=1,max=200" gorm:"size:200;unique_index"` Slug string `json:"slug,omitempty" validate:"required,min=1,max=200,printascii" gorm:"size:200;unique_index"` Description string `json:"description,omitempty" validate:"omitempty,max=1000" gorm:"size:1000"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` OrganisationID string `json:"organisation_id,omitempty" validate:"required,uuid4"` }
ProjectPayload is the data that is accessible via the request body.
type User ¶
type User struct { // Inherit properties from base model. Model FirstName string `json:"first_name,omitempty" validate:"required,min=2,max=200" gorm:"size:200"` LastName string `json:"last_name,omitempty" validate:"required,min=2,max=200" gorm:"size:200"` Email string `json:"email,omitempty" validate:"required,max=200,email" gorm:"size:200;unique_index"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` }
User is an application user.
func (*User) BeforeCreate ¶
BeforeCreate will set a UUID rather than numeric ID.
type UserPayload ¶
type UserPayload struct { FirstName string `json:"first_name,omitempty" validate:"required,min=2,max=200" gorm:"size:200"` LastName string `json:"last_name,omitempty" validate:"required,min=2,max=200" gorm:"size:200"` Email string `json:"email,omitempty" validate:"required,max=200,email" gorm:"size:200;unique_index"` AvatarURL string `json:"avatar_url,omitempty" validate:"omitempty,max=500,url" gorm:"size:500"` }
UserPayload is the data that is accessible via the request body.