Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Authentication service for logging in and registering new users. // If you are using OAuth Client Credentials for, see `WithClientCredential`. Authentication() authenticationconnect.ServiceClient // User service for managing users. User() userconnect.ServiceClient // UserSettings service for managing settings for the entire User module. UserSettings() usersettingsconnect.ServiceClient // ServiceAccount service for creating and maintaining OAuth2 Service Accounts. ServiceAccount() service_accountconnect.ServiceClient // Group service for managing groups and associating users to them. Group() groupconnect.ServiceClient // Capsule API for managing the lifecycle of Capsules. Capsule() capsuleconnect.ServiceClient // Project API for configuring the overall settings of the project. Project() projectconnect.ServiceClient // ProjectSettings service for managing settings of projects ProjectSettings() projectsettingsconnect.ServiceClient // Cluster service for managing the Rig cluster Cluster() clusterconnect.ServiceClient Image() imageconnect.ServiceClient Environment() environmentconnect.ServiceClient // Set the access- and refresh token pair. This will use the underlying SessionManager. // The client will refresh the tokens in the background as needed. SetAccessToken(accessToken, refreshToken string) }
Client for interacting with the Rig APIs. Each of the services are available as a `connect.build` Client, allowing for a variety of communication options, such as gRPC, connect.build, HTTP/JSON.
type ClientCredential ¶
ClientCredential to use for authenticating with the backend using the OAuth2 Client Credentials flow. Use `WithClientCredentials` when creating a new client, to set them. The client will automatically register a ClientCredential if the `RIG_CLIENT_ID` and `RIG_CLIENT_SECRET` environment variables are set.
type Interceptor ¶
type Interceptor = connect.Interceptor
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithBasicAuthOption ¶
func WithBasicAuthOption(cc ClientCredential) Option
func WithClient ¶
func WithClientCredentials ¶
func WithClientCredentials(cc ClientCredential) Option
func WithInterceptors ¶
func WithInterceptors(ics ...Interceptor) Option
func WithSessionManager ¶
func WithSessionManager(sm SessionManager) Option
type SessionManager ¶
type SessionManager interface { GetAccessToken() string GetRefreshToken() string SetAccessToken(accessToken, refreshToken string) }
SessionManager is used by the Client to help maintain the access and refresh tokens. By default, an in-memory version will be used. A custom implementation can be provided using `WithSessionManager`, if the tokens should be stored e.g. in a config file.
type WithBasicAuth ¶
type WithBasicAuth struct {
// contains filtered or unexported fields
}