Documentation
¶
Index ¶
Constants ¶
View Source
const ApiKeyCollectionName = "api_keys"
View Source
const KeystoreCollectionName = "keystores"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiKey ¶
type ApiKey struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Key string `bson:"key" validate:"required,max=1024"`
Version int `bson:"version" validate:"required,min=1,max=100"`
Permissions []Permission `bson:"permissions" validate:"required"`
Comments []string `bson:"comments" validate:"required,max=1000"`
Status bool `bson:"status" validate:"-"`
CreatedAt time.Time `bson:"createdAt" validate:"-"`
UpdatedAt time.Time `bson:"updatedAt" validate:"-"`
}
func NewApiKey ¶
func NewApiKey(key string, version int, permissions []Permission, comments []string) *ApiKey
func (*ApiKey) EnsureIndexes ¶
type Keystore ¶
type Keystore struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Client primitive.ObjectID `bson:"client" validate:"required"`
PrimaryKey string `bson:"pKey" validate:"required"`
SecondaryKey string `bson:"sKey" validate:"required"`
Status bool `bson:"status" validate:"-"`
CreatedAt time.Time `bson:"createdAt" validate:"required"`
UpdatedAt time.Time `bson:"updatedAt" validate:"required"`
}
func NewKeystore ¶
func (*Keystore) EnsureIndexes ¶
Click to show internal directories.
Click to hide internal directories.