Documentation
¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeConflict(err error) *goa.ServiceError
- func MakeForbidden(err error) *goa.ServiceError
- func MakeGatewayError(err error) *goa.ServiceError
- func MakeInvalid(err error) *goa.ServiceError
- func MakeInvariantViolation(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func MakeUnexpected(err error) *goa.ServiceError
- func MakeUnsupportedMedia(err error) *goa.ServiceError
- func NewCreateProjectEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- func NewListProjectsEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- func NewSetLogoEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
- type Auther
- type Client
- func (c *Client) CreateProject(ctx context.Context, p *CreateProjectPayload) (res *CreateProjectResult, err error)
- func (c *Client) ListProjects(ctx context.Context, p *ListProjectsPayload) (res *ListProjectsResult, err error)
- func (c *Client) SetLogo(ctx context.Context, p *SetLogoPayload) (res *SetProjectLogoResult, err error)
- type CreateProjectPayload
- type CreateProjectResult
- type Endpoints
- type ListProjectsPayload
- type ListProjectsResult
- type Project
- type ProjectEntry
- type Service
- type SetLogoPayload
- type SetProjectLogoResult
Constants ¶
const APIName = "gram"
APIName is the name of the API as defined in the design.
const APIVersion = "0.0.1"
APIVersion is the version of the API as defined in the design.
const ServiceName = "projects"
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 = [3]string{"createProject", "listProjects", "setLogo"}
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 MakeBadRequest ¶
func MakeBadRequest(err error) *goa.ServiceError
MakeBadRequest builds a goa.ServiceError from an error.
func MakeConflict ¶
func MakeConflict(err error) *goa.ServiceError
MakeConflict builds a goa.ServiceError from an error.
func MakeForbidden ¶
func MakeForbidden(err error) *goa.ServiceError
MakeForbidden builds a goa.ServiceError from an error.
func MakeGatewayError ¶
func MakeGatewayError(err error) *goa.ServiceError
MakeGatewayError builds a goa.ServiceError from an error.
func MakeInvalid ¶
func MakeInvalid(err error) *goa.ServiceError
MakeInvalid builds a goa.ServiceError from an error.
func MakeInvariantViolation ¶
func MakeInvariantViolation(err error) *goa.ServiceError
MakeInvariantViolation builds a goa.ServiceError from an error.
func MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func MakeUnauthorized ¶
func MakeUnauthorized(err error) *goa.ServiceError
MakeUnauthorized builds a goa.ServiceError from an error.
func MakeUnexpected ¶
func MakeUnexpected(err error) *goa.ServiceError
MakeUnexpected builds a goa.ServiceError from an error.
func MakeUnsupportedMedia ¶
func MakeUnsupportedMedia(err error) *goa.ServiceError
MakeUnsupportedMedia builds a goa.ServiceError from an error.
func NewCreateProjectEndpoint ¶
func NewCreateProjectEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewCreateProjectEndpoint returns an endpoint function that calls the method "createProject" of service "projects".
func NewListProjectsEndpoint ¶
func NewListProjectsEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewListProjectsEndpoint returns an endpoint function that calls the method "listProjects" of service "projects".
func NewSetLogoEndpoint ¶
func NewSetLogoEndpoint(s Service, authAPIKeyFn security.AuthAPIKeyFunc) goa.Endpoint
NewSetLogoEndpoint returns an endpoint function that calls the method "setLogo" of service "projects".
Types ¶
type Auther ¶
type Auther interface {
// APIKeyAuth implements the authorization logic for the APIKey security scheme.
APIKeyAuth(ctx context.Context, key string, schema *security.APIKeyScheme) (context.Context, error)
}
Auther defines the authorization functions to be implemented by the service.
type Client ¶
type Client struct {
CreateProjectEndpoint goa.Endpoint
ListProjectsEndpoint goa.Endpoint
SetLogoEndpoint goa.Endpoint
}
Client is the "projects" service client.
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, p *CreateProjectPayload) (res *CreateProjectResult, err error)
CreateProject calls the "createProject" endpoint of the "projects" service. CreateProject may return the following errors:
- "unauthorized" (type *goa.ServiceError): unauthorized access
- "forbidden" (type *goa.ServiceError): permission denied
- "bad_request" (type *goa.ServiceError): request is invalid
- "not_found" (type *goa.ServiceError): resource not found
- "conflict" (type *goa.ServiceError): resource already exists
- "unsupported_media" (type *goa.ServiceError): unsupported media type
- "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
- "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
- "unexpected" (type *goa.ServiceError): an unexpected error occurred
- "gateway_error" (type *goa.ServiceError): an unexpected error occurred
- error: internal error
func (*Client) ListProjects ¶
func (c *Client) ListProjects(ctx context.Context, p *ListProjectsPayload) (res *ListProjectsResult, err error)
ListProjects calls the "listProjects" endpoint of the "projects" service. ListProjects may return the following errors:
- "unauthorized" (type *goa.ServiceError): unauthorized access
- "forbidden" (type *goa.ServiceError): permission denied
- "bad_request" (type *goa.ServiceError): request is invalid
- "not_found" (type *goa.ServiceError): resource not found
- "conflict" (type *goa.ServiceError): resource already exists
- "unsupported_media" (type *goa.ServiceError): unsupported media type
- "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
- "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
- "unexpected" (type *goa.ServiceError): an unexpected error occurred
- "gateway_error" (type *goa.ServiceError): an unexpected error occurred
- error: internal error
func (*Client) SetLogo ¶
func (c *Client) SetLogo(ctx context.Context, p *SetLogoPayload) (res *SetProjectLogoResult, err error)
SetLogo calls the "setLogo" endpoint of the "projects" service. SetLogo may return the following errors:
- "unauthorized" (type *goa.ServiceError): unauthorized access
- "forbidden" (type *goa.ServiceError): permission denied
- "bad_request" (type *goa.ServiceError): request is invalid
- "not_found" (type *goa.ServiceError): resource not found
- "conflict" (type *goa.ServiceError): resource already exists
- "unsupported_media" (type *goa.ServiceError): unsupported media type
- "invalid" (type *goa.ServiceError): request contains one or more invalidation fields
- "invariant_violation" (type *goa.ServiceError): an unexpected error occurred
- "unexpected" (type *goa.ServiceError): an unexpected error occurred
- "gateway_error" (type *goa.ServiceError): an unexpected error occurred
- error: internal error
type CreateProjectPayload ¶
type CreateProjectPayload struct {
ApikeyToken *string
SessionToken *string
// The ID of the organization to create the project in
OrganizationID string
// The name of the project
Name string
}
CreateProjectPayload is the payload type of the projects service createProject method.
type CreateProjectResult ¶
type CreateProjectResult struct {
// The created project
Project *Project
}
CreateProjectResult is the result type of the projects service createProject method.
type Endpoints ¶
Endpoints wraps the "projects" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "projects" service with endpoints.
type ListProjectsPayload ¶
type ListProjectsPayload struct {
ApikeyToken *string
SessionToken *string
// The ID of the organization to list projects for
OrganizationID string
}
ListProjectsPayload is the payload type of the projects service listProjects method.
type ListProjectsResult ¶
type ListProjectsResult struct {
// The list of projects
Projects []*ProjectEntry
}
ListProjectsResult is the result type of the projects service listProjects method.
type Project ¶
type Project struct {
// The ID of the project
ID string
// The name of the project
Name string
// The slug of the project
Slug types.Slug
// The ID of the organization that owns the project
OrganizationID string
// The ID of the logo asset for the project
LogoAssetID *string
// The creation date of the project.
CreatedAt string
// The last update date of the project.
UpdatedAt string
}
type ProjectEntry ¶
type Service ¶
type Service interface {
// Create a new project.
CreateProject(context.Context, *CreateProjectPayload) (res *CreateProjectResult, err error)
// List all projects for an organization.
ListProjects(context.Context, *ListProjectsPayload) (res *ListProjectsResult, err error)
// Uploads a logo for a project.
SetLogo(context.Context, *SetLogoPayload) (res *SetProjectLogoResult, err error)
}
Manages projects in Gram.
type SetLogoPayload ¶
type SetLogoPayload struct {
ApikeyToken *string
ProjectSlugInput *string
SessionToken *string
// The ID of the asset
AssetID string
}
SetLogoPayload is the payload type of the projects service setLogo method.
type SetProjectLogoResult ¶
type SetProjectLogoResult struct {
// The updated project with the new logo
Project *Project
}
SetProjectLogoResult is the result type of the projects service setLogo method.