keptn

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetSLIOptions

type GetSLIOptions struct {
	Project     string
	Stage       string
	Service     string
	SLIFileName string
}

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.

func (*ResourceHelper) UploadResource

func (rc *ResourceHelper) UploadResource(ctx context.Context, contentToUpload []byte, remoteResourceURI string, project string, stage string, service string) error

UploadResource tries to upload a resource.

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

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.

func (*SLIHelper) GetSLIs

func (rc *SLIHelper) GetSLIs(ctx context.Context, options GetSLIOptions) (map[string]string, error)

GetSLIs gets the SLIs stored for the specified project, stage and service. First, the configuration of project-level is retrieved, which is then overridden by configuration on stage level, and then overridden by configuration on service level.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL