Documentation ¶
Overview ¶
Package api provides the daemon API.
Index ¶
- type Client
- type CredentialsClient
- type EnvironmentResult
- type EnvironmentsClient
- type Event
- type InviteResult
- type InvitesClient
- func (i *InvitesClient) Accept(ctx context.Context, org, email, code string) error
- func (i *InvitesClient) Approve(ctx context.Context, inviteID identity.ID, output *ProgressFunc) error
- func (i *InvitesClient) Associate(ctx context.Context, org, email, code string) (*InviteResult, error)
- func (i *InvitesClient) List(ctx context.Context, orgID *identity.ID, states []string) ([]InviteResult, error)
- func (i *InvitesClient) Send(ctx context.Context, email string, orgID, inviterID identity.ID, ...) error
- type KeypairResult
- type KeypairsClient
- type MembershipResult
- type MembershipsClient
- type OrgResult
- type OrgsClient
- type PoliciesClient
- func (p *PoliciesClient) Attach(ctx context.Context, org, policy, team *identity.ID) error
- func (p *PoliciesClient) AttachmentsList(ctx context.Context, orgID, ownerID, policyID *identity.ID) ([]PolicyAttachmentResult, error)
- func (p *PoliciesClient) Create(ctx context.Context, policy *primitive.Policy) (*PoliciesResult, error)
- func (p *PoliciesClient) Detach(ctx context.Context, attachmentID *identity.ID) error
- func (p *PoliciesClient) List(ctx context.Context, orgID *identity.ID, name string) ([]PoliciesResult, error)
- type PoliciesResult
- type PolicyAttachmentResult
- type ProfilesClient
- type ProgressFunc
- type ProjectResult
- type ProjectsClient
- type ServiceResult
- type ServicesClient
- type SessionClient
- type TeamResult
- type TeamsClient
- type UserResult
- type UsersClient
- type VersionClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Orgs *OrgsClient Users *UsersClient Profiles *ProfilesClient Teams *TeamsClient Memberships *MembershipsClient Invites *InvitesClient Keypairs *KeypairsClient Session *SessionClient Services *ServicesClient Policies *PoliciesClient Environments *EnvironmentsClient Projects *ProjectsClient Credentials *CredentialsClient Version *VersionClient // contains filtered or unexported fields }
Client exposes the daemon API.
func (*Client) Do ¶
func (c *Client) Do(ctx context.Context, r *http.Request, v interface{}, reqID *string, progress *ProgressFunc) (*http.Response, error)
Do executes an http.Request, populating v with the JSON response on success.
If the request errors with a JSON formatted response body, it will be unmarshaled into the returned error.
type CredentialsClient ¶
type CredentialsClient struct {
// contains filtered or unexported fields
}
CredentialsClient provides access to unencrypted credentials for viewing, and encrypts credentials when setting.
func (*CredentialsClient) Create ¶ added in v0.8.0
func (c *CredentialsClient) Create(ctx context.Context, cred *apitypes.Credential, progress *ProgressFunc) (*apitypes.CredentialEnvelope, error)
Create creates the given credential
func (*CredentialsClient) Get ¶
func (c *CredentialsClient) Get(ctx context.Context, path string) ([]apitypes.CredentialEnvelope, error)
Get returns all credentials at the given path.
type EnvironmentResult ¶
type EnvironmentResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Environment `json:"body"` }
EnvironmentResult is the payload returned for a env object
type EnvironmentsClient ¶
type EnvironmentsClient struct {
// contains filtered or unexported fields
}
EnvironmentsClient makes proxied requests to the registry's envs endpoints
func (*EnvironmentsClient) Create ¶
func (e *EnvironmentsClient) Create(ctx context.Context, orgID, projectID *identity.ID, name string) error
Create generates a new env object for an org/project ID
func (*EnvironmentsClient) List ¶
func (e *EnvironmentsClient) List(ctx context.Context, orgID, projectID *identity.ID, name *string) ([]EnvironmentResult, error)
List retrieves relevant envs by name and/or orgID and/or projectID
type Event ¶
type Event struct { ID string `json:"id"` MessageType string Message string `json:"message"` Completed int `json:"completed"` Total int `json:"total"` }
Event contains the properties of a server sent event
type InviteResult ¶
type InviteResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.OrgInvite `json:"body"` }
InviteResult is the payload returned for a team object
type InvitesClient ¶
type InvitesClient struct {
// contains filtered or unexported fields
}
InvitesClient makes proxied requests to the registry's invites endpoints
func (*InvitesClient) Accept ¶
func (i *InvitesClient) Accept(ctx context.Context, org, email, code string) error
Accept executes the accept invite request
func (*InvitesClient) Approve ¶
func (i *InvitesClient) Approve(ctx context.Context, inviteID identity.ID, output *ProgressFunc) error
Approve executes the approve invite request
func (*InvitesClient) Associate ¶
func (i *InvitesClient) Associate(ctx context.Context, org, email, code string) (*InviteResult, error)
Associate executes the associate invite request
func (*InvitesClient) List ¶
func (i *InvitesClient) List(ctx context.Context, orgID *identity.ID, states []string) ([]InviteResult, error)
List all invites for a given org
type KeypairResult ¶
type KeypairResult struct { PublicKey *struct { ID *identity.ID `json:"id"` Body *primitive.PublicKey `json:"body"` } `json:"public_key"` PrivateKey *struct { ID *identity.ID `json:"id"` Body *primitive.PublicKey `json:"body"` } `json:"private_key"` Claims *[]struct { ID *identity.ID `json:"id"` Body *primitive.Claim `json:"claims"` } }
KeypairResult is the payload returned for a keypair object
type KeypairsClient ¶
type KeypairsClient struct {
// contains filtered or unexported fields
}
KeypairsClient makes proxied requests to the registry's keypairs endpoints
func (*KeypairsClient) Generate ¶
func (k *KeypairsClient) Generate(ctx context.Context, orgID *identity.ID, output *ProgressFunc) error
Generate generates new keypairs for the user in the given org.
func (*KeypairsClient) List ¶
func (k *KeypairsClient) List(ctx context.Context, orgID *identity.ID) ([]KeypairResult, error)
List retrieves relevant keypairs by orgID
type MembershipResult ¶
type MembershipResult struct { ID *identity.ID Version uint8 Body *primitive.Membership }
MembershipResult is the payload returned for team membership association.
type MembershipsClient ¶
type MembershipsClient struct {
// contains filtered or unexported fields
}
MembershipsClient makes proxied requests to the registry's team memberships endpoints.
func (*MembershipsClient) List ¶
func (m *MembershipsClient) List(ctx context.Context, org, user, team *identity.ID) ([]MembershipResult, error)
List returns all team membership associations for the given user id within the given org id.
type OrgResult ¶
type OrgResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Org `json:"body"` }
OrgResult is the payload returned for an org object
type OrgsClient ¶
type OrgsClient struct {
// contains filtered or unexported fields
}
OrgsClient makes proxied requests to the registry's orgs endpoints
func (*OrgsClient) Create ¶
Create creates a new org with the given name. It returns the newly-created org.
type PoliciesClient ¶
type PoliciesClient struct {
// contains filtered or unexported fields
}
PoliciesClient makes proxied requests to the registry's policies endpoints
func (*PoliciesClient) AttachmentsList ¶
func (p *PoliciesClient) AttachmentsList(ctx context.Context, orgID, ownerID, policyID *identity.ID) ([]PolicyAttachmentResult, error)
AttachmentsList retrieves all policy attachments for an org
func (*PoliciesClient) Create ¶ added in v0.8.0
func (p *PoliciesClient) Create(ctx context.Context, policy *primitive.Policy) (*PoliciesResult, error)
Create creates a new policy
func (*PoliciesClient) List ¶
func (p *PoliciesClient) List(ctx context.Context, orgID *identity.ID, name string) ([]PoliciesResult, error)
List retrieves relevant policiies by orgID and/or name
type PoliciesResult ¶
type PoliciesResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Policy `json:"body"` }
PoliciesResult is the payload returned for a policy object
type PolicyAttachmentResult ¶
type PolicyAttachmentResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.PolicyAttachment `json:"body"` }
PolicyAttachmentResult is the payload returned for a policy_attachment object
type ProfilesClient ¶
type ProfilesClient struct {
// contains filtered or unexported fields
}
ProfilesClient makes proxied requests to the registry's profiles endpoints
func (*ProfilesClient) ListByID ¶
func (p *ProfilesClient) ListByID(ctx context.Context, userIDs []identity.ID) (*[]apitypes.Profile, error)
ListByID returns profiles looked up by User ID
func (*ProfilesClient) ListByName ¶
ListByName returns profiles looked up by username
type ProgressFunc ¶
ProgressFunc is used to output events
type ProjectResult ¶
type ProjectResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Project `json:"body"` }
ProjectResult is the payload returned for a project object
type ProjectsClient ¶
type ProjectsClient struct {
// contains filtered or unexported fields
}
ProjectsClient makes proxied requests to the registry's projects endpoints
func (*ProjectsClient) Create ¶
func (p *ProjectsClient) Create(ctx context.Context, org *identity.ID, name string) (*ProjectResult, error)
Create creates a new project with the given name within the given org
func (*ProjectsClient) List ¶
func (p *ProjectsClient) List(ctx context.Context, orgID *identity.ID, name *string) ([]ProjectResult, error)
List retrieves relevant projects by name and/or orgID
type ServiceResult ¶
type ServiceResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Service `json:"body"` }
ServiceResult is the payload returned for a service object
type ServicesClient ¶
type ServicesClient struct {
// contains filtered or unexported fields
}
ServicesClient makes proxied requests to the registry's services endpoints
func (*ServicesClient) Create ¶
func (s *ServicesClient) Create(ctx context.Context, orgID, projectID *identity.ID, name string) error
Create performs a request to create a new service object
func (*ServicesClient) List ¶
func (s *ServicesClient) List(ctx context.Context, orgID, projectID *identity.ID, name *string) ([]ServiceResult, error)
List retrieves relevant services by name and/or orgID and/or projectID
type SessionClient ¶
type SessionClient struct {
// contains filtered or unexported fields
}
SessionClient provides access to the daemon's user session related endpoints, for logging in/out, and checking your session status.
func (*SessionClient) Get ¶
func (s *SessionClient) Get(ctx context.Context) (*apitypes.SessionStatus, error)
Get returns the status of the user's session.
type TeamResult ¶
type TeamResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.Team `json:"body"` }
TeamResult is the payload returned for a team object
type TeamsClient ¶
type TeamsClient struct {
// contains filtered or unexported fields
}
TeamsClient makes proxied requests to the registry's teams endpoints
func (*TeamsClient) GetByName ¶
func (t *TeamsClient) GetByName(ctx context.Context, orgID *identity.ID, name string) ([]TeamResult, error)
GetByName retrieves the team with the specified name
func (*TeamsClient) GetByOrg ¶
func (t *TeamsClient) GetByOrg(ctx context.Context, orgID *identity.ID) ([]TeamResult, error)
GetByOrg retrieves all teams for an org id
type UserResult ¶
type UserResult struct { ID *identity.ID `json:"id"` Version uint8 `json:"version"` Body *primitive.User `json:"body"` }
UserResult is the payload returned for a user object
type UsersClient ¶
type UsersClient struct {
// contains filtered or unexported fields
}
UsersClient makes proxied requests to the registry's users endpoints
func (*UsersClient) Self ¶
func (u *UsersClient) Self(ctx context.Context) (*UserResult, error)
Self retrieves the currently logged in user
func (*UsersClient) Signup ¶
func (u *UsersClient) Signup(ctx context.Context, signup *apitypes.Signup, output *ProgressFunc) (*UserResult, error)
Signup will have the daemon create a new user request
func (*UsersClient) VerifyEmail ¶ added in v0.8.0
func (u *UsersClient) VerifyEmail(ctx context.Context, verifyCode string) error
VerifyEmail will confirm the user's email with the registry
type VersionClient ¶
type VersionClient struct {
// contains filtered or unexported fields
}
VersionClient provides access to the daemon's /v1/version endpoint, for inspecting the daemon's release version.
func (*VersionClient) GetRegistry ¶
GetRegistry returns the registry's release version.