package
0.7.3
Repository: https://github.com/anexia-it/go-anxcloud.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
Package types contains everything needed by APIs implementing the interfaces to be compatible with the generic API client.

# Functions

AutoTag can be used to automatically tag objects after creation.
EnvironmentOption can be used to configure an alternative environment path segment for a given API group.
ErrorFromResponse creates a new HTTPError from the given response.
FullObjects can be set to make a Get for every object before it is returned to the caller of List().
GetEnvironmentPathSegment retrieves the environment path segment of a given API group or the provided defaultValue if no environment override is set.
GetObjectIdentifier extracts the identifier of the given object, returning an error if no identifier field is found or singleObjectOperation is true and an identifier field is found, but empty.
IgnoreNotFound is a helper to handle ErrNotFound differently than other errors with less code.
NewAPI creates a new API client which implements the API interface.
NewHTTPError creates a new HTTPError instance with the given values, which is mostly useful for mock-testing.
ObjectChannel configures the List operation to return the objects via the given channel.
Paged is an option valid for List operations to retrieve objects in a paged fashion (instead of all at once).
WithClientOptions configures the API to pass the given client.Option to the client when creating it.
WithLogger configures the API to use the given logger.
WithRequestOptions configures default options applied to requests.

# Constants

ListChannelDefaultPageSize specifies the default page size for List operations returning the data via channel.

# Variables

ErrAccessDenied is returned when the used authentication credential is not authorized to do the requested operation.
ErrCannotListChannelAndPaged is returned when the user List()ing with the AsObjectChannel() and Paged() options set and didn't gave nil for Paged() PageInfo output argument.
ErrContextRequired is returned when a nil context was passed as argument.
ErrNotFound is returned when the given identified object does not exist in the engine.
ErrObjectIdentifierTypeNotSupported is a specialized ErrTypeNotSupport for Objects having a field tagged with `anxcloud:"identifier"` with an unsupported type.
ErrObjectWithMultipleIdentifier is a specialized ErrTypeNotSupport for Objects having multiple fields tagged with `anxcloud:"identifier"`.
ErrObjectWithoutIdentifier is a specialized ErrTypeNotSupport for Objects not having a fields tagged with `anxcloud:"identifier"`.
ErrOperationNotSupported is returned when requesting an operation on a resource it does not support.
ErrPageResponseNotSupported is returned when trying to parse a paged response and the format of the response body is not (yet) supported.
ErrTypeNotSupported is returned when an argument is of type interface{}, manual type checking via reflection is done and the given arguments type cannot be used.
ErrUnidentifiedObject is returned when an IdentifiedObject was required, but the passed object didn't have the identifying attribute set.
ErrUnsupportedResponseFormat is set when the engine responds in a format we don't understand, for example unknown Content-Types.

# Structs

EngineError is the base type for all errors returned by the engine.
ErrTaggingFailed is returned when resource tagging failed.
HTTPError is an not-specially-implemented EngineError for a given status code.

# Type aliases

API is the interface to perform operations on the engine.
CreateOption is the interface options have to implement to be usable with Create operation.
DestroyOption is the interface options have to implement to be usable with Destroy operation.
GetOption is the interface options have to implement to be usable with Get operation.
ListOption is the interface options have to implement to be usable with List operation.
NewAPIOption is the type for giving options to the NewAPI function.
UpdateOption is the interface options have to implement to be usable with Update operation.