Documentation ¶
Index ¶
- Constants
- Variables
- func HealthEndpointHandler(w http.ResponseWriter, r *http.Request)
- func RunHealthEndpoint(port string)
- func SortByTime(events []*models.KeptnContextExtendedCE)
- func WithAuthToken(authToken string, authHeader ...string) func(*APISet)
- func WithHTTPClient(client *http.Client) func(*APISet)
- func WithScheme(scheme string) func(*APISet)
- type APICreateProjectOptions
- type APICreateServiceOptions
- type APIDeleteProjectOptions
- type APIDeleteServiceOptions
- type APIGetMetadataOptions
- type APIHandler
- func (a *APIHandler) CreateProject(ctx context.Context, project models.CreateProject, ...) (string, *models.Error)
- func (a *APIHandler) CreateService(ctx context.Context, project string, service models.CreateService, ...) (string, *models.Error)
- func (a *APIHandler) DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error)
- func (a *APIHandler) DeleteService(ctx context.Context, project, service string, opts APIDeleteServiceOptions) (*models.DeleteServiceResponse, *models.Error)
- func (a *APIHandler) GetMetadata(ctx context.Context, opts APIGetMetadataOptions) (*models.Metadata, *models.Error)
- func (a *APIHandler) SendEvent(ctx context.Context, event models.KeptnContextExtendedCE, ...) (*models.EventContext, *models.Error)
- func (a *APIHandler) TriggerEvaluation(ctx context.Context, project, stage, service string, ...) (*models.EventContext, *models.Error)
- func (a *APIHandler) UpdateProject(ctx context.Context, project models.CreateProject, ...) (string, *models.Error)
- type APIInterface
- type APISendEventOptions
- type APIService
- type APISet
- func (c *APISet) API() APIInterface
- func (c *APISet) Auth() AuthInterface
- func (c *APISet) Endpoint() *url.URL
- func (c *APISet) Events() EventsInterface
- func (c *APISet) Logs() LogsInterface
- func (c *APISet) Projects() ProjectsInterface
- func (c *APISet) Resources() ResourcesInterface
- func (c *APISet) Secrets() SecretsInterface
- func (c *APISet) Sequences() SequencesInterface
- func (c *APISet) Services() ServicesInterface
- func (c *APISet) ShipyardControl() ShipyardControlInterface
- func (c *APISet) Stages() StagesInterface
- func (c *APISet) Token() string
- func (c *APISet) Uniform() UniformInterface
- type APITriggerEvaluationOptions
- type APIUpdateProjectOptions
- type AuthAuthenticateOptions
- type AuthHandler
- type AuthInterface
- type ConfigurableSleeper
- type EventFilter
- type EventHandler
- func (e *EventHandler) GetEvents(ctx context.Context, filter *EventFilter, opts EventsGetEventsOptions) ([]*models.KeptnContextExtendedCE, *models.Error)
- func (e *EventHandler) GetEventsWithRetry(ctx context.Context, filter *EventFilter, maxRetries int, ...) ([]*models.KeptnContextExtendedCE, error)
- type EventHandlerInterface
- type EventManipulatorFunc
- type EventWatcher
- type EventWatcherOption
- type EventsGetEventsOptions
- type EventsGetEventsWithRetryOptions
- type EventsInterface
- type FakeSleeper
- type InClusterAPIMappings
- type InternalAPIHandler
- func (i *InternalAPIHandler) CreateProject(ctx context.Context, project models.CreateProject, ...) (string, *models.Error)
- func (i *InternalAPIHandler) CreateService(ctx context.Context, project string, service models.CreateService, ...) (string, *models.Error)
- func (i *InternalAPIHandler) DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error)
- func (i *InternalAPIHandler) DeleteService(ctx context.Context, project string, service string, ...) (*models.DeleteServiceResponse, *models.Error)
- func (i *InternalAPIHandler) GetMetadata(_ context.Context, _ APIGetMetadataOptions) (*models.Metadata, *models.Error)
- func (i *InternalAPIHandler) SendEvent(_ context.Context, event models.KeptnContextExtendedCE, _ APISendEventOptions) (*models.EventContext, *models.Error)
- func (i *InternalAPIHandler) TriggerEvaluation(ctx context.Context, project string, stage string, service string, ...) (*models.EventContext, *models.Error)
- func (i *InternalAPIHandler) UpdateProject(ctx context.Context, project models.CreateProject, ...) (string, *models.Error)
- type InternalAPISet
- func (c *InternalAPISet) API() APIInterface
- func (c *InternalAPISet) Auth() AuthInterface
- func (c *InternalAPISet) Events() EventsInterface
- func (c *InternalAPISet) Logs() LogsInterface
- func (c *InternalAPISet) Projects() ProjectsInterface
- func (c *InternalAPISet) Resources() ResourcesInterface
- func (c *InternalAPISet) Secrets() SecretsInterface
- func (c *InternalAPISet) Sequences() SequencesInterface
- func (c *InternalAPISet) Services() ServicesInterface
- func (c *InternalAPISet) ShipyardControl() ShipyardControlInterface
- func (c *InternalAPISet) Stages() StagesInterface
- func (c *InternalAPISet) Uniform() UniformInterface
- type InternalService
- type KeptnInterface
- type LogHandler
- func (lh *LogHandler) DeleteLogs(ctx context.Context, params models.LogFilter, opts LogsDeleteLogsOptions) error
- func (lh *LogHandler) Flush(ctx context.Context, opts LogsFlushOptions) error
- func (lh *LogHandler) GetLogs(ctx context.Context, params models.GetLogsParams, opts LogsGetLogsOptions) (*models.GetLogsResponse, error)
- func (lh *LogHandler) Log(logs []models.LogEntry, opts LogsLogOptions)
- func (lh *LogHandler) Start(ctx context.Context, opts LogsStartOptions)
- type LogsDeleteLogsOptions
- type LogsFlushOptions
- type LogsGetLogsOptions
- type LogsInterface
- type LogsLogOptions
- type LogsStartOptions
- type ProjectHandler
- func (p *ProjectHandler) CreateProject(ctx context.Context, project models.Project, opts ProjectsCreateProjectOptions) (*models.EventContext, *models.Error)
- func (p *ProjectHandler) DeleteProject(ctx context.Context, project models.Project, opts ProjectsDeleteProjectOptions) (*models.EventContext, *models.Error)
- func (p *ProjectHandler) GetAllProjects(ctx context.Context, opts ProjectsGetAllProjectsOptions) ([]*models.Project, error)
- func (p *ProjectHandler) GetProject(ctx context.Context, project models.Project, opts ProjectsGetProjectOptions) (*models.Project, *models.Error)
- func (p *ProjectHandler) UpdateConfigurationServiceProject(ctx context.Context, project models.Project, ...) (*models.EventContext, *models.Error)
- type ProjectsCreateProjectOptions
- type ProjectsDeleteProjectOptions
- type ProjectsGetAllProjectsOptions
- type ProjectsGetProjectOptions
- type ProjectsInterface
- type ProjectsUpdateConfigurationServiceProjectOptions
- type ResourceHandler
- func (r *ResourceHandler) CreateProjectResources(ctx context.Context, project string, resources []*models.Resource, ...) (string, error)
- func (r *ResourceHandler) CreateResource(ctx context.Context, resource []*models.Resource, scope ResourceScope, ...) (string, error)
- func (r *ResourceHandler) CreateResources(ctx context.Context, project string, stage string, service string, ...) (*models.EventContext, *models.Error)
- func (r *ResourceHandler) CreateResourcesByURI(ctx context.Context, uri string, resources []*models.Resource) (string, error)
- func (r *ResourceHandler) DeleteResource(ctx context.Context, scope ResourceScope, opts ResourcesDeleteResourceOptions) error
- func (r *ResourceHandler) DeleteResourceByURI(ctx context.Context, uri string) error
- func (r *ResourceHandler) GetAllServiceResources(ctx context.Context, project string, stage string, service string, ...) ([]*models.Resource, error)
- func (r *ResourceHandler) GetAllStageResources(ctx context.Context, project string, stage string, ...) ([]*models.Resource, error)
- func (r *ResourceHandler) GetResource(ctx context.Context, scope ResourceScope, opts ResourcesGetResourceOptions) (*models.Resource, error)
- func (r *ResourceHandler) GetResourceByURI(ctx context.Context, uri string) (*models.Resource, error)
- func (r *ResourceHandler) UpdateProjectResources(ctx context.Context, project string, resources []*models.Resource, ...) (string, error)
- func (r *ResourceHandler) UpdateResource(ctx context.Context, resource *models.Resource, scope ResourceScope, ...) (string, error)
- func (r *ResourceHandler) UpdateResourceByURI(ctx context.Context, uri string, resource *models.Resource) (string, error)
- func (r *ResourceHandler) UpdateResourcesByURI(ctx context.Context, uri string, resources []*models.Resource) (string, error)
- func (r *ResourceHandler) UpdateServiceResources(ctx context.Context, project string, stage string, service string, ...) (string, error)
- type ResourceScope
- func (s *ResourceScope) GetProjectPath() string
- func (s *ResourceScope) GetResourcePath() string
- func (s *ResourceScope) GetServicePath() string
- func (s *ResourceScope) GetStagePath() string
- func (s *ResourceScope) Project(project string) *ResourceScope
- func (s *ResourceScope) Resource(resource string) *ResourceScope
- func (s *ResourceScope) Service(service string) *ResourceScope
- func (s *ResourceScope) Stage(stage string) *ResourceScope
- type ResourcesCreateProjectResourcesOptions
- type ResourcesCreateResourceOptions
- type ResourcesCreateResourcesOptions
- type ResourcesDeleteResourceOptions
- type ResourcesGetAllServiceResourcesOptions
- type ResourcesGetAllStageResourcesOptions
- type ResourcesGetResourceOptions
- type ResourcesInterface
- type ResourcesUpdateProjectResourcesOptions
- type ResourcesUpdateResourceOptions
- type ResourcesUpdateServiceResourcesOptions
- type SecretHandler
- func (s *SecretHandler) CreateSecret(ctx context.Context, secret models.Secret, opts SecretsCreateSecretOptions) error
- func (s *SecretHandler) DeleteSecret(ctx context.Context, secretName, secretScope string, ...) error
- func (s *SecretHandler) GetSecrets(ctx context.Context, opts SecretsGetSecretsOptions) (*models.GetSecretsResponse, error)
- func (s *SecretHandler) UpdateSecret(ctx context.Context, secret models.Secret, opts SecretsUpdateSecretOptions) error
- type SecretsCreateSecretOptions
- type SecretsDeleteSecretOptions
- type SecretsGetSecretsOptions
- type SecretsInterface
- type SecretsUpdateSecretOptions
- type SequenceControlBody
- type SequenceControlHandler
- func NewAuthenticatedSequenceControlHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, ...) *SequenceControlHandler
- func NewSequenceControlHandler(baseURL string) *SequenceControlHandler
- func NewSequenceControlHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *SequenceControlHandler
- type SequenceControlParams
- type SequencesControlSequenceOptions
- type SequencesInterface
- type ServiceHandler
- func (s *ServiceHandler) CreateServiceInStage(ctx context.Context, project string, stage string, serviceName string, ...) (*models.EventContext, *models.Error)
- func (s *ServiceHandler) DeleteServiceFromStage(ctx context.Context, project string, stage string, serviceName string, ...) (*models.EventContext, *models.Error)
- func (s *ServiceHandler) GetAllServices(ctx context.Context, project string, stage string, ...) ([]*models.Service, error)
- func (s *ServiceHandler) GetService(ctx context.Context, project, stage, service string, ...) (*models.Service, error)
- type ServicesCreateServiceInStageOptions
- type ServicesDeleteServiceFromStageOptions
- type ServicesGetAllServicesOptions
- type ServicesGetServiceOptions
- type ServicesInterface
- type ShipyardControlGetOpenTriggeredEventsOptions
- type ShipyardControlInterface
- type ShipyardControllerHandler
- func NewAuthenticatedShipyardControllerHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, ...) *ShipyardControllerHandler
- func NewShipyardControllerHandler(baseURL string) *ShipyardControllerHandler
- func NewShipyardControllerHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *ShipyardControllerHandler
- type Sleeper
- type StageHandler
- type StagesCreateStageOptions
- type StagesGetAllStagesOptions
- type StagesInterface
- type StatusBody
- type URIOption
- type UniformCreateSubscriptionOptions
- type UniformGetRegistrationsOptions
- type UniformHandler
- func (u *UniformHandler) CreateSubscription(ctx context.Context, integrationID string, ...) (string, error)
- func (u *UniformHandler) GetRegistrations(ctx context.Context, opts UniformGetRegistrationsOptions) ([]*models.Integration, error)
- func (u *UniformHandler) Ping(ctx context.Context, integrationID string, opts UniformPingOptions) (*models.Integration, error)
- func (u *UniformHandler) RegisterIntegration(ctx context.Context, integration models.Integration, ...) (string, error)
- func (u *UniformHandler) UnregisterIntegration(ctx context.Context, integrationID string, ...) error
- type UniformInterface
- type UniformPingOptions
- type UniformRegisterIntegrationOptions
- type UniformUnregisterIntegrationOptions
Constants ¶
const ErrWithStatusCode = "error with status code %d"
ErrWithStatusCode message
Variables ¶
var DefaultInClusterAPIMappings = InClusterAPIMappings{ ConfigurationService: "resource-service:8080", ShipyardController: "shipyard-controller:8080", ApiService: "api-service:8080", SecretService: "secret-service:8080", MongoDBDatastore: "mongodb-datastore:8080", }
DefaultInClusterAPIMappings gives you the default InClusterAPIMappings
var ResourceNotFoundError = errors.New("Resource not found")
Functions ¶
func HealthEndpointHandler ¶
func HealthEndpointHandler(w http.ResponseWriter, r *http.Request)
func RunHealthEndpoint ¶
func RunHealthEndpoint(port string)
func SortByTime ¶
func SortByTime(events []*models.KeptnContextExtendedCE)
SortByTime sorts the event slice by time (oldest to newest)
func WithAuthToken ¶
WithAuthToken sets the given auth token. Optionally a custom auth header can be set (default x-token)
func WithHTTPClient ¶
WithHTTPClient configures a custom http client to use
func WithScheme ¶
WithScheme sets the scheme If this option is not used, then default scheme "http" is used by the APISet
Types ¶
type APICreateProjectOptions ¶
type APICreateProjectOptions struct{}
APICreateProjectOptions are options for APIInterface.CreateProject().
type APICreateServiceOptions ¶
type APICreateServiceOptions struct{}
APICreateServiceOptions are options for APIInterface.CreateService().
type APIDeleteProjectOptions ¶
type APIDeleteProjectOptions struct{}
APIDeleteProjectOptions are options for APIInterface.DeleteProject().
type APIDeleteServiceOptions ¶
type APIDeleteServiceOptions struct{}
APIDeleteServiceOptions are options for APIInterface.DeleteService().
type APIGetMetadataOptions ¶
type APIGetMetadataOptions struct{}
APIGetMetadataOptions are options for APIInterface.GetMetadata().
type APIHandler ¶
type APIHandler struct {
// contains filtered or unexported fields
}
func NewAPIHandler ¶
func NewAPIHandler(baseURL string) *APIHandler
NewAPIHandler returns a new APIHandler
func NewAPIHandlerWithHTTPClient ¶
func NewAPIHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *APIHandler
NewAPIHandlerWithHTTPClient returns a new APIHandler using the specified http.Client
func NewAuthenticatedAPIHandler ¶
func NewAuthenticatedAPIHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *APIHandler
NewAuthenticatedAPIHandler returns a new APIHandler that authenticates at the api-service endpoint via the provided token
func (*APIHandler) CreateProject ¶
func (a *APIHandler) CreateProject(ctx context.Context, project models.CreateProject, opts APICreateProjectOptions) (string, *models.Error)
CreateProject creates a new project.
func (*APIHandler) CreateService ¶
func (a *APIHandler) CreateService(ctx context.Context, project string, service models.CreateService, opts APICreateServiceOptions) (string, *models.Error)
CreateService creates a new service.
func (*APIHandler) DeleteProject ¶
func (a *APIHandler) DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error)
DeleteProject deletes a project.
func (*APIHandler) DeleteService ¶
func (a *APIHandler) DeleteService(ctx context.Context, project, service string, opts APIDeleteServiceOptions) (*models.DeleteServiceResponse, *models.Error)
DeleteService deletes a service.
func (*APIHandler) GetMetadata ¶
func (a *APIHandler) GetMetadata(ctx context.Context, opts APIGetMetadataOptions) (*models.Metadata, *models.Error)
GetMetadata retrieves Keptn metadata information.
func (*APIHandler) SendEvent ¶
func (a *APIHandler) SendEvent(ctx context.Context, event models.KeptnContextExtendedCE, opts APISendEventOptions) (*models.EventContext, *models.Error)
SendEvent sends an event to Keptn.
func (*APIHandler) TriggerEvaluation ¶
func (a *APIHandler) TriggerEvaluation(ctx context.Context, project, stage, service string, evaluation models.Evaluation, opts APITriggerEvaluationOptions) (*models.EventContext, *models.Error)
TriggerEvaluation triggers a new evaluation.
func (*APIHandler) UpdateProject ¶
func (a *APIHandler) UpdateProject(ctx context.Context, project models.CreateProject, opts APIUpdateProjectOptions) (string, *models.Error)
UpdateProject updates a project.
type APIInterface ¶
type APIInterface interface { // SendEvent sends an event to Keptn. SendEvent(ctx context.Context, event models.KeptnContextExtendedCE, opts APISendEventOptions) (*models.EventContext, *models.Error) // TriggerEvaluation triggers a new evaluation. TriggerEvaluation(ctx context.Context, project string, stage string, service string, evaluation models.Evaluation, opts APITriggerEvaluationOptions) (*models.EventContext, *models.Error) // CreateProject creates a new project. CreateProject(ctx context.Context, project models.CreateProject, opts APICreateProjectOptions) (string, *models.Error) // UpdateProject updates a project. UpdateProject(ctx context.Context, project models.CreateProject, opts APIUpdateProjectOptions) (string, *models.Error) // DeleteProject deletes a project. DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error) // CreateService creates a new service. CreateService(ctx context.Context, project string, service models.CreateService, opts APICreateServiceOptions) (string, *models.Error) // DeleteService deletes a service. DeleteService(ctx context.Context, project string, service string, opts APIDeleteServiceOptions) (*models.DeleteServiceResponse, *models.Error) // GetMetadata retrieves Keptn metadata information. GetMetadata(ctx context.Context, opts APIGetMetadataOptions) (*models.Metadata, *models.Error) }
type APISendEventOptions ¶
type APISendEventOptions struct{}
APISendEventOptions are options for APIInterface.SendEvent().
type APIService ¶
type APIService interface {
// contains filtered or unexported methods
}
APIService represents the interface for accessing the configuration service
type APISet ¶
type APISet struct {
// contains filtered or unexported fields
}
APISet contains the API utils for all Keptn APIs
func (*APISet) Projects ¶
func (c *APISet) Projects() ProjectsInterface
Projects retrieves the ProjectHandler
func (*APISet) Resources ¶
func (c *APISet) Resources() ResourcesInterface
Resources retrieves the ResourceHandler
func (*APISet) Secrets ¶
func (c *APISet) Secrets() SecretsInterface
Secrets retrieves the SecretHandler
func (*APISet) Sequences ¶
func (c *APISet) Sequences() SequencesInterface
Sequences retrieves the SequenceControlHandler
func (*APISet) Services ¶
func (c *APISet) Services() ServicesInterface
Services retrieves the ServiceHandler
func (*APISet) ShipyardControl ¶
func (c *APISet) ShipyardControl() ShipyardControlInterface
ShipyardControl retrieves the ShipyardControllerHandler
func (*APISet) Uniform ¶
func (c *APISet) Uniform() UniformInterface
Uniform retrieves the UniformHandler
type APITriggerEvaluationOptions ¶
type APITriggerEvaluationOptions struct{}
APITriggerEvaluationOptions are options for APIInterface.TriggerEvaluation().
type APIUpdateProjectOptions ¶
type APIUpdateProjectOptions struct{}
APIUpdateProjectOptions are options for APIInterface.UpdateProject().
type AuthAuthenticateOptions ¶
type AuthAuthenticateOptions struct{}
AuthAuthenticateOptions are options for AuthInterface.Authenticate().
type AuthHandler ¶
type AuthHandler struct {
// contains filtered or unexported fields
}
func NewAuthHandler ¶
func NewAuthHandler(baseURL string) *AuthHandler
NewAuthHandler returns a new AuthHandler
func NewAuthHandlerWithHTTPClient ¶
func NewAuthHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *AuthHandler
NewAuthHandlerWithHTTPClient returns a new AuthHandler using the specified http.Client
func NewAuthenticatedAuthHandler ¶
func NewAuthenticatedAuthHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *AuthHandler
NewAuthenticatedAuthHandler returns a new AuthHandler that authenticates at the endpoint via the provided token
func (*AuthHandler) Authenticate ¶
func (a *AuthHandler) Authenticate(ctx context.Context, opts AuthAuthenticateOptions) (*models.EventContext, *models.Error)
Authenticate authenticates the client request against the server.
type AuthInterface ¶
type AuthInterface interface { // Authenticate authenticates the client request against the server. Authenticate(ctx context.Context, opts AuthAuthenticateOptions) (*models.EventContext, *models.Error) }
type ConfigurableSleeper ¶
type ConfigurableSleeper struct {
// contains filtered or unexported fields
}
ConfigurableSleeper is an implementation of a sleeper that can be configured to sleep for a specific duration
func NewConfigurableSleeper ¶
func NewConfigurableSleeper(duration time.Duration) *ConfigurableSleeper
NewConfigurableSleeper creates a new instance of a configurable sleeper which will pause execution of the current thread for a given duration
func (*ConfigurableSleeper) Sleep ¶
func (c *ConfigurableSleeper) Sleep()
Sleep pauses the execution
type EventFilter ¶
type EventFilter struct { Project string Stage string Service string EventType string KeptnContext string EventID string PageSize string NumberOfPages int FromTime string }
EventFilter allows to filter events based on the provided properties
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func NewAuthenticatedEventHandler ¶
func NewAuthenticatedEventHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *EventHandler
NewAuthenticatedEventHandler returns a new EventHandler that authenticates at the endpoint via the provided token
func NewEventHandler ¶
func NewEventHandler(baseURL string) *EventHandler
NewEventHandler returns a new EventHandler
func NewEventHandlerWithHTTPClient ¶
func NewEventHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *EventHandler
NewEventHandlerWithHTTPClient returns a new EventHandler using the specified http.Client
func (*EventHandler) GetEvents ¶
func (e *EventHandler) GetEvents(ctx context.Context, filter *EventFilter, opts EventsGetEventsOptions) ([]*models.KeptnContextExtendedCE, *models.Error)
GetEvents returns all events matching the properties in the passed filter object.
func (*EventHandler) GetEventsWithRetry ¶
func (e *EventHandler) GetEventsWithRetry(ctx context.Context, filter *EventFilter, maxRetries int, retrySleepTime time.Duration, opts EventsGetEventsWithRetryOptions) ([]*models.KeptnContextExtendedCE, error)
GetEventsWithRetry tries to retrieve events matching the passed filter.
type EventHandlerInterface ¶
type EventHandlerInterface interface { GetEventsWithRetry(filter *EventFilter, maxRetries int, retrySleepTime time.Duration) ([]*models.KeptnContextExtendedCE, error) GetEvents(filter *EventFilter) ([]*models.KeptnContextExtendedCE, *models.Error) }
EventHandlerInterface is the api to fetch events from the event store
type EventManipulatorFunc ¶
type EventManipulatorFunc func([]*models.KeptnContextExtendedCE)
EventManipulatorFunc can be used to manipulate a slice of events
type EventWatcher ¶
type EventWatcher struct {
// contains filtered or unexported fields
}
EventWatcher implements the logic to query for events and provide them to the client
func NewEventWatcher ¶
func NewEventWatcher(eventHandler EventHandlerInterface, opts ...EventWatcherOption) *EventWatcher
NewEventWatcher creates a new event watcher with the given options
func (*EventWatcher) Watch ¶
func (ew *EventWatcher) Watch(ctx context.Context) (<-chan []*models.KeptnContextExtendedCE, context.CancelFunc)
Watch starts the watch loop and returns a channel to get the actual events as well as a context.CancelFunc in order to stop the watch routine
type EventWatcherOption ¶
type EventWatcherOption func(*EventWatcher)
EventWatcherOption can be used to configure the EventWatcher
func WithEventFilter ¶
func WithEventFilter(filter EventFilter) EventWatcherOption
WithEventFilter configures the EventWatcher to use a filter
func WithInterval ¶
func WithInterval(ticker *time.Ticker) EventWatcherOption
WithInterval configures the EventWatcher to use a custom delay between each query You can use this to overwrite the default which is 10 * time.Second
func WithStartTime ¶
func WithStartTime(startTime time.Time) EventWatcherOption
WithStartTime configures the EventWatcher to use a specific start timestamp for the first query
func WithTimeout ¶
func WithTimeout(duration time.Duration) EventWatcherOption
WithTimeout configures the EventWatcher to use a custom timeout specifying after which duration the watcher shall stop
type EventsGetEventsOptions ¶
type EventsGetEventsOptions struct{}
EventsGetEventsOptions are options for EventsInterface.GetEvents().
type EventsGetEventsWithRetryOptions ¶
type EventsGetEventsWithRetryOptions struct{}
EventsGetEventsWithRetryOptions are options for EventsInterface.GetEventsWithRetry().
type EventsInterface ¶
type EventsInterface interface { // GetEvents returns all events matching the properties in the passed filter object. GetEvents(ctx context.Context, filter *EventFilter, opts EventsGetEventsOptions) ([]*models.KeptnContextExtendedCE, *models.Error) // GetEventsWithRetry tries to retrieve events matching the passed filter. GetEventsWithRetry(ctx context.Context, filter *EventFilter, maxRetries int, retrySleepTime time.Duration, opts EventsGetEventsWithRetryOptions) ([]*models.KeptnContextExtendedCE, error) }
type FakeSleeper ¶
type FakeSleeper struct { }
FakeSleeper is a sleeper that does not sleep
func NewFakeSleeper ¶
func NewFakeSleeper() *FakeSleeper
NewFakeSleeper creates a new instance of a FakeSleeper
type InClusterAPIMappings ¶
type InClusterAPIMappings map[InternalService]string
InClusterAPIMappings maps a keptn service name to its reachable domain name
type InternalAPIHandler ¶
type InternalAPIHandler struct {
// contains filtered or unexported fields
}
InternalAPIHandler is used instead of APIHandler from go-utils because we cannot support (unauthenticated) internal calls to the api-service at the moment. So this implementation will panic as soon as a client wants to call these methods
func (*InternalAPIHandler) CreateProject ¶
func (i *InternalAPIHandler) CreateProject(ctx context.Context, project models.CreateProject, opts APICreateProjectOptions) (string, *models.Error)
func (*InternalAPIHandler) CreateService ¶
func (i *InternalAPIHandler) CreateService(ctx context.Context, project string, service models.CreateService, opts APICreateServiceOptions) (string, *models.Error)
func (*InternalAPIHandler) DeleteProject ¶
func (i *InternalAPIHandler) DeleteProject(ctx context.Context, project models.Project, opts APIDeleteProjectOptions) (*models.DeleteProjectResponse, *models.Error)
func (*InternalAPIHandler) DeleteService ¶
func (i *InternalAPIHandler) DeleteService(ctx context.Context, project string, service string, opts APIDeleteServiceOptions) (*models.DeleteServiceResponse, *models.Error)
func (*InternalAPIHandler) GetMetadata ¶
func (i *InternalAPIHandler) GetMetadata(_ context.Context, _ APIGetMetadataOptions) (*models.Metadata, *models.Error)
func (*InternalAPIHandler) SendEvent ¶
func (i *InternalAPIHandler) SendEvent(_ context.Context, event models.KeptnContextExtendedCE, _ APISendEventOptions) (*models.EventContext, *models.Error)
func (*InternalAPIHandler) TriggerEvaluation ¶
func (i *InternalAPIHandler) TriggerEvaluation(ctx context.Context, project string, stage string, service string, evaluation models.Evaluation, opts APITriggerEvaluationOptions) (*models.EventContext, *models.Error)
func (*InternalAPIHandler) UpdateProject ¶
func (i *InternalAPIHandler) UpdateProject(ctx context.Context, project models.CreateProject, opts APIUpdateProjectOptions) (string, *models.Error)
type InternalAPISet ¶
type InternalAPISet struct {
// contains filtered or unexported fields
}
InternalAPISet is an implementation of KeptnInterface which can be used from within the Keptn control plane
func NewInternal ¶
func NewInternal(client *http.Client, apiMappings ...InClusterAPIMappings) (*InternalAPISet, error)
NewInternal creates a new InternalAPISet usable for calling Keptn services from within the control plane
func (*InternalAPISet) API ¶
func (c *InternalAPISet) API() APIInterface
API retrieves the APIHandler
func (*InternalAPISet) Auth ¶
func (c *InternalAPISet) Auth() AuthInterface
Auth retrieves the AuthHandler
func (*InternalAPISet) Events ¶
func (c *InternalAPISet) Events() EventsInterface
Events retrieves the EventHandler
func (*InternalAPISet) Logs ¶
func (c *InternalAPISet) Logs() LogsInterface
Logs retrieves the LogHandler
func (*InternalAPISet) Projects ¶
func (c *InternalAPISet) Projects() ProjectsInterface
Projects retrieves the ProjectHandler
func (*InternalAPISet) Resources ¶
func (c *InternalAPISet) Resources() ResourcesInterface
Resources retrieves the ResourceHandler
func (*InternalAPISet) Secrets ¶
func (c *InternalAPISet) Secrets() SecretsInterface
Secrets retrieves the SecretHandler
func (*InternalAPISet) Sequences ¶
func (c *InternalAPISet) Sequences() SequencesInterface
Sequences retrieves the SequenceControlHandler
func (*InternalAPISet) Services ¶
func (c *InternalAPISet) Services() ServicesInterface
Services retrieves the ServiceHandler
func (*InternalAPISet) ShipyardControl ¶
func (c *InternalAPISet) ShipyardControl() ShipyardControlInterface
ShipyardControl retrieves the ShipyardControllerHandler
func (*InternalAPISet) Stages ¶
func (c *InternalAPISet) Stages() StagesInterface
Stages retrieves the StageHandler
func (*InternalAPISet) Uniform ¶
func (c *InternalAPISet) Uniform() UniformInterface
Uniform retrieves the UniformHandler
type InternalService ¶
type InternalService int
InternalService is used to enumerate internal Keptn services
const ( ConfigurationService InternalService = iota ShipyardController ApiService SecretService MongoDBDatastore )
type KeptnInterface ¶
type KeptnInterface interface { API() APIInterface Auth() AuthInterface Events() EventsInterface Logs() LogsInterface Projects() ProjectsInterface Resources() ResourcesInterface Secrets() SecretsInterface Sequences() SequencesInterface Services() ServicesInterface Stages() StagesInterface Uniform() UniformInterface ShipyardControl() ShipyardControlInterface }
type LogHandler ¶
type LogHandler struct {
// contains filtered or unexported fields
}
func NewAuthenticatedLogHandler ¶
func NewAuthenticatedLogHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *LogHandler
NewAuthenticatedLogHandler returns a new LogHandler that authenticates at the endpoint via the provided token
func NewLogHandler ¶
func NewLogHandler(baseURL string) *LogHandler
NewLogHandler returns a new LogHandler
func NewLogHandlerWithHTTPClient ¶
func NewLogHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *LogHandler
NewLogHandlerWithHTTPClient returns a new LogHandler that uses the specified http.Client
func (*LogHandler) DeleteLogs ¶
func (lh *LogHandler) DeleteLogs(ctx context.Context, params models.LogFilter, opts LogsDeleteLogsOptions) error
DeleteLogs deletes logs matching the specified log filter.
func (*LogHandler) Flush ¶
func (lh *LogHandler) Flush(ctx context.Context, opts LogsFlushOptions) error
Flush flushes the log cache.
func (*LogHandler) GetLogs ¶
func (lh *LogHandler) GetLogs(ctx context.Context, params models.GetLogsParams, opts LogsGetLogsOptions) (*models.GetLogsResponse, error)
GetLogs gets logs with the specified parameters.
func (*LogHandler) Log ¶
func (lh *LogHandler) Log(logs []models.LogEntry, opts LogsLogOptions)
Log appends the specified logs to the log cache.
func (*LogHandler) Start ¶
func (lh *LogHandler) Start(ctx context.Context, opts LogsStartOptions)
type LogsDeleteLogsOptions ¶
type LogsDeleteLogsOptions struct{}
LogsDeleteLogsOptions are options for LogsInterface.DeleteLogs().
type LogsFlushOptions ¶
type LogsFlushOptions struct{}
LogsFlushOptions are options for LogsInterface.Flush().
type LogsGetLogsOptions ¶
type LogsGetLogsOptions struct{}
LogsGetLogsOptions are options for LogsInterface.GetLogs().
type LogsInterface ¶
type LogsInterface interface { // Log appends the specified logs to the log cache. Log(logs []models.LogEntry, opts LogsLogOptions) // Flush flushes the log cache. Flush(ctx context.Context, opts LogsFlushOptions) error // GetLogs gets logs with the specified parameters. GetLogs(ctx context.Context, params models.GetLogsParams, opts LogsGetLogsOptions) (*models.GetLogsResponse, error) // DeleteLogs deletes logs matching the specified log filter. DeleteLogs(ctx context.Context, filter models.LogFilter, opts LogsDeleteLogsOptions) error Start(ctx context.Context, opts LogsStartOptions) }
type LogsLogOptions ¶
type LogsLogOptions struct{}
LogsLogOptions are options for LogsInterface.Log().
type LogsStartOptions ¶
type LogsStartOptions struct{}
LogsStartOptions are options for LogsInterface.Start().
type ProjectHandler ¶
type ProjectHandler struct {
// contains filtered or unexported fields
}
ProjectHandler handles projects
func NewAuthenticatedProjectHandler ¶
func NewAuthenticatedProjectHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ProjectHandler
NewAuthenticatedProjectHandler returns a new ProjectHandler that authenticates at the api via the provided token and sends all requests directly to the resource-service
func NewProjectHandler ¶
func NewProjectHandler(baseURL string) *ProjectHandler
NewProjectHandler returns a new ProjectHandler which sends all requests directly to the resource-service
func NewProjectHandlerWithHTTPClient ¶
func NewProjectHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *ProjectHandler
NewProjectHandlerWithHTTPClient returns a new ProjectHandler which sends all requests directly to the resource-service using the specified http.Client
func (*ProjectHandler) CreateProject ¶
func (p *ProjectHandler) CreateProject(ctx context.Context, project models.Project, opts ProjectsCreateProjectOptions) (*models.EventContext, *models.Error)
CreateProject creates a new project.
func (*ProjectHandler) DeleteProject ¶
func (p *ProjectHandler) DeleteProject(ctx context.Context, project models.Project, opts ProjectsDeleteProjectOptions) (*models.EventContext, *models.Error)
DeleteProject deletes a project.
func (*ProjectHandler) GetAllProjects ¶
func (p *ProjectHandler) GetAllProjects(ctx context.Context, opts ProjectsGetAllProjectsOptions) ([]*models.Project, error)
GetAllProjects returns all projects.
func (*ProjectHandler) GetProject ¶
func (p *ProjectHandler) GetProject(ctx context.Context, project models.Project, opts ProjectsGetProjectOptions) (*models.Project, *models.Error)
GetProject returns a project.
func (*ProjectHandler) UpdateConfigurationServiceProject ¶
func (p *ProjectHandler) UpdateConfigurationServiceProject(ctx context.Context, project models.Project, opts ProjectsUpdateConfigurationServiceProjectOptions) (*models.EventContext, *models.Error)
UpdateConfigurationServiceProject updates a configuration service project.
type ProjectsCreateProjectOptions ¶
type ProjectsCreateProjectOptions struct{}
ProjectsCreateProjectOptions are options for ProjectsInterface.CreateProject().
type ProjectsDeleteProjectOptions ¶
type ProjectsDeleteProjectOptions struct{}
ProjectsDeleteProjectOptions are options for ProjectsInterface.DeleteProject().
type ProjectsGetAllProjectsOptions ¶
type ProjectsGetAllProjectsOptions struct{}
ProjectsGetAllProjectsOptions are options for ProjectsInterface.GetAllProjects().
type ProjectsGetProjectOptions ¶
type ProjectsGetProjectOptions struct{}
ProjectsGetProjectOptions are options for ProjectsInterface.GetProject().
type ProjectsInterface ¶
type ProjectsInterface interface { // CreateProject creates a new project. CreateProject(ctx context.Context, project models.Project, opts ProjectsCreateProjectOptions) (*models.EventContext, *models.Error) // DeleteProject deletes a project. DeleteProject(ctx context.Context, project models.Project, opts ProjectsDeleteProjectOptions) (*models.EventContext, *models.Error) // GetProject returns a project. GetProject(ctx context.Context, project models.Project, opts ProjectsGetProjectOptions) (*models.Project, *models.Error) // GetAllProjects returns all projects. GetAllProjects(ctx context.Context, opts ProjectsGetAllProjectsOptions) ([]*models.Project, error) // UpdateConfigurationServiceProject updates a configuration service project. UpdateConfigurationServiceProject(ctx context.Context, project models.Project, opts ProjectsUpdateConfigurationServiceProjectOptions) (*models.EventContext, *models.Error) }
type ProjectsUpdateConfigurationServiceProjectOptions ¶
type ProjectsUpdateConfigurationServiceProjectOptions struct{}
ProjectsUpdateConfigurationServiceProjectOptions are options for ProjectsInterface.UpdateConfigurationServiceProject().
type ResourceHandler ¶
type ResourceHandler struct {
// contains filtered or unexported fields
}
ResourceHandler handles resources
func NewAuthenticatedResourceHandler ¶
func NewAuthenticatedResourceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ResourceHandler
NewAuthenticatedResourceHandler returns a new ResourceHandler that authenticates at the api via the provided token and sends all requests directly to the resource-service
func NewResourceHandler ¶
func NewResourceHandler(baseURL string) *ResourceHandler
NewResourceHandler returns a new ResourceHandler which sends all requests directly to the resource-service
func NewResourceHandlerWithHTTPClient ¶
func NewResourceHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *ResourceHandler
NewResourceHandlerWithHTTPClient returns a new ResourceHandler which sends all requests directly to the resource-service using the specified http.Client
func (*ResourceHandler) CreateProjectResources ¶
func (r *ResourceHandler) CreateProjectResources(ctx context.Context, project string, resources []*models.Resource, opts ResourcesCreateProjectResourcesOptions) (string, error)
CreateProjectResources creates multiple project resources.
func (*ResourceHandler) CreateResource ¶
func (r *ResourceHandler) CreateResource(ctx context.Context, resource []*models.Resource, scope ResourceScope, opts ResourcesCreateResourceOptions) (string, error)
CreateResource creates one or more resources at the URI defined by ResourceScope.
func (*ResourceHandler) CreateResources ¶
func (r *ResourceHandler) CreateResources(ctx context.Context, project string, stage string, service string, resources []*models.Resource, opts ResourcesCreateResourcesOptions) (*models.EventContext, *models.Error)
CreateResources creates a resource for the specified entity.
func (*ResourceHandler) CreateResourcesByURI ¶
func (*ResourceHandler) DeleteResource ¶
func (r *ResourceHandler) DeleteResource(ctx context.Context, scope ResourceScope, opts ResourcesDeleteResourceOptions) error
DeleteResource delete a resource from the URI defined by ResourceScope.
func (*ResourceHandler) DeleteResourceByURI ¶
func (r *ResourceHandler) DeleteResourceByURI(ctx context.Context, uri string) error
func (*ResourceHandler) GetAllServiceResources ¶
func (r *ResourceHandler) GetAllServiceResources(ctx context.Context, project string, stage string, service string, opts ResourcesGetAllServiceResourcesOptions) ([]*models.Resource, error)
GetAllServiceResources returns a list of all resources.
func (*ResourceHandler) GetAllStageResources ¶
func (r *ResourceHandler) GetAllStageResources(ctx context.Context, project string, stage string, opts ResourcesGetAllStageResourcesOptions) ([]*models.Resource, error)
GetAllStageResources returns a list of all resources.
func (*ResourceHandler) GetResource ¶
func (r *ResourceHandler) GetResource(ctx context.Context, scope ResourceScope, opts ResourcesGetResourceOptions) (*models.Resource, error)
GetResource returns a resource from the defined ResourceScope.
func (*ResourceHandler) GetResourceByURI ¶
func (*ResourceHandler) UpdateProjectResources ¶
func (r *ResourceHandler) UpdateProjectResources(ctx context.Context, project string, resources []*models.Resource, opts ResourcesUpdateProjectResourcesOptions) (string, error)
UpdateProjectResources updates multiple project resources.
func (*ResourceHandler) UpdateResource ¶
func (r *ResourceHandler) UpdateResource(ctx context.Context, resource *models.Resource, scope ResourceScope, opts ResourcesUpdateResourceOptions) (string, error)
UpdateResource updates a resource from the URI defined by ResourceScope.
func (*ResourceHandler) UpdateResourceByURI ¶
func (*ResourceHandler) UpdateResourcesByURI ¶
func (*ResourceHandler) UpdateServiceResources ¶
func (r *ResourceHandler) UpdateServiceResources(ctx context.Context, project string, stage string, service string, resources []*models.Resource, opts ResourcesUpdateServiceResourcesOptions) (string, error)
UpdateServiceResources updates multiple service resources.
type ResourceScope ¶
type ResourceScope struct {
// contains filtered or unexported fields
}
ResourceScope contains the necessary information to get a resource
func NewResourceScope ¶
func NewResourceScope() *ResourceScope
NewResourceScope returns an empty ResourceScope to fill in calling Project Stage Service or Resource functions
func (*ResourceScope) GetProjectPath ¶
func (s *ResourceScope) GetProjectPath() string
GetProjectPath returns a string to construct the url to path eg. /<api-version>/project/<project-name> or an empty string if the project is not set
func (*ResourceScope) GetResourcePath ¶
func (s *ResourceScope) GetResourcePath() string
GetResourcePath returns a string to construct the url to a resource eg. /resource/<escaped-resource-name> or /resource if the resource scope is empty
func (*ResourceScope) GetServicePath ¶
func (s *ResourceScope) GetServicePath() string
GetServicePath returns a string to construct the url to a service eg. /service/<service-name> or an empty string if the service is unset
func (*ResourceScope) GetStagePath ¶
func (s *ResourceScope) GetStagePath() string
GetStagePath returns a string to construct the url to a stage eg. /stage/<stage-name> or an empty string if the stage is unset
func (*ResourceScope) Project ¶
func (s *ResourceScope) Project(project string) *ResourceScope
Project sets the resource scope project value
func (*ResourceScope) Resource ¶
func (s *ResourceScope) Resource(resource string) *ResourceScope
Resource sets the resource scope resource
func (*ResourceScope) Service ¶
func (s *ResourceScope) Service(service string) *ResourceScope
Service sets the resource scope service value
func (*ResourceScope) Stage ¶
func (s *ResourceScope) Stage(stage string) *ResourceScope
Stage sets the resource scope stage value
type ResourcesCreateProjectResourcesOptions ¶
type ResourcesCreateProjectResourcesOptions struct{}
ResourcesCreateProjectResourcesOptions are options for ResourcesInterface.CreateProjectResources().
type ResourcesCreateResourceOptions ¶
type ResourcesCreateResourceOptions struct { // URIOptions modify the resource's URI. URIOptions []URIOption }
ResourcesCreateResourceOptions are options for ResourcesInterface.CreateResource().
type ResourcesCreateResourcesOptions ¶
type ResourcesCreateResourcesOptions struct{}
ResourcesCreateResourcesOptions are options for ResourcesInterface.CreateResources().
type ResourcesDeleteResourceOptions ¶
type ResourcesDeleteResourceOptions struct { // URIOptions modify the resource's URI. URIOptions []URIOption }
ResourcesDeleteResourceOptions are options for ResourcesInterface.DeleteResource().
type ResourcesGetAllServiceResourcesOptions ¶
type ResourcesGetAllServiceResourcesOptions struct{}
ResourcesGetAllServiceResourcesOptions are options for ResourcesInterface.GetAllServiceResources().
type ResourcesGetAllStageResourcesOptions ¶
type ResourcesGetAllStageResourcesOptions struct{}
ResourcesGetAllStageResourcesOptions are options for ResourcesInterface.GetAllStageResources().
type ResourcesGetResourceOptions ¶
type ResourcesGetResourceOptions struct { // URIOptions modify the resource's URI. URIOptions []URIOption }
ResourcesGetResourceOptions are options for ResourcesInterface.GetResource().
type ResourcesInterface ¶
type ResourcesInterface interface { // CreateResources creates a resource for the specified entity. CreateResources(ctx context.Context, project string, stage string, service string, resources []*models.Resource, opts ResourcesCreateResourcesOptions) (*models.EventContext, *models.Error) // CreateProjectResources creates multiple project resources. CreateProjectResources(ctx context.Context, project string, resources []*models.Resource, opts ResourcesCreateProjectResourcesOptions) (string, error) // UpdateProjectResources updates multiple project resources. UpdateProjectResources(ctx context.Context, project string, resources []*models.Resource, opts ResourcesUpdateProjectResourcesOptions) (string, error) // UpdateServiceResources updates multiple service resources. UpdateServiceResources(ctx context.Context, project string, stage string, service string, resources []*models.Resource, opts ResourcesUpdateServiceResourcesOptions) (string, error) // GetAllStageResources returns a list of all resources. GetAllStageResources(ctx context.Context, project string, stage string, opts ResourcesGetAllStageResourcesOptions) ([]*models.Resource, error) // GetAllServiceResources returns a list of all resources. GetAllServiceResources(ctx context.Context, project string, stage string, service string, opts ResourcesGetAllServiceResourcesOptions) ([]*models.Resource, error) // GetResource returns a resource from the defined ResourceScope. GetResource(ctx context.Context, scope ResourceScope, opts ResourcesGetResourceOptions) (*models.Resource, error) // DeleteResource delete a resource from the URI defined by ResourceScope. DeleteResource(ctx context.Context, scope ResourceScope, opts ResourcesDeleteResourceOptions) error // UpdateResource updates a resource from the URI defined by ResourceScope. UpdateResource(ctx context.Context, resource *models.Resource, scope ResourceScope, opts ResourcesUpdateResourceOptions) (string, error) // CreateResource creates one or more resources at the URI defined by ResourceScope. CreateResource(ctx context.Context, resource []*models.Resource, scope ResourceScope, opts ResourcesCreateResourceOptions) (string, error) }
type ResourcesUpdateProjectResourcesOptions ¶
type ResourcesUpdateProjectResourcesOptions struct{}
ResourcesUpdateProjectResourcesOptions are options for ResourcesInterface.UpdateProjectResources().
type ResourcesUpdateResourceOptions ¶
type ResourcesUpdateResourceOptions struct { // URIOptions modify the resource's URI. URIOptions []URIOption }
ResourcesUpdateResourceOptions are options for ResourcesInterface.UpdateResource().
type ResourcesUpdateServiceResourcesOptions ¶
type ResourcesUpdateServiceResourcesOptions struct{}
ResourcesUpdateServiceResourcesOptions are options for ResourcesInterface.UpdateServiceResources().
type SecretHandler ¶
type SecretHandler struct {
// contains filtered or unexported fields
}
SecretHandler handles secrets
func NewAuthenticatedSecretHandler ¶
func NewAuthenticatedSecretHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SecretHandler
NewAuthenticatedSecretHandler returns a new SecretHandler that authenticates at the api via the provided token and sends all requests directly to the secret-service
func NewSecretHandler ¶
func NewSecretHandler(baseURL string) *SecretHandler
NewSecretHandler returns a new SecretHandler which sends all requests directly to the secret-service
func NewSecretHandlerWithHTTPClient ¶
func NewSecretHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *SecretHandler
NewSecretHandlerWithHTTPClient returns a new SecretHandler which sends all requests directly to the secret-service using the specified http.Client
func (*SecretHandler) CreateSecret ¶
func (s *SecretHandler) CreateSecret(ctx context.Context, secret models.Secret, opts SecretsCreateSecretOptions) error
CreateSecret creates a new secret.
func (*SecretHandler) DeleteSecret ¶
func (s *SecretHandler) DeleteSecret(ctx context.Context, secretName, secretScope string, opts SecretsDeleteSecretOptions) error
DeleteSecret deletes a secret.
func (*SecretHandler) GetSecrets ¶
func (s *SecretHandler) GetSecrets(ctx context.Context, opts SecretsGetSecretsOptions) (*models.GetSecretsResponse, error)
GetSecrets returns a list of created secrets.
func (*SecretHandler) UpdateSecret ¶
func (s *SecretHandler) UpdateSecret(ctx context.Context, secret models.Secret, opts SecretsUpdateSecretOptions) error
UpdateSecret creates a new secret.
type SecretsCreateSecretOptions ¶
type SecretsCreateSecretOptions struct{}
SecretsCreateSecretOptions are options for SecretsInterface.CreateSecret().
type SecretsDeleteSecretOptions ¶
type SecretsDeleteSecretOptions struct{}
SecretsDeleteSecretOptions are options for SecretsInterface.DeleteSecret().
type SecretsGetSecretsOptions ¶
type SecretsGetSecretsOptions struct{}
SecretsGetSecretsOptions are options for SecretsInterface.GetSecrets().
type SecretsInterface ¶
type SecretsInterface interface { // CreateSecret creates a new secret. CreateSecret(ctx context.Context, secret models.Secret, opts SecretsCreateSecretOptions) error // UpdateSecret creates a new secret. UpdateSecret(ctx context.Context, secret models.Secret, opts SecretsUpdateSecretOptions) error // DeleteSecret deletes a secret. DeleteSecret(ctx context.Context, secretName, secretScope string, opts SecretsDeleteSecretOptions) error // GetSecrets returns a list of created secrets. GetSecrets(ctx context.Context, opts SecretsGetSecretsOptions) (*models.GetSecretsResponse, error) }
type SecretsUpdateSecretOptions ¶
type SecretsUpdateSecretOptions struct{}
SecretsUpdateSecretOptions are options for SecretsInterface.UpdateSecret().
type SequenceControlBody ¶
func (*SequenceControlBody) FromJSON ¶
func (s *SequenceControlBody) FromJSON(b []byte) error
FromJSON converts JSON string to object
func (*SequenceControlBody) ToJSON ¶
func (s *SequenceControlBody) ToJSON() ([]byte, error)
Converts object to JSON string
type SequenceControlHandler ¶
type SequenceControlHandler struct {
// contains filtered or unexported fields
}
func NewAuthenticatedSequenceControlHandler ¶
func NewAuthenticatedSequenceControlHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *SequenceControlHandler
NewAuthenticatedSequenceControlHandler returns a new SequenceControlHandler that authenticates at the api via the provided token
func NewSequenceControlHandler ¶
func NewSequenceControlHandler(baseURL string) *SequenceControlHandler
NewSequenceControlHandlerWithHTTPClient returns a new SequenceControlHandler
func NewSequenceControlHandlerWithHTTPClient ¶
func NewSequenceControlHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *SequenceControlHandler
NewSequenceControlHandlerWithHTTPClient returns a new SequenceControlHandler using the specified http.Client
func (*SequenceControlHandler) ControlSequence ¶
func (s *SequenceControlHandler) ControlSequence(ctx context.Context, params SequenceControlParams, opts SequencesControlSequenceOptions) error
type SequenceControlParams ¶
type SequenceControlParams struct { Project string `json:"project"` KeptnContext string `json:"keptnContext"` Stage string `json:"stage"` State string `json:"state"` }
func (*SequenceControlParams) Validate ¶
func (s *SequenceControlParams) Validate() error
type SequencesControlSequenceOptions ¶
type SequencesControlSequenceOptions struct{}
SequencesControlSequenceOptions are options for SequencesInterface.ControlSequence().
type SequencesInterface ¶
type SequencesInterface interface {
ControlSequence(ctx context.Context, params SequenceControlParams, opts SequencesControlSequenceOptions) error
}
type ServiceHandler ¶
type ServiceHandler struct {
// contains filtered or unexported fields
}
ServiceHandler handles services
func NewAuthenticatedServiceHandler ¶
func NewAuthenticatedServiceHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ServiceHandler
NewAuthenticatedServiceHandler returns a new ServiceHandler that authenticates at the api via the provided token and sends all requests directly to the resource-service
func NewServiceHandler ¶
func NewServiceHandler(baseURL string) *ServiceHandler
NewServiceHandler returns a new ServiceHandler which sends all requests directly to the resource-service
func NewServiceHandlerWithHTTPClient ¶
func NewServiceHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *ServiceHandler
NewServiceHandlerWithHTTPClient returns a new ServiceHandler which sends all requests directly to the resource-service using the specified http.Client
func (*ServiceHandler) CreateServiceInStage ¶
func (s *ServiceHandler) CreateServiceInStage(ctx context.Context, project string, stage string, serviceName string, opts ServicesCreateServiceInStageOptions) (*models.EventContext, *models.Error)
CreateServiceInStage creates a new service.
func (*ServiceHandler) DeleteServiceFromStage ¶
func (s *ServiceHandler) DeleteServiceFromStage(ctx context.Context, project string, stage string, serviceName string, opts ServicesDeleteServiceFromStageOptions) (*models.EventContext, *models.Error)
DeleteServiceFromStage deletes a service from a stage.
func (*ServiceHandler) GetAllServices ¶
func (s *ServiceHandler) GetAllServices(ctx context.Context, project string, stage string, opts ServicesGetAllServicesOptions) ([]*models.Service, error)
GetAllServices returns a list of all services.
func (*ServiceHandler) GetService ¶
func (s *ServiceHandler) GetService(ctx context.Context, project, stage, service string, opts ServicesGetServiceOptions) (*models.Service, error)
GetService gets a service.
type ServicesCreateServiceInStageOptions ¶
type ServicesCreateServiceInStageOptions struct{}
ServicesCreateServiceInStageOptions are options for ServicesInterface.CreateServiceInStage().
type ServicesDeleteServiceFromStageOptions ¶
type ServicesDeleteServiceFromStageOptions struct{}
ServicesDeleteServiceFromStageOptions are options for ServicesInterface.DeleteServiceFromStage().
type ServicesGetAllServicesOptions ¶
type ServicesGetAllServicesOptions struct{}
ServicesGetAllServicesOptions are options for ServicesInterface.GetAllServices().
type ServicesGetServiceOptions ¶
type ServicesGetServiceOptions struct{}
ServicesGetServiceOptions are options for ServicesInterface.GetService().
type ServicesInterface ¶
type ServicesInterface interface { // CreateServiceInStage creates a new service. CreateServiceInStage(ctx context.Context, project string, stage string, serviceName string, opts ServicesCreateServiceInStageOptions) (*models.EventContext, *models.Error) // DeleteServiceFromStage deletes a service from a stage. DeleteServiceFromStage(ctx context.Context, project string, stage string, serviceName string, opts ServicesDeleteServiceFromStageOptions) (*models.EventContext, *models.Error) // GetService gets a service. GetService(ctx context.Context, project, stage, service string, opts ServicesGetServiceOptions) (*models.Service, error) // GetAllServices returns a list of all services. GetAllServices(ctx context.Context, project string, stage string, opts ServicesGetAllServicesOptions) ([]*models.Service, error) }
type ShipyardControlGetOpenTriggeredEventsOptions ¶
type ShipyardControlGetOpenTriggeredEventsOptions struct{}
ShipyardControlGetOpenTriggeredEventsOptions are options for ShipyardControlInterface.GetOpenTriggeredEvents().
type ShipyardControlInterface ¶
type ShipyardControlInterface interface { // GetOpenTriggeredEvents returns all open triggered events. GetOpenTriggeredEvents(ctx context.Context, filter EventFilter, opts ShipyardControlGetOpenTriggeredEventsOptions) ([]*models.KeptnContextExtendedCE, error) }
type ShipyardControllerHandler ¶
type ShipyardControllerHandler struct {
// contains filtered or unexported fields
}
func NewAuthenticatedShipyardControllerHandler ¶
func NewAuthenticatedShipyardControllerHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *ShipyardControllerHandler
NewAuthenticatedShipyardControllerHandler returns a new ShipyardControllerHandler that authenticates at the api via the provided token and sends all requests directly to the resource-service
func NewShipyardControllerHandler ¶
func NewShipyardControllerHandler(baseURL string) *ShipyardControllerHandler
NewShipyardControllerHandler returns a new ShipyardControllerHandler which sends all requests directly to the resource-service
func NewShipyardControllerHandlerWithHTTPClient ¶
func NewShipyardControllerHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *ShipyardControllerHandler
NewShipyardControllerHandlerWithHTTPClient returns a new ShipyardControllerHandler which sends all requests directly to the resource-service using the specified http.Client
func (*ShipyardControllerHandler) GetOpenTriggeredEvents ¶
func (s *ShipyardControllerHandler) GetOpenTriggeredEvents(ctx context.Context, filter EventFilter, opts ShipyardControlGetOpenTriggeredEventsOptions) ([]*models.KeptnContextExtendedCE, error)
GetOpenTriggeredEvents returns all open triggered events.
type StageHandler ¶
type StageHandler struct {
// contains filtered or unexported fields
}
StageHandler handles stages
func NewAuthenticatedStageHandler ¶
func NewAuthenticatedStageHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *StageHandler
NewAuthenticatedStageHandler returns a new StageHandler that authenticates at the api via the provided token and sends all requests directly to the resource-service
func NewStageHandler ¶
func NewStageHandler(baseURL string) *StageHandler
NewStageHandler returns a new StageHandler which sends all requests directly to the resource-service
func NewStageHandlerWithHTTPClient ¶
func NewStageHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *StageHandler
NewStageHandlerWithHTTPClient returns a new StageHandler which sends all requests directly to the resource-service using the specified http.Client
func (*StageHandler) CreateStage ¶
func (s *StageHandler) CreateStage(ctx context.Context, project string, stageName string, opts StagesCreateStageOptions) (*models.EventContext, *models.Error)
CreateStage creates a new stage with the provided name.
func (*StageHandler) GetAllStages ¶
func (s *StageHandler) GetAllStages(ctx context.Context, project string, opts StagesGetAllStagesOptions) ([]*models.Stage, error)
GetAllStages returns a list of all stages.
type StagesCreateStageOptions ¶
type StagesCreateStageOptions struct{}
StagesCreateStageOptions are options for StagesInterface.CreateStage().
type StagesGetAllStagesOptions ¶
type StagesGetAllStagesOptions struct{}
StagesGetAllStagesOptions are options for StagesInterface.GetAllStages().
type StagesInterface ¶
type StagesInterface interface { // CreateStage creates a new stage with the provided name. CreateStage(ctx context.Context, project string, stageName string, opts StagesCreateStageOptions) (*models.EventContext, *models.Error) // GetAllStages returns a list of all stages. GetAllStages(ctx context.Context, project string, opts StagesGetAllStagesOptions) ([]*models.Stage, error) }
type StatusBody ¶
type StatusBody struct {
Status string `json:"status"`
}
func (*StatusBody) ToJSON ¶
func (s *StatusBody) ToJSON() ([]byte, error)
ToJSON converts object to JSON string
type URIOption ¶
URIOption returns a function that modifies an url
func AppendQuery ¶
AppendQuery returns an option function that can modify an URI by appending a map of url query values
type UniformCreateSubscriptionOptions ¶
type UniformCreateSubscriptionOptions struct{}
UniformCreateSubscriptionOptions are options for UniformInterface.CreateSubscription().
type UniformGetRegistrationsOptions ¶
type UniformGetRegistrationsOptions struct{}
UniformGetRegistrationsOptions are options for UniformInterface.GetRegistrations().
type UniformHandler ¶
type UniformHandler struct {
// contains filtered or unexported fields
}
func NewAuthenticatedUniformHandler ¶
func NewAuthenticatedUniformHandler(baseURL string, authToken string, authHeader string, httpClient *http.Client, scheme string) *UniformHandler
NewAuthenticatedUniformHandler returns a new UniformHandler that authenticates at the api via the provided token
func NewUniformHandler ¶
func NewUniformHandler(baseURL string) *UniformHandler
NewUniformHandler returns a new UniformHandler
func NewUniformHandlerWithHTTPClient ¶
func NewUniformHandlerWithHTTPClient(baseURL string, httpClient *http.Client) *UniformHandler
NewUniformHandlerWithHTTPClient returns a new UniformHandler using the specified http.Client
func (*UniformHandler) CreateSubscription ¶
func (u *UniformHandler) CreateSubscription(ctx context.Context, integrationID string, subscription models.EventSubscription, opts UniformCreateSubscriptionOptions) (string, error)
func (*UniformHandler) GetRegistrations ¶
func (u *UniformHandler) GetRegistrations(ctx context.Context, opts UniformGetRegistrationsOptions) ([]*models.Integration, error)
func (*UniformHandler) Ping ¶
func (u *UniformHandler) Ping(ctx context.Context, integrationID string, opts UniformPingOptions) (*models.Integration, error)
func (*UniformHandler) RegisterIntegration ¶
func (u *UniformHandler) RegisterIntegration(ctx context.Context, integration models.Integration, opts UniformRegisterIntegrationOptions) (string, error)
func (*UniformHandler) UnregisterIntegration ¶
func (u *UniformHandler) UnregisterIntegration(ctx context.Context, integrationID string, opts UniformUnregisterIntegrationOptions) error
type UniformInterface ¶
type UniformInterface interface { Ping(ctx context.Context, integrationID string, opts UniformPingOptions) (*models.Integration, error) RegisterIntegration(ctx context.Context, integration models.Integration, opts UniformRegisterIntegrationOptions) (string, error) CreateSubscription(ctx context.Context, integrationID string, subscription models.EventSubscription, opts UniformCreateSubscriptionOptions) (string, error) UnregisterIntegration(ctx context.Context, integrationID string, opts UniformUnregisterIntegrationOptions) error GetRegistrations(ctx context.Context, opts UniformGetRegistrationsOptions) ([]*models.Integration, error) }
type UniformPingOptions ¶
type UniformPingOptions struct{}
UniformPingOptions are options for UniformInterface.Ping().
type UniformRegisterIntegrationOptions ¶
type UniformRegisterIntegrationOptions struct{}
UniformRegisterIntegrationOptions are options for UniformInterface.RegisterIntegration().
type UniformUnregisterIntegrationOptions ¶
type UniformUnregisterIntegrationOptions struct{}
UniformUnregisterIntegrationOptions are options for UniformInterface.UnregisterIntegration().