Documentation ¶
Overview ¶
Package resolver contains functions that resolve names and ID strings of autokitteh entities to their concrete SDK types.
Index ¶
- Variables
- type NotFoundError
- type Resolver
- func (r Resolver) BuildID(id string) (b sdktypes.Build, bid sdktypes.BuildID, err error)
- func (r Resolver) ConnectionNameOrID(nameOrID, project string) (c sdktypes.Connection, cid sdktypes.ConnectionID, err error)
- func (r Resolver) DeploymentID(id string) (d sdktypes.Deployment, did sdktypes.DeploymentID, err error)
- func (r Resolver) EnvNameOrID(envNameOrID, projNameOrID string) (sdktypes.Env, sdktypes.EnvID, error)
- func (r Resolver) EventID(id string) (e sdktypes.Event, eid sdktypes.EventID, err error)
- func (r Resolver) IntegrationNameOrID(nameOrID string) (sdktypes.Integration, sdktypes.IntegrationID, error)
- func (r Resolver) ProjectNameOrID(nameOrID string) (sdktypes.Project, sdktypes.ProjectID, error)
- func (r Resolver) SessionID(id string) (s sdktypes.Session, sid sdktypes.SessionID, err error)
- func (r Resolver) TriggerID(id string) (t sdktypes.Trigger, tid sdktypes.TriggerID, err error)
Constants ¶
This section is empty.
Variables ¶
var NotFoundErrorType = new(NotFoundError)
Functions ¶
This section is empty.
Types ¶
type NotFoundError ¶
type NotFoundError struct {
Type, Name string
}
func (NotFoundError) Error ¶
func (e NotFoundError) Error() string
type Resolver ¶
type Resolver struct {
Client sdkservices.Services
}
func (Resolver) BuildID ¶
BuildID returns a build, based on the given ID. It does NOT accept empty input.
Subtle note: the build is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) ConnectionNameOrID ¶
func (r Resolver) ConnectionNameOrID(nameOrID, project string) (c sdktypes.Connection, cid sdktypes.ConnectionID, err error)
ConnectionNameOrID returns a connection, based on the given name or ID. If the input is empty, we return nil but not an error.
Subtle note: the connection is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) DeploymentID ¶
func (r Resolver) DeploymentID(id string) (d sdktypes.Deployment, did sdktypes.DeploymentID, err error)
DeploymentID returns a deployment, based on the given ID. It does NOT accept empty input.
Subtle note: the deployment is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) EnvNameOrID ¶
func (r Resolver) EnvNameOrID(envNameOrID, projNameOrID string) (sdktypes.Env, sdktypes.EnvID, error)
EnvNameOrID returns an environment, based on the given environment and project names or IDs.
- If the input is empty, we return nil but not an error
- If the environment is empty but the project isn't, we try to resolve the environment as the default one for the project
- If the environment is specified as a name, the project is required
- If the environment is specified as a *full* name, the project is optional, but if specified it must concur with the project prefix in the environment name
- If the environment is specified as an ID, the project is optional, but if specified it must concur with the environment's known project
Subtle note: the environment is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) EventID ¶
EventID returns an event, based on the given ID. It does NOT accept empty input.
Subtle note: the event is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) IntegrationNameOrID ¶
func (r Resolver) IntegrationNameOrID(nameOrID string) (sdktypes.Integration, sdktypes.IntegrationID, error)
IntegrationNameOrID returns an integration, based on the given name or ID. If the input is empty, we return nil but not an error.
Subtle note: the integration is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) ProjectNameOrID ¶
ProjectNameOrID returns a project, based on the given name or ID. If the input is empty, we return nil but not an error.
Subtle note: the project is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) SessionID ¶
SessionID returns a session, based on the given ID. If the input is empty, we return nil but not an error.
Subtle note: the session is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).
func (Resolver) TriggerID ¶ added in v0.2.0
TriggerID returns a trigger, based on the given ID. If the input is empty, we return nil but not an error.
Subtle note: the trigger is guaranteed to exist only if the FIRST return value is non-nil. Example: if the input is a valid ID, but it doesn't actually exist, we return (nil, ID, nil).