Documentation ¶
Index ¶
- type GetSLIOptions
- type ResourceClientInterface
- type ResourceEmptyError
- type ResourceError
- type ResourceHelper
- func (rc *ResourceHelper) GetProjectResource(ctx context.Context, project string, resourceURI string) (string, error)
- func (rc *ResourceHelper) GetResource(ctx context.Context, project string, stage string, service string, ...) (string, error)
- func (rc *ResourceHelper) GetServiceResource(ctx context.Context, project string, stage string, service string, ...) (string, error)
- func (rc *ResourceHelper) GetStageResource(ctx context.Context, project string, stage string, resourceURI string) (string, error)
- func (rc *ResourceHelper) UploadResource(ctx context.Context, contentToUpload []byte, remoteResourceURI string, ...) error
- type ResourceNotFoundError
- type ResourceRetrievalFailedError
- type ResourceUploadFailedError
- type SLI
- type SLIHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetSLIOptions ¶
GetSLIOptions specifies the project, stage, dervice and SLI file name to be fetched
type ResourceClientInterface ¶
type ResourceClientInterface interface { // GetResource tries to find the first instance of a given resource on service, stage or project level. GetResource(ctx context.Context, project string, stage string, service string, resourceURI string) (string, error) // GetProjectResource tries to retrieve a resource on project level. GetProjectResource(ctx context.Context, project string, resourceURI string) (string, error) // GetStageResource tries to retrieve a resource on stage level. GetStageResource(ctx context.Context, project string, stage string, resourceURI string) (string, error) // GetServiceResource tries to retrieve a resource on service level. GetServiceResource(ctx context.Context, project string, stage string, service string, resourceURI string) (string, error) // UploadResource tries to upload a resource. UploadResource(ctx context.Context, contentToUpload []byte, remoteResourceURI string, project string, stage string, service string) error }
ResourceClientInterface defines the methods for interacting with resources of Keptn's configuration service.
type ResourceEmptyError ¶
type ResourceEmptyError ResourceError
ResourceEmptyError represents an error for a resource that was found, but is empty.
func (*ResourceEmptyError) Error ¶
func (e *ResourceEmptyError) Error() string
Error returns a string representation of this error
type ResourceError ¶
type ResourceError struct {
// contains filtered or unexported fields
}
ResourceError represents an error for a resource that was not found.
type ResourceHelper ¶
type ResourceHelper struct {
// contains filtered or unexported fields
}
ResourceHelper is the default implementation for the ResourceClientInterface using a Keptn api.ResourcesV1Interface.
func NewResourceHelper ¶
func NewResourceHelper(client v2.ResourcesInterface) *ResourceHelper
NewResourceHelper creates a new ResourceHelper using a api.ResourcesV1Interface.
func (*ResourceHelper) GetProjectResource ¶
func (rc *ResourceHelper) GetProjectResource(ctx context.Context, project string, resourceURI string) (string, error)
GetProjectResource tries to retrieve a resource on project level.
func (*ResourceHelper) GetResource ¶
func (rc *ResourceHelper) GetResource(ctx context.Context, project string, stage string, service string, resourceURI string) (string, error)
GetResource tries to find the first instance of a given resource on service, stage or project level.
func (*ResourceHelper) GetServiceResource ¶
func (rc *ResourceHelper) GetServiceResource(ctx context.Context, project string, stage string, service string, resourceURI string) (string, error)
GetServiceResource tries to retrieve a resource on service level.
func (*ResourceHelper) GetStageResource ¶
func (rc *ResourceHelper) GetStageResource(ctx context.Context, project string, stage string, resourceURI string) (string, error)
GetStageResource tries to retrieve a resource on stage level.
type ResourceNotFoundError ¶
type ResourceNotFoundError ResourceError
ResourceNotFoundError represents an error for a resource that was not found.
func (*ResourceNotFoundError) Error ¶
func (e *ResourceNotFoundError) Error() string
Error returns a string representation of this error
type ResourceRetrievalFailedError ¶
type ResourceRetrievalFailedError struct { ResourceError // contains filtered or unexported fields }
ResourceRetrievalFailedError represents an error for a resource that could not be retrieved because of an error.
func (*ResourceRetrievalFailedError) Error ¶
func (e *ResourceRetrievalFailedError) Error() string
Error returns a string representation of this error.
func (*ResourceRetrievalFailedError) Unwrap ¶
func (e *ResourceRetrievalFailedError) Unwrap() error
Unwrap returns the cause of the ResourceRetrievalFailedError.
type ResourceUploadFailedError ¶
type ResourceUploadFailedError struct { ResourceError // contains filtered or unexported fields }
ResourceUploadFailedError represents an error for a resource that could not be uploaded.
func (*ResourceUploadFailedError) Error ¶
func (e *ResourceUploadFailedError) Error() string
Error returns a string representation of this error.
type SLI ¶
type SLI struct { SpecVersion string `yaml:"spec_version"` Indicators map[string]string `yaml:"indicators"` }
SLI struct for SLI.yaml
type SLIHelper ¶
type SLIHelper struct {
// contains filtered or unexported fields
}
SLIHelper is the default implementation of SLIReader used for retrieving SLI content
func NewSLIHelper ¶
func NewSLIHelper(client ResourceClientInterface) *SLIHelper
NewSLIHelper creates a new SLIHelper with a Keptn resource handler for the configuration service.