Documentation ¶
Index ¶
- type AuthAPIClientCredentialFlowRes
- type AuthClient
- func (c *AuthClient) Do(req *http.Request, v interface{}, errorHandlers ...func(*http.Response) error) (*http.Response, error)
- func (c *AuthClient) GetToken(ctx context.Context) (res AuthAPIClientCredentialFlowRes, err error)
- func (c *AuthClient) Request(ctx context.Context, method, path string, body string) (*http.Request, error)
- type AuthConfig
- type Client
- func (c *Client) Do(req *http.Request, v interface{}, errorHandlers ...func(*http.Response) error) (*http.Response, error)
- func (c *Client) GetConfig() *Config
- func (c *Client) GetHTTPClient() *http.Client
- func (c *Client) OrganizationID() string
- func (c *Client) Request(ctx context.Context, method, path string, body []byte) (*http.Request, error)
- func (c *Client) Retry() *retry.Retry
- func (c *Client) SetRetry(r *retry.Retry)
- func (c *Client) SetToken(token string)
- type Config
- type IncubatorServices
- type ProductiveServices
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthAPIClientCredentialFlowRes ¶
type AuthAPIClientCredentialFlowRes struct { AccessToken string `json:"access_token"` TokenType string `json:"token_type"` ExpiresIn int `json:"expires_in"` Scope string `json:"scope"` JTI string `json:"jti"` }
AuthAPIClientCredentialFlowRes response structure for client credentials flow
type AuthClient ¶
type AuthClient struct { Client *http.Client Config *AuthConfig }
AuthClient manages communication with Auth API
func MockAuthServer ¶
func MockAuthServer() (c *AuthClient, mux *http.ServeMux, teardown func(), err error)
MockAuthServer mocks an authentication server and returns an auth client pointing to it, mux, teardown function and an error indicator
func NewAuth ¶
func NewAuth(ctx context.Context, cfg *AuthConfig) (*AuthClient, error)
NewAuth returns a new Auth API client
func (*AuthClient) Do ¶
func (c *AuthClient) Do(req *http.Request, v interface{}, errorHandlers ...func(*http.Response) error) (*http.Response, error)
Do performs the request and decodes the response if given interface != nil
func (*AuthClient) GetToken ¶
func (c *AuthClient) GetToken(ctx context.Context) (res AuthAPIClientCredentialFlowRes, err error)
GetToken returns a token from Auth API
type AuthConfig ¶
AuthConfig holds information for using auth API
func (*AuthConfig) SetURL ¶
func (c *AuthConfig) SetURL(value string) error
SetURL sets a given url string as the base url in the config if the given value is empty, the default auth base URL will be used
func (*AuthConfig) Validate ¶
func (c *AuthConfig) Validate() error
Validate verifies that the given config is valid
type Client ¶
type Client struct { // Productive services - services that are ready to be used in production ProductiveServices // Incubator - services under development or currently being tested // not ready for production usage Incubator IncubatorServices // contains filtered or unexported fields }
Client service for managing interactions with STACKIT API
func MockServer ¶
MockServer mocks STACKIT api server and returns a client pointing to it, mux, teardown function and an error indicator
func (*Client) Do ¶
func (c *Client) Do(req *http.Request, v interface{}, errorHandlers ...func(*http.Response) error) (*http.Response, error)
Do performs the request, including retry if set To set retry, use WithRetry() which returns a shalow copy of the client
func (*Client) GetHTTPClient ¶
func (*Client) OrganizationID ¶
OrganizationID returns the organization ID defined in the configuration
func (*Client) Request ¶
func (c *Client) Request(ctx context.Context, method, path string, body []byte) (*http.Request, error)
Request creates a new API request
type Config ¶
Config is the STACKIT client configuration
type IncubatorServices ¶
type IncubatorServices struct { Membership *membership.MembershipService ResourceManager *resourceManager.ResourceManagerService }
IncubatorServices is the struct representing all services that are under development
type ProductiveServices ¶
type ProductiveServices struct { Argus *argus.ArgusService Costs *costs.CostsService Kubernetes *kubernetes.KubernetesService ObjectStorage *objectstorage.ObjectStorageService Projects *projects.ProjectService Roles *roles.RolesService Users *users.UsersService }
ProductiveServices is the struct representing all productive services
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
internal
|
|
common
client file in package common holds the client interface and service struct used by each service that the client is connecting with services using the Service struct are located under pkg/api
|
client file in package common holds the client interface and service struct used by each service that the client is connecting with services using the Service struct are located under pkg/api |
pkg
|
|
api/v2/membership/roles
package roles is used for creating and managing custom roles (and permissions assigned to them)
|
package roles is used for creating and managing custom roles (and permissions assigned to them) |