Documentation ¶
Overview ¶
Package api provides the daemon API.
Index ¶
- type Client
- type CredentialsClient
- func (c *CredentialsClient) Create(ctx context.Context, cred *apitypes.Credential, progress ProgressFunc) (*apitypes.CredentialEnvelope, error)
- func (c *CredentialsClient) Get(ctx context.Context, path string) ([]apitypes.CredentialEnvelope, error)
- func (c *CredentialsClient) Search(ctx context.Context, pathexp string) ([]apitypes.CredentialEnvelope, error)
- type Event
- type KeyPairsClient
- type MachinesClient
- type OrgInvitesClient
- type ProgressFunc
- type Session
- type SessionClient
- func (s *SessionClient) Get(ctx context.Context) (*apitypes.SessionStatus, error)
- func (s *SessionClient) Logout(ctx context.Context) error
- func (s *SessionClient) MachineLogin(ctx context.Context, tokenID, tokenSecret string) error
- func (s *SessionClient) UserLogin(ctx context.Context, email, passphrase string) error
- func (s *SessionClient) Who(ctx context.Context) (*Session, error)
- type UpdatesClient
- type UsersClient
- type VersionClient
- type WorklogClient
- func (w *WorklogClient) Get(ctx context.Context, orgID *identity.ID, ident *apitypes.WorklogID) (*apitypes.WorklogItem, error)
- func (w *WorklogClient) List(ctx context.Context, orgID *identity.ID) ([]apitypes.WorklogItem, error)
- func (w *WorklogClient) Resolve(ctx context.Context, orgID *identity.ID, ident *apitypes.WorklogID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { registry.Client // Endpoints with daemon specific overrides Users *UsersClient Machines *MachinesClient KeyPairs *KeyPairsClient OrgInvites *OrgInvitesClient Version *VersionClient // Daemon only endpoints Session *SessionClient Credentials *CredentialsClient // this replaces the registry endpoint Worklog *WorklogClient Updates *UpdatesClient // Cryptography related registry endpoints that should be accessed // via the daemon. Tokens blacklisted Keyring blacklisted KeyringMember blacklisted Claims blacklisted ClaimTree blacklisted CredentialGraph blacklisted }
Client exposes the daemon API.
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.
func (*CredentialsClient) Search ¶ added in v0.13.0
func (c *CredentialsClient) Search(ctx context.Context, pathexp string) ([]apitypes.CredentialEnvelope, error)
Search returns all credentials at the given pathexp.
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 KeyPairsClient ¶ added in v0.22.0
type KeyPairsClient struct { *registry.KeyPairsClient // contains filtered or unexported fields }
KeyPairsClient makes requests to the registry's and daemon's keypairs endpoints
func (*KeyPairsClient) Create ¶ added in v0.22.0
func (k *KeyPairsClient) Create(ctx context.Context, orgID *identity.ID, output ProgressFunc) error
Create generates new keypairs for the user in the given org.
func (*KeyPairsClient) Revoke ¶ added in v0.22.0
func (k *KeyPairsClient) Revoke(ctx context.Context, orgID *identity.ID, output ProgressFunc) error
Revoke revokes the existing keypairs for the user in the given org.
type MachinesClient ¶ added in v0.15.0
type MachinesClient struct { *registry.MachinesClient // contains filtered or unexported fields }
MachinesClient makes requests to the Daemon on behalf of the user to manipulate Machine resources.
func (*MachinesClient) Create ¶ added in v0.15.0
func (m *MachinesClient) Create(ctx context.Context, orgID, teamID *identity.ID, name string, output ProgressFunc) (*apitypes.MachineSegment, *base64.Value, error)
Create a new machine in the given org
type OrgInvitesClient ¶ added in v0.22.0
type OrgInvitesClient struct { *registry.OrgInvitesClient // contains filtered or unexported fields }
OrgInvitesClient makes requests to the registry's and daemon's org invites endpoints
func (*OrgInvitesClient) Approve ¶ added in v0.22.0
func (i *OrgInvitesClient) Approve(ctx context.Context, inviteID identity.ID, output ProgressFunc) error
Approve executes the approve invite request
type ProgressFunc ¶
ProgressFunc is used to output events
type Session ¶ added in v0.15.0
type Session struct {
// contains filtered or unexported fields
}
Session represents the current logged in entities identity and authentication objects which could be a Machine or User
func NewSession ¶ added in v0.15.0
NewSession returns a new session constructed from the payload of the current identity as returned from the Daemon
func (*Session) AuthID ¶ added in v0.15.0
AuthID returns the auth id (e.g. user or machine token id)
func (*Session) Email ¶ added in v0.15.0
Email returns none for a machine or the users email address
func (*Session) Type ¶ added in v0.15.0
func (s *Session) Type() apitypes.SessionType
Type returns the type of the session (machine or user)
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.
func (*SessionClient) Logout ¶
func (s *SessionClient) Logout(ctx context.Context) error
Logout logs the user out of their session
func (*SessionClient) MachineLogin ¶ added in v0.15.0
func (s *SessionClient) MachineLogin(ctx context.Context, tokenID, tokenSecret string) error
MachineLogin logs the user in using the provided token id and secret
type UpdatesClient ¶ added in v0.23.0
type UpdatesClient struct {
// contains filtered or unexported fields
}
UpdatesClient checks if there are updates available coming from the daemon update checker component.
func (*UpdatesClient) Check ¶ added in v0.23.0
func (c *UpdatesClient) Check(ctx context.Context) (*apitypes.UpdateInfo, error)
Check returns the latest updates check result, useful for detecting whether a newer version of Torus is available for download.
type UsersClient ¶
type UsersClient struct { *registry.UsersClient // contains filtered or unexported fields }
UsersClient makes requests to the registry's and daemon's users endpoints
func (*UsersClient) Create ¶ added in v0.22.0
func (u *UsersClient) Create(ctx context.Context, signup *apitypes.Signup, output *ProgressFunc) (envelope.UserInf, error)
Create will have the daemon create a new user request
func (*UsersClient) Update ¶ added in v0.17.0
func (u *UsersClient) Update(ctx context.Context, delta apitypes.ProfileUpdate) (envelope.UserInf, error)
Update performs a profile update to the user object
type VersionClient ¶
type VersionClient struct { *registry.VersionClient // contains filtered or unexported fields }
VersionClient provides access to the daemon's /v1/version endpoint, for inspecting the daemon's release version.
type WorklogClient ¶ added in v0.12.0
type WorklogClient struct {
// contains filtered or unexported fields
}
WorklogClient views and resolves worklog items in the daemon.
func (*WorklogClient) Get ¶ added in v0.12.0
func (w *WorklogClient) Get(ctx context.Context, orgID *identity.ID, ident *apitypes.WorklogID) (*apitypes.WorklogItem, error)
Get returns the worklog item with the given id in the given org.
func (*WorklogClient) List ¶ added in v0.12.0
func (w *WorklogClient) List(ctx context.Context, orgID *identity.ID) ([]apitypes.WorklogItem, error)
List returns the list of all worklog items in the given org.