aggregate

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "aggregate"

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

View Source
var MethodNames = [2]string{"accounts", "groups"}

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 MakePermissionDenied

func MakePermissionDenied(err error) *goa.ServiceError

MakePermissionDenied builds a goa.ServiceError from an error.

func NewAccountsEndpoint

func NewAccountsEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint

NewAccountsEndpoint returns an endpoint function that calls the method "accounts" of service "aggregate".

func NewGroupsEndpoint

func NewGroupsEndpoint(s Service, authBasicFn security.AuthBasicFunc) goa.Endpoint

NewGroupsEndpoint returns an endpoint function that calls the method "groups" of service "aggregate".

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
}

type AccountsPayload

type AccountsPayload struct {
	Username string
	Password string
}

AccountsPayload is the payload type of the aggregate service accounts 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 {
	AccountsEndpoint goa.Endpoint
	GroupsEndpoint   goa.Endpoint
}

Client is the "aggregate" service client.

func NewClient

func NewClient(accounts, groups goa.Endpoint) *Client

NewClient initializes a "aggregate" service client given the endpoints.

func (*Client) Accounts

func (c *Client) Accounts(ctx context.Context, p *AccountsPayload) (res []*Account, err error)

Accounts calls the "accounts" endpoint of the "aggregate" service. Accounts may return the following errors:

  • "PermissionDenied" (type *goa.ServiceError)
  • error: internal error

func (*Client) Groups

func (c *Client) Groups(ctx context.Context, p *GroupsPayload) (res []*Group, err error)

Groups calls the "groups" endpoint of the "aggregate" service. Groups may return the following errors:

  • "PermissionDenied" (type *goa.ServiceError)
  • error: internal error

type Endpoints

type Endpoints struct {
	Accounts goa.Endpoint
	Groups   goa.Endpoint
}

Endpoints wraps the "aggregate" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "aggregate" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "aggregate" service endpoints.

type Group

type Group struct {
	// Name of group
	Name *string
	// ID of group
	ID *string
}

type GroupsPayload

type GroupsPayload struct {
	Username string
	Password string
}

GroupsPayload is the payload type of the aggregate service groups method.

type Service

type Service interface {
	// Account aggregation. Returns all known accounts
	Accounts(context.Context, *AccountsPayload) (res []*Account, err error)
	// Group aggregation. Returns list of all known groups
	Groups(context.Context, *GroupsPayload) (res []*Group, err error)
}

Integration APIs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL