users

package
v0.0.0-...-8b085c6 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const APIName = "gram-dev-idp"

APIName is the name of the API as defined in the design.

View Source
const APIVersion = "0.0.1"

APIVersion is the version of the API as defined in the design.

View Source
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

View Source
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

func NewCreateEndpoint(s Service) goa.Endpoint

NewCreateEndpoint returns an endpoint function that calls the method "create" of service "users".

func NewDeleteEndpoint

func NewDeleteEndpoint(s Service) goa.Endpoint

NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "users".

func NewListEndpoint

func NewListEndpoint(s Service) goa.Endpoint

NewListEndpoint returns an endpoint function that calls the method "list" of service "users".

func NewUpdateEndpoint

func NewUpdateEndpoint(s Service) goa.Endpoint

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 NewClient

func NewClient(create, update, list, delete_ goa.Endpoint) *Client

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

func (*Client) Create

func (c *Client) Create(ctx context.Context, p *CreatePayload) (res *User, err error)

Create calls the "create" endpoint of the "users" service.

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.

func (*Client) Update

func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *User, err error)

Update calls the "update" 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

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "users" service 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.

Jump to

Keyboard shortcuts

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