Documentation ¶
Index ¶
- type Memory
- type Message
- type MessageStorage
- type Rule
- type RuleStorage
- type Sqlite
- func (s *Sqlite) Delete(key *api.Key) error
- func (s *Sqlite) DeleteAll(key *api.Key) error
- func (s *Sqlite) Get(key *api.Key) (*api.Message, error)
- func (s *Sqlite) GetAll(key *api.Key) ([]*api.Message, error)
- func (s *Sqlite) GetRules(character api.Character, role string, method api.Method) ([]*api.Key, error)
- func (s *Sqlite) GetUserWithName(n string) (*api.User, error)
- func (s *Sqlite) GetUserWithToken(t string) (*api.User, error)
- func (s *Sqlite) GetUsers(n *string, t *string, c *api.Character, r *string, rd *bool, st *api.Status) ([]*api.User, error)
- func (s *Sqlite) Put(message *api.Message) error
- func (s *Sqlite) UpdateUserReadiness(name string, readiness bool) error
- func (s *Sqlite) UpdateUserStatus(name string, st api.Status) error
- type User
- type UserStorage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct { CreatedAt time.Time `gorm:""` UpdatedAt time.Time `gorm:""` DeletedAt gorm.DeletedAt `gorm:"index"` Type string `gorm:"primaryKey;autoIncrement:false;notNull"` Name string `gorm:"primaryKey;autoIncrement:false;notNull"` Namespace string `gorm:"primaryKey;autoIncrement:false;notNull"` Content string `gorm:"notNull;default:''"` UserName string `gorm:"notNull"` User *User `gorm:"foreignKey:UserName;references:Name;notNull"` }
type MessageStorage ¶
type RuleStorage ¶
type Sqlite ¶
func (*Sqlite) UpdateUserReadiness ¶
type User ¶
type User struct { CreatedAt time.Time `gorm:""` UpdatedAt time.Time `gorm:""` DeletedAt gorm.DeletedAt `gorm:"index"` Name string `gorm:"primaryKey;autoIncrement:false;notNull"` Token string `gorm:"unique;index;notNull"` Role string `gorm:"notNull;default:''"` Readiness bool `gorm:"notNull;default:false"` Character api.Character `gorm:"notNull;default:0"` Status api.Status `gorm:"notNull;default:0"` LastStatusUpdateTime time.Time `gorm:""` }
/////////////////////////////////////////// ///////////////////////////////// Types /// ///////////////////////////////////////////
type UserStorage ¶
type UserStorage interface { GetUsers(name *string, token *string, character *api.Character, role *string, readiness *bool, status *api.Status) ([]*api.User, error) GetUserWithToken(token string) (*api.User, error) GetUserWithName(name string) (*api.User, error) UpdateUserStatus(name string, status api.Status) error UpdateUserReadiness(name string, readiness bool) error }
Click to show internal directories.
Click to hide internal directories.