Documentation
¶
Index ¶
- type BatchingOctopusApiClient
- func (c *BatchingOctopusApiClient[T]) GetAllGlobalResourcesBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
- func (c *BatchingOctopusApiClient[T]) GetAllResourcesArrayBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
- func (c *BatchingOctopusApiClient[T]) GetAllResourcesBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
- func (c *BatchingOctopusApiClient[T]) GetAllResourcesBatchWithQueryParams(done <-chan struct{}, resourceType string, additionalParams ...[]string) <-chan ResultError[T]
- type OctopusApiClient
- func (o *OctopusApiClient) EnsureSpaceDeleted(spaceId string) (deleted bool, funcErr error)
- func (o *OctopusApiClient) GetAllGlobalResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
- func (o *OctopusApiClient) GetAllResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
- func (o *OctopusApiClient) GetBaseUrl() (string, error)
- func (o *OctopusApiClient) GetGlobalResourceById(resourceType string, id string, resources any) (exists bool, funcErr error)
- func (o *OctopusApiClient) GetResource(resourceType string, resources any) (exists bool, funcErr error)
- func (o *OctopusApiClient) GetResourceById(resourceType string, id string, resources any) (funcErr error)
- func (o *OctopusApiClient) GetResourceByName(resourceType string, name string, resource any) (exists bool, funcErr error)
- func (o *OctopusApiClient) GetResourceNameById(resourceType string, id string) (name string, funcErr error)
- func (o *OctopusApiClient) GetResourceNamesByIds(resourceType string, id []string) (names []string, funcErr error)
- func (o *OctopusApiClient) GetSpace(resources *octopus.Space) (funcErr error)
- func (o *OctopusApiClient) GetSpaceBaseUrl() (string, error)
- func (o *OctopusApiClient) GetSpaceResourceById(resourceType string, id string, resources any) (exists bool, funcErr error)
- func (o *OctopusApiClient) GetSpaces() (spaces []octopus.Space, funcErr error)
- type OctopusClient
- type ResultError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchingOctopusApiClient ¶ added in v0.1.1092
type BatchingOctopusApiClient[T any] struct { Client OctopusClient // ApiVersion is an optional version string (e.g. "v2") appended to the resource type path. // When set, the API path becomes "{resourceType}/{ApiVersion}" instead of just "{resourceType}". ApiVersion string }
BatchingOctopusApiClient is a wrapper over the regular client that exposes the ability to return a group of resources while making smaller batched requests to the Octopus API. This has the benefit of allowing large collections to be processed in a lazy fashion.
func (*BatchingOctopusApiClient[T]) GetAllGlobalResourcesBatch ¶ added in v0.1.1434
func (c *BatchingOctopusApiClient[T]) GetAllGlobalResourcesBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
GetAllGlobalResourcesBatch retrieves all the global (i.e. not space specific) resources of a given type but in small batches. This allows the resources to be exported in smaller chunks, which is useful for large spaces.
func (*BatchingOctopusApiClient[T]) GetAllResourcesArrayBatch ¶ added in v0.1.1434
func (c *BatchingOctopusApiClient[T]) GetAllResourcesArrayBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
GetAllResourcesArrayBatch retrieves all the resources of a given type as a plain array but in small batches. This allows the resources to be exported in smaller chunks, which is useful for large spaces.
func (*BatchingOctopusApiClient[T]) GetAllResourcesBatch ¶ added in v0.1.1092
func (c *BatchingOctopusApiClient[T]) GetAllResourcesBatch(done <-chan struct{}, resourceType string) <-chan ResultError[T]
GetAllResourcesBatch retrieves all the resources of a given type but in small batches. This allows the resources to be exported in smaller chunks, which is useful for large spaces.
func (*BatchingOctopusApiClient[T]) GetAllResourcesBatchWithQueryParams ¶ added in v1.14.14
func (c *BatchingOctopusApiClient[T]) GetAllResourcesBatchWithQueryParams(done <-chan struct{}, resourceType string, additionalParams ...[]string) <-chan ResultError[T]
GetAllResourcesBatchWithQueryParams retrieves all the resources of a given type but in small batches, with additional query parameters appended to each request. If ApiVersion is set on the client, it is appended to the resource type path.
type OctopusApiClient ¶ added in v0.1.807
type OctopusApiClient struct {
Url string
ApiKey string
AccessToken string
Space string
Version string
// a flag to indicate if the client must use the redirector
// https://github.com/OctopusSolutionsEngineering/AzureFunctionRouter
UseRedirector bool
// RedirectorHost is the hostname of the redirector to use
RedirectorHost string
// This key must be known by the service that is using the redirector
RedirectorServiceApiKey string
// This key is passed by the caller
RedirecrtorApiKey string
// These rules are passed by the called
RedirectorRedirections string
IgnoreUnauthorized bool
// IgnoreServerError silently ignores 500 responses when fetching individual resources
IgnoreServerError bool
// ApiVersion is an optional version string (e.g. "v2") appended to the resource type path.
// When set, the API path becomes "{resourceType}/{ApiVersion}" instead of just "{resourceType}".
ApiVersion string
// contains filtered or unexported fields
}
func (*OctopusApiClient) EnsureSpaceDeleted ¶ added in v0.1.807
func (o *OctopusApiClient) EnsureSpaceDeleted(spaceId string) (deleted bool, funcErr error)
func (*OctopusApiClient) GetAllGlobalResources ¶ added in v0.1.1434
func (o *OctopusApiClient) GetAllGlobalResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
func (*OctopusApiClient) GetAllResources ¶ added in v0.1.807
func (o *OctopusApiClient) GetAllResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
func (*OctopusApiClient) GetBaseUrl ¶ added in v0.1.1204
func (o *OctopusApiClient) GetBaseUrl() (string, error)
func (*OctopusApiClient) GetGlobalResourceById ¶ added in v0.1.1204
func (*OctopusApiClient) GetResource ¶ added in v0.1.807
func (o *OctopusApiClient) GetResource(resourceType string, resources any) (exists bool, funcErr error)
func (*OctopusApiClient) GetResourceById ¶ added in v0.1.807
func (o *OctopusApiClient) GetResourceById(resourceType string, id string, resources any) (funcErr error)
func (*OctopusApiClient) GetResourceByName ¶ added in v0.1.1534
func (*OctopusApiClient) GetResourceNameById ¶ added in v0.1.1109
func (o *OctopusApiClient) GetResourceNameById(resourceType string, id string) (name string, funcErr error)
func (*OctopusApiClient) GetResourceNamesByIds ¶ added in v0.1.1109
func (o *OctopusApiClient) GetResourceNamesByIds(resourceType string, id []string) (names []string, funcErr error)
func (*OctopusApiClient) GetSpace ¶ added in v0.1.807
func (o *OctopusApiClient) GetSpace(resources *octopus.Space) (funcErr error)
func (*OctopusApiClient) GetSpaceBaseUrl ¶ added in v0.1.807
func (o *OctopusApiClient) GetSpaceBaseUrl() (string, error)
func (*OctopusApiClient) GetSpaceResourceById ¶ added in v0.1.1204
type OctopusClient ¶
type OctopusClient interface {
GetSpaceBaseUrl() (string, error)
GetSpace(resources *octopus.Space) error
GetSpaces() ([]octopus.Space, error)
EnsureSpaceDeleted(spaceId string) (deleted bool, funcErr error)
GetResource(resourceType string, resources any) (exists bool, funcErr error)
GetResourceById(resourceType string, id string, resources any) (funcErr error)
GetResourceByName(resourceType string, name string, resources any) (exists bool, funcErr error)
GetSpaceResourceById(resourceType string, id string, resources any) (exists bool, funcErr error)
GetGlobalResourceById(resourceType string, id string, resources any) (exists bool, funcErr error)
GetResourceNameById(resourceType string, id string) (name string, funcErr error)
GetResourceNamesByIds(resourceType string, id []string) (name []string, funcErr error)
GetAllResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
GetAllGlobalResources(resourceType string, resources any, queryParams ...[]string) (funcErr error)
}
type ResultError ¶ added in v0.1.1092
ResultError captures either a successful result or an error.