Documentation ¶
Index ¶
- type Action
- type Basic
- func (b *Basic) Allow(ctx context.Context, key string, limit redis_rate.Limit) (*redis_rate.Result, error)
- func (b *Basic) CreateAction(ctx context.Context, action *Action) error
- func (b *Basic) DeleteActionByID(ctx context.Context, id primitive.ObjectID) error
- func (b *Basic) DeleteActions(ctx context.Context, ids []primitive.ObjectID) error
- func (b *Basic) FindActionByID(ctx context.Context, id primitive.ObjectID) (*Action, error)
- func (b *Basic) FindActionByOpt(ctx context.Context, opt FindActionOption) (*Action, error)
- func (b *Basic) ListActions(ctx context.Context, opt ListActionOption) (*[]Action, int, error)
- func (b *Basic) UpdateAction(ctx context.Context, action *Action) error
- type Daler
- type DalerOption
- type FindActionOption
- type ListActionOption
- type Proxy
- type Scheme
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { ID primitive.ObjectID `bson:"_id" json:"id"` Name string `json:"name" bson:"name"` ServiceName string `json:"service_name" bson:"service_name"` Description string `json:"description" bson:"description"` RateLimit float64 `json:"rate_limit" bson:"rate_limit"` IsAuth bool `json:"is_auth" bson:"is_auth"` Proxy []Proxy `json:"proxy" bson:"proxy"` Timeout int `json:"timeout" bson:"timeout"` Version string `json:"version" bson:"version"` }
type Basic ¶
type Basic struct {
// contains filtered or unexported fields
}
Basic implement Daler functions.
func (*Basic) Allow ¶
func (b *Basic) Allow(ctx context.Context, key string, limit redis_rate.Limit) (*redis_rate.Result, error)
Allow
func (*Basic) CreateAction ¶
func (*Basic) DeleteActionByID ¶
func (*Basic) DeleteActions ¶
func (*Basic) FindActionByID ¶
func (*Basic) FindActionByOpt ¶
func (*Basic) ListActions ¶
ListActions(ctx context.Context, opt ListActionOption) ([]*Action, error)
type Daler ¶
type Daler interface { FindActionByOpt(ctx context.Context, opt FindActionOption) (*Action, error) UpdateAction(ctx context.Context, action *Action) error FindActionByID(ctx context.Context, id primitive.ObjectID) (*Action, error) DeleteActions(ctx context.Context, ids []primitive.ObjectID) error DeleteActionByID(ctx context.Context, id primitive.ObjectID) error ListActions(ctx context.Context, opt ListActionOption) (*[]Action, int, error) CreateAction(ctx context.Context, action *Action) error Allow(ctx context.Context, key string, limit redis_rate.Limit) (*redis_rate.Result, error) }
Daler Collection of some database methods.
func NewDaler ¶
func NewDaler(opt DalerOption) (Daler, error)
type DalerOption ¶
type FindActionOption ¶
type ListActionOption ¶
Click to show internal directories.
Click to hide internal directories.