Documentation ¶
Index ¶
- Constants
- Variables
- func MakeInternalError(err error) *goa.ServiceError
- func MakeInvalidPayload(err error) *goa.ServiceError
- func MakeInvalidScopes(err error) *goa.ServiceError
- func MakeInvalidToken(err error) *goa.ServiceError
- func NewRefreshConfigEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUpdateAgentEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- type Auther
- type Client
- type Endpoints
- type RefreshConfigPayload
- type RefreshConfigResult
- type Service
- type UpdateAgentPayload
- type UpdateAgentResult
Constants ¶
const ServiceName = "admin"
ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.
Variables ¶
var MethodNames = [2]string{"UpdateAgent", "RefreshConfig"}
MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.
Functions ¶
func MakeInternalError ¶
func MakeInternalError(err error) *goa.ServiceError
MakeInternalError builds a goa.ServiceError from an error.
func MakeInvalidPayload ¶
func MakeInvalidPayload(err error) *goa.ServiceError
MakeInvalidPayload builds a goa.ServiceError from an error.
func MakeInvalidScopes ¶
func MakeInvalidScopes(err error) *goa.ServiceError
MakeInvalidScopes builds a goa.ServiceError from an error.
func MakeInvalidToken ¶
func MakeInvalidToken(err error) *goa.ServiceError
MakeInvalidToken builds a goa.ServiceError from an error.
func NewRefreshConfigEndpoint ¶
func NewRefreshConfigEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewRefreshConfigEndpoint returns an endpoint function that calls the method "RefreshConfig" of service "admin".
func NewUpdateAgentEndpoint ¶
func NewUpdateAgentEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUpdateAgentEndpoint returns an endpoint function that calls the method "UpdateAgent" of service "admin".
Types ¶
type Auther ¶
type Auther interface { // JWTAuth implements the authorization logic for the JWT security scheme. JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error) }
Auther defines the authorization functions to be implemented by the service.
type Client ¶
Client is the "admin" service client.
func (*Client) RefreshConfig ¶
func (c *Client) RefreshConfig(ctx context.Context, p *RefreshConfigPayload) (res *RefreshConfigResult, err error)
RefreshConfig calls the "RefreshConfig" endpoint of the "admin" service.
func (*Client) UpdateAgent ¶
func (c *Client) UpdateAgent(ctx context.Context, p *UpdateAgentPayload) (res *UpdateAgentResult, err error)
UpdateAgent calls the "UpdateAgent" endpoint of the "admin" service.
type Endpoints ¶
Endpoints wraps the "admin" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "admin" service with endpoints.
type RefreshConfigPayload ¶
type RefreshConfigPayload struct { // User JWT Token string }
RefreshConfigPayload is the payload type of the admin service RefreshConfig method.
type RefreshConfigResult ¶
type RefreshConfigResult struct { // Config file checksum Checksum string }
RefreshConfigResult is the result type of the admin service RefreshConfig method.
type Service ¶
type Service interface { // Create or Update an agent user with required scopes UpdateAgent(context.Context, *UpdateAgentPayload) (res *UpdateAgentResult, err error) // Refresh the changes in config file RefreshConfig(context.Context, *RefreshConfigPayload) (res *RefreshConfigResult, err error) }
Admin service
type UpdateAgentPayload ¶
type UpdateAgentPayload struct { // User JWT Token string // Name of Agent Name string // Scopes required for Agent Scopes []string }
UpdateAgentPayload is the payload type of the admin service UpdateAgent method.
type UpdateAgentResult ¶
type UpdateAgentResult struct { // Agent JWT Token string }
UpdateAgentResult is the result type of the admin service UpdateAgent method.