Documentation ¶
Index ¶
- Constants
- Variables
- func MakeNotImplemented(err error) *goa.ServiceError
- func NewCreateEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- func NewDeleteEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- func NewGetEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- func NewGroupAddEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- func NewGroupRemoveEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- func NewUpdateEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
- type Account
- type Auther
- type Client
- func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *Account, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) Get(ctx context.Context, p *GetPayload) (res *Account, err error)
- func (c *Client) GroupAdd(ctx context.Context, p *GroupAddPayload) (err error)
- func (c *Client) GroupRemove(ctx context.Context, p *GroupRemovePayload) (err error)
- func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *Account, err error)
- type CreateAccount
- type CreatePayload
- type DeletePayload
- type Endpoints
- type GetPayload
- type GroupAddPayload
- type GroupRemovePayload
- type Service
- type UpdateAccount
- type UpdatePayload
Constants ¶
const ServiceName = "account"
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 = [6]string{"create", "get", "update", "delete", "groupAdd", "groupRemove"}
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 MakeNotImplemented ¶
func MakeNotImplemented(err error) *goa.ServiceError
MakeNotImplemented builds a goa.ServiceError from an error.
func NewCreateEndpoint ¶
func NewCreateEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "account".
func NewDeleteEndpoint ¶
func NewDeleteEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "account".
func NewGetEndpoint ¶
func NewGetEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewGetEndpoint returns an endpoint function that calls the method "get" of service "account".
func NewGroupAddEndpoint ¶
func NewGroupAddEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewGroupAddEndpoint returns an endpoint function that calls the method "groupAdd" of service "account".
func NewGroupRemoveEndpoint ¶
func NewGroupRemoveEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewGroupRemoveEndpoint returns an endpoint function that calls the method "groupRemove" of service "account".
func NewUpdateEndpoint ¶
func NewUpdateEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint
NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "account".
Types ¶
type Account ¶
type Account struct { // Temporary account identifier ID *int64 `gorm:"autoIncrement" json:"id,omitempty"` // IDP account identifier GUID *string `json:"guid,omitempty"` // Name of user Name string // Login of user Login string `gorm:"uniqueIndex" json:"login"` // Email of user Email string // Status of account Status *string }
Account is the result type of the account service create method.
type Auther ¶
type Auther interface { // BasicAuth implements the authorization logic for the Basic security scheme. BasicAuth(ctx context.Context, user, pass string, schema *security.BasicScheme) (context.Context, error) }
Auther defines the authorization functions to be implemented by the service.
type Client ¶
type Client struct { CreateEndpoint goa.Endpoint GetEndpoint goa.Endpoint UpdateEndpoint goa.Endpoint DeleteEndpoint goa.Endpoint GroupAddEndpoint goa.Endpoint GroupRemoveEndpoint goa.Endpoint }
Client is the "account" service client.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "account" service.
func (*Client) GroupAdd ¶
func (c *Client) GroupAdd(ctx context.Context, p *GroupAddPayload) (err error)
GroupAdd calls the "groupAdd" endpoint of the "account" service.
func (*Client) GroupRemove ¶
func (c *Client) GroupRemove(ctx context.Context, p *GroupRemovePayload) (err error)
GroupRemove calls the "groupRemove" endpoint of the "account" service.
type CreateAccount ¶
type CreatePayload ¶
type CreatePayload struct { Username string Password string Account *CreateAccount }
CreatePayload is the payload type of the account service create method.
type DeletePayload ¶
DeletePayload is the payload type of the account service delete method.
type Endpoints ¶
type Endpoints struct { Create goa.Endpoint Get goa.Endpoint Update goa.Endpoint Delete goa.Endpoint GroupAdd goa.Endpoint GroupRemove goa.Endpoint }
Endpoints wraps the "account" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "account" service with endpoints.
type GetPayload ¶
type GetPayload struct { // Username Username string // Password Password string // Account ID AccountID string }
GetPayload is the payload type of the account service get method.
type GroupAddPayload ¶
type GroupAddPayload struct { Username string Password string // Account ID AccountID string // Group ID GroupID string }
GroupAddPayload is the payload type of the account service groupAdd method.
type GroupRemovePayload ¶
type GroupRemovePayload struct { Username string Password string // Account ID AccountID string // Group ID GroupID string }
GroupRemovePayload is the payload type of the account service groupRemove method.
type Service ¶
type Service interface { // Creates an account. Note that the client may choose to create a shadow // account or hold the account in a temporary store until the actual account // materializes. Create(context.Context, *CreatePayload) (res *Account, err error) // Get account details Get(context.Context, *GetPayload) (res *Account, err error) // Update account details Update(context.Context, *UpdatePayload) (res *Account, err error) // Delete an account Delete(context.Context, *DeletePayload) (err error) // Add an account to a group GroupAdd(context.Context, *GroupAddPayload) (err error) // Remove an account from a group GroupRemove(context.Context, *GroupRemovePayload) (err error) }
Accounts APIs
type UpdateAccount ¶
type UpdateAccount struct { // Status of user Status string }
type UpdatePayload ¶
type UpdatePayload struct { // Username Username string // Password Password string // Account ID AccountID string Account *UpdateAccount }
UpdatePayload is the payload type of the account service update method.