Documentation ¶
Overview ¶
Package api implements REST API support for Aptomi, including user-level and admin-level calls. It relies on httprouter to process HTTP requests and serve HTTP responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AuthRequestObject = &runtime.Info{ Kind: "auth-request", Constructor: func() runtime.Object { return &AuthRequest{} }, }
AuthRequestObject contains Info for the AuthRequest type
var AuthSuccessObject = &runtime.Info{ Kind: "auth-success", Constructor: func() runtime.Object { return &AuthSuccess{} }, }
AuthSuccessObject contains Info for the AuthSuccess type
var EndpointsObject = &runtime.Info{ Kind: "endpoints", Constructor: func() runtime.Object { return &Endpoints{} }, }
EndpointsObject is an informational data structure with Kind and Constructor for Endpoints
var ( // Objects is a list of all objects used in API Objects = runtime.AppendAll([]*runtime.Info{ EndpointsObject, PolicyUpdateResultObject, AuthSuccessObject, AuthRequestObject, ServerErrorObject, version.BuildInfoObject, }, lang.PolicyObjects, engine.Objects) )
var PolicyUpdateResultObject = &runtime.Info{ Kind: "policy-update-result", Constructor: func() runtime.Object { return &PolicyUpdateResult{} }, }
PolicyUpdateResultObject is an informational data structure with Kind and Constructor for PolicyUpdateResult
var ServerErrorObject = &runtime.Info{ Kind: "error", Constructor: func() runtime.Object { return &ServerError{} }, }
ServerErrorObject contains Info for the Error type
Functions ¶
Types ¶
type AuthRequest ¶ added in v0.1.8
AuthRequest represents authentication request
type AuthSuccess ¶ added in v0.1.8
AuthSuccess represents successful authentication
type Claims ¶ added in v0.1.8
type Claims struct { Name string `json:"name"` jwt.StandardClaims }
Claims represent Aptomi JWT Claims
type PolicyUpdateResult ¶
type PolicyUpdateResult struct { runtime.TypeKind `yaml:",inline"` PolicyGeneration runtime.Generation PolicyChanged bool Actions []string }
PolicyUpdateResult represents results for the policy update request (estimated list of actions to be executed to update existing actual state to the desired state)
func (*PolicyUpdateResult) AsColumns ¶ added in v0.1.2
func (result *PolicyUpdateResult) AsColumns() map[string]string
AsColumns returns PolicyUpdateResult representation as columns
func (*PolicyUpdateResult) GetDefaultColumns ¶ added in v0.1.2
func (result *PolicyUpdateResult) GetDefaultColumns() []string
GetDefaultColumns returns default set of columns to be displayed
type ServerError ¶
ServerError represents error that could be returned from the API
func NewServerError ¶
func NewServerError(error string) *ServerError
NewServerError returns instance of the error based on the provided error