Documentation
¶
Index ¶
- Constants
- Variables
- func NewCreateEndpoint(s Service) goa.Endpoint
- func NewDeleteEndpoint(s Service) goa.Endpoint
- func NewListEndpoint(s Service) goa.Endpoint
- func NewUpdateEndpoint(s Service) goa.Endpoint
- type Client
- func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *User, err error)
- func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
- func (c *Client) List(ctx context.Context, p *ListPayload) (res *ListUsersResult, err error)
- func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *User, err error)
- type CreatePayload
- type DeletePayload
- type Endpoints
- type ListPayload
- type ListUsersResult
- type Service
- type UpdatePayload
- type User
Constants ¶
const APIName = "gram-dev-idp"
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 = "users"
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 = [4]string{"create", "update", "list", "delete"}
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 NewCreateEndpoint ¶
NewCreateEndpoint returns an endpoint function that calls the method "create" of service "users".
func NewDeleteEndpoint ¶
NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "users".
func NewListEndpoint ¶
NewListEndpoint returns an endpoint function that calls the method "list" of service "users".
func NewUpdateEndpoint ¶
NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "users".
Types ¶
type Client ¶
type Client struct {
CreateEndpoint goa.Endpoint
UpdateEndpoint goa.Endpoint
ListEndpoint goa.Endpoint
DeleteEndpoint goa.Endpoint
}
Client is the "users" service client.
func (*Client) Delete ¶
func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)
Delete calls the "delete" endpoint of the "users" service.
func (*Client) List ¶
func (c *Client) List(ctx context.Context, p *ListPayload) (res *ListUsersResult, err error)
List calls the "list" endpoint of the "users" service.
type CreatePayload ¶
type CreatePayload struct {
// Email address. Must be unique.
Email string
// Display name.
DisplayName string
// Optional photo URL.
PhotoURL *string
// Optional GitHub handle.
GithubHandle *string
// Admin flag; defaults false.
Admin *bool
// Whitelist flag; defaults true.
Whitelisted *bool
}
CreatePayload is the payload type of the users service create method.
type DeletePayload ¶
type DeletePayload struct {
// User UUID.
ID string
}
DeletePayload is the payload type of the users service delete method.
type Endpoints ¶
type Endpoints struct {
Create goa.Endpoint
Update goa.Endpoint
List goa.Endpoint
Delete goa.Endpoint
}
Endpoints wraps the "users" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "users" service with endpoints.
type ListPayload ¶
type ListPayload struct {
// Opaque cursor returned by a previous list call.
Cursor *string
// Maximum items to return.
Limit int
}
ListPayload is the payload type of the users service list method.
type ListUsersResult ¶
type ListUsersResult struct {
// Users on this page.
Items []*User
// Cursor for the next page, empty when exhausted.
NextCursor string
}
ListUsersResult is the result type of the users service list method.
type Service ¶
type Service interface {
// Create a user.
Create(context.Context, *CreatePayload) (res *User, err error)
// Patch a user.
Update(context.Context, *UpdatePayload) (res *User, err error)
// List users.
List(context.Context, *ListPayload) (res *ListUsersResult, err error)
// Hard-delete a user. Cascades to memberships, auth_codes, tokens, and any
// current_users row whose subject_ref matches (idp-design.md §6.1).
Delete(context.Context, *DeletePayload) (err error)
}
Dev-idp users CRUD. The local-mode currentUser (mock-workos / oauth2-1 / oauth2) references rows in this table by id (idp-design.md §3, §5). Permanently unauthenticated.
type UpdatePayload ¶
type UpdatePayload struct {
// User UUID.
ID string
Email *string
DisplayName *string
PhotoURL *string
GithubHandle *string
Admin *bool
Whitelisted *bool
}
UpdatePayload is the payload type of the users service update method.
type User ¶
type User struct {
// User UUID.
ID string
// Email address (unique).
Email string
// Display name.
DisplayName string
// Optional photo URL.
PhotoURL *string
// Optional GitHub handle.
GithubHandle *string
// Admin flag.
Admin bool
// Whitelist flag.
Whitelisted bool
CreatedAt string
UpdatedAt string
}
User is the result type of the users service create method.