Documentation
¶
Index ¶
- Variables
- func FormatResponse(err error) *command.Response
- func NewGrpcService(core Core) *grpc.Server
- func NewHttpService(core Core) *httpService
- type AddPoliciesRequest
- type ClearPolicyRequest
- type Core
- type CreateNameSpaceRequest
- type EnforceReply
- type EnforceRequest
- type JoinRequest
- type ListPoliciesRequest
- type Middleware
- type PrintModelRequest
- type RemoveFilteredPolicyRequest
- type RemovePoliciesRequest
- type RemoveRequest
- type Response
- type SetModelFromStringRequest
- type UpdatePoliciesRequest
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func FormatResponse ¶
func NewGrpcService ¶
func NewHttpService ¶
func NewHttpService(core Core) *httpService
Types ¶
type AddPoliciesRequest ¶
type ClearPolicyRequest ¶
type ClearPolicyRequest struct {
NS string `json:"ns" validate:"required"`
}
type Core ¶
type Core interface {
AuthType() auth.AuthType
Check(username string, password string) bool
ListNamespaces(ctx context.Context) ([]string, error)
ListPolicies(ctx context.Context, namespace, cursor string, skip, limit int64, reverse bool) ([][]string, error)
PrintModel(ctx context.Context, namespace string) (string, error)
IsLeader(ctx context.Context) bool
LeaderAddr() string
Stats(ctx context.Context) (map[string]interface{}, error)
CreateNamespace(ctx context.Context, ns string) error
SetModelFromString(ctx context.Context, ns string, text string) error
Enforce(ctx context.Context, ns string, level int32, freshness int64, params ...interface{}) (bool, error)
AddPolicies(ctx context.Context, ns string, sec string, pType string, rules [][]string) ([][]string, error)
RemovePolicies(ctx context.Context, ns string, sec string, pType string, rules [][]string) ([][]string, error)
RemoveFilteredPolicy(ctx context.Context, ns string, sec string, pType string, fi int32, fv []string) ([][]string, error)
UpdatePolicies(ctx context.Context, ns string, sec string, pType string, nr, or [][]string) (bool, error)
ClearPolicy(ctx context.Context, ns string) error
Join(ctx context.Context, id, addr string, voter bool, metadata map[string]string) error
Remove(ctx context.Context, id string) error
}
type CreateNameSpaceRequest ¶
type CreateNameSpaceRequest struct {
NS string `json:"ns" validate:"required"`
}
type EnforceReply ¶
type EnforceReply struct {
Ok bool `json:"ok"`
}
type EnforceRequest ¶
type JoinRequest ¶
type ListPoliciesRequest ¶
type Middleware ¶
type Middleware func(handlerFunc http.HandlerFunc) http.HandlerFunc
type PrintModelRequest ¶
type PrintModelRequest struct {
NS string `json:"ns" validate:"required"`
}
type RemovePoliciesRequest ¶
type RemoveRequest ¶
type RemoveRequest struct {
ID string `json:"id" validate:"required"`
}
type UpdatePoliciesRequest ¶
Click to show internal directories.
Click to hide internal directories.