Documentation ¶
Index ¶
- func EncodeToString(max int) string
- func Migrate(db *gorm.DB) error
- func NewDB(conf DBConfig) (*gorm.DB, error)
- func NewGrpcUserService(host string) (userpb.UserServiceClient, error)
- func NewTokenStore(conf *RedisConfig) *oredis.TokenStore
- func Seed(db *gorm.DB, defaultUser DefaultUser, grpcClient userpb.UserServiceClient) error
- type DBConfig
- func (c DBConfig) WithHost(host string) DBConfig
- func (c DBConfig) WithName(name string) DBConfig
- func (c DBConfig) WithPass(pass string) DBConfig
- func (c DBConfig) WithPort(port string) DBConfig
- func (c DBConfig) WithSecure(ssl bool) DBConfig
- func (c DBConfig) WithTZ(tz string) DBConfig
- func (c DBConfig) WithUser(user string) DBConfig
- type DefaultUser
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToString ¶
func NewGrpcUserService ¶
func NewGrpcUserService(host string) (userpb.UserServiceClient, error)
func NewTokenStore ¶
func NewTokenStore(conf *RedisConfig) *oredis.TokenStore
func Seed ¶
func Seed(db *gorm.DB, defaultUser DefaultUser, grpcClient userpb.UserServiceClient) error
Types ¶
type DBConfig ¶
type DBConfig struct {
// contains filtered or unexported fields
}
func NewDBConfig ¶
func NewDBConfig() DBConfig
func (DBConfig) WithSecure ¶
type DefaultUser ¶
type DefaultUser struct { UserPass string // contains filtered or unexported fields }
func NewDefaultUser ¶
func NewDefaultUser() DefaultUser
func (DefaultUser) WithDefaultAdminPass ¶
func (d DefaultUser) WithDefaultAdminPass(pass string) DefaultUser
func (DefaultUser) WithDefaultAdminPhone ¶
func (d DefaultUser) WithDefaultAdminPhone(phone string) DefaultUser
func (DefaultUser) WithDefaultUserPass ¶
func (d DefaultUser) WithDefaultUserPass(pass string) DefaultUser
func (DefaultUser) WithDefaultUserPhone ¶
func (d DefaultUser) WithDefaultUserPhone(phone string) DefaultUser
Click to show internal directories.
Click to hide internal directories.