Documentation ¶
Index ¶
- Variables
- func FreshJWT(t *UserJWT, freshD time.Duration, termD time.Duration) (string, error)
- func GetGormRepo(ctx context.Context) (*gorm.DB, bool)
- func GetMongoRepo(ctx context.Context) (*mgo.Session, bool)
- func GormRepo(service micro.Service, repo *gorm.DB) server.HandlerWrapper
- func ItemInList(a string, b []string) bool
- func MongoRepo(service micro.Service) (wrapper server.HandlerWrapper, deferFn func())
- type Model
- type RepoKey
- type RepoKeyT
- type UserJWT
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ENV = new(starmap)
)
config(s)
Functions ¶
func GetMongoRepo ¶
GetMongoRepo from ctx
func GormRepo ¶
func GormRepo(service micro.Service, repo *gorm.DB) server.HandlerWrapper
GormRepo Wrapper
func MongoRepo ¶
func MongoRepo(service micro.Service) (wrapper server.HandlerWrapper, deferFn func())
MongoRepo Wrapper
Types ¶
type Model ¶
type Model struct { // ID uint `gorm:"primary_key"` CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` }
Model for gorm (sub-model needs have column `Id`)
type RepoKey ¶
type RepoKey struct {
// contains filtered or unexported fields
}
RepoKey for Context Value
type UserJWT ¶
type UserJWT struct { jwt.StandardClaims UserInfo *proto.UserInfo }
UserJWT with UserInfo
func ValidUserJWT ¶
ValidUserJWT for UserInfo
Click to show internal directories.
Click to hide internal directories.