Documentation
¶
Index ¶
- func CheckKeyRecord(keyContent string) bool
- func CreateKeyRecord(keyContent string, keyName string, modelList []string, userName string, ...)
- func CreateOrganizationRecord(name string)
- func CreateUserRecord(userName string, organizationName string)
- func DeleteKeyRecord(keyContent string)
- func DeleteOrganizationRecord(name string)
- func DeleteUserRecord(userName string)
- func ToString(s StringSlice) string
- func UpdateOrganizationRecord(name string)
- func UpdateUserRecord(userName string, organizationName string)
- type Key
- type Organization
- type StringSlice
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckKeyRecord ¶
func CreateKeyRecord ¶
func CreateOrganizationRecord ¶
func CreateOrganizationRecord(name string)
func CreateUserRecord ¶
func DeleteKeyRecord ¶
func DeleteKeyRecord(keyContent string)
func DeleteOrganizationRecord ¶
func DeleteOrganizationRecord(name string)
func DeleteUserRecord ¶
func DeleteUserRecord(userName string)
func ToString ¶
func ToString(s StringSlice) string
func UpdateOrganizationRecord ¶
func UpdateOrganizationRecord(name string)
func UpdateUserRecord ¶
Types ¶
type Key ¶
type Key struct { KeyId int `gorm:"primaryKey;column:key_id"` KeyContent string `gorm:"column:key_content"` KeyName string `gorm:"column:key_name"` ModelList StringSlice `gorm:"column:model_list"` UserId int `gorm:"column:user_id"` OrganizationId int `gorm:"column:organization_id"` Balance float64 `gorm:"column:balance"` TotalSpend float64 `gorm:"column:total_spend"` RequestPerMinute int `gorm:"column:request_per_minute"` // 0 means unlimited SpendLimitPerWeek float64 `gorm:"column:spend_limit_per_week"` // 0 means unlimited CreateTime time.Time `gorm:"column:create_time"` ExpireTime time.Time `gorm:"column:expire_time"` }
func GetAllValidKey ¶
func GetAllValidKey() []Key
type Organization ¶
type Organization struct { OrganizationId int `gorm:"primaryKey;column:organization_id"` OrganizationName string `gorm:"column:organization_name"` }
func GetOrganizationRecord ¶
func GetOrganizationRecord(name string) *Organization
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Scan ¶
func (s *StringSlice) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.