Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // EmptyOrganisation empty org var EmptyOrganisation = Organisation{} )
var ( // EmptyUser em user EmptyUser = User{} )
Functions ¶
func IsValidAlphaNum ¶
IsValidAlphaNum Check that string is correct lower case alpha numeric chain
func IsValidOrganisationIdentifier ¶
IsValidOrganisationIdentifier check if string provided is a correct organisation identifier
func IsValidUsername ¶
IsValidUsername will check if provided userName is correct
Types ¶
type Organisation ¶
type Organisation struct { // id of the organisation // // min: 0 IDOrganisation uint64 `gorm:"primary_key;column:idOrganisation;AUTO_INCREMENT" json:"id,omitempty"` // Stack into docker swarm // // required: true //min: 0 DockerStack int `gorm:"column:dockerStack;not null;unique" json:"docker_stack,omitempty"` // required: true OrganisationName string `gorm:"column:organisationName;not null;unique" json:"name,omitempty"` // State if organisation is free to join or not. Default is private (false). Public bool `gorm:"column:public; not null" json:"public"` Description string `gorm:"column:description" json:"description,omitempty"` Avatar string `gorm:"column:avatar" json:"avatar,omitempty"` // Domain name of the organisation Domain string `gorm:"column:domain" json:"domain,omitempty"` }
Organisation object
Describe organisation you are in. It is an unique object in the database.
swagger:model
func OganisationFromJSON ¶
func OganisationFromJSON(data io.Reader) *Organisation
OganisationFromJSON Try to parse a json object as emoji
func (*Organisation) Bind ¶
func (organisation *Organisation) Bind(r *http.Request) error
Bind method used in API
func (*Organisation) IsValid ¶
func (organisation *Organisation) IsValid() *u.AppError
IsValid is used to check validity of Organisation objects
func (*Organisation) PreSave ¶
func (organisation *Organisation) PreSave()
PreSave is used to add some default values to organisation before saving in DB (creation).
func (*Organisation) ToJSON ¶
func (organisation *Organisation) ToJSON() string
ToJSON transfoorm an Organisation into JSON
type User ¶
type User struct { // id of the user // // min: 0 IDUser uint64 `gorm:"primary_key;column:idUser;AUTO_INCREMENT" json:"id,omitempty"` // User name // // required: true // max length: 64 Username string `gorm:"column:userName; not null; unique;" json:"username,omitempty"` // User email // // required: true // max lenght: 128 Email string `gorm:"column:email; not null; unique;" json:"email,omitempty"` // State if email was verified // // required: true EmailVerified bool `gorm:"column:emailVerified; not null;" json:"email_verified,omitempty"` // User is deleted from organisation but still in database // // required: true Deleted bool `gorm:"column:deleted; not null;" json:"deleted,omitempty"` // Avatar used by user Avatar string `gorm:"column:avatar;" json:"avatar, omitempty"` // User nickname NickName string `gorm:"column:nickName; unique" json:"nickname, omitempty"` // First name FirstName string `gorm:"column:firstName;" json:"first_name, omitempty"` // User Lastname LastName string `gorm:"column:lastName;" json:"last_name, omitempty"` Organisation []Organisation `gorm:"ForeignKey:IDOrganisation;AssociationForeignKey:Refer" db:"-" json:"-"` // Org key of user in the organisation // // required: true IDOrganisation uint64 `gorm:"column:idOrganisation; not null;" json:"id_organisation,omitempty"` }
User object.
An user is an account who have an access to a specific organisation. Each user is unique inside a given organisation, but users are not shared between organisations. Required apply only for creation of the object.
swagger:model
func UserFromJSON ¶
UserFromJSON will decode the input and return a user
func (*User) IsValid ¶
IsValid valwebIDates the user and returns an error if it isn't configured correctly.