Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateNotification(params any) (*Notification, error)
- func (c *Client) CreateWebhookSecret(name, key string) (*Secret, error)
- func (c *Client) DeleteNotification(id string) error
- func (c *Client) DeleteSecret(name string) error
- func (c *Client) GetNotification(id string) (*Notification, error)
- func (c *Client) GetPipeline(id string) (*Pipeline, error)
- func (c *Client) GetProject(idOrName string) (*ProjectResponse, error)
- func (c *Client) GetSecret(id string) (*Secret, error)
- func (c *Client) ListPipelines(projectID string) ([]any, error)
- func (c *Client) RunWorkflow(params any) (*CreateWorkflowResponse, error)
- type Configuration
- type CreateWorkflowResponse
- type Metadata
- type Notification
- type NotificationMetadata
- type NotificationNotifySlack
- type NotificationNotifyWebhook
- type NotificationRule
- type NotificationRuleFilter
- type NotificationRuleNotify
- type NotificationSpec
- type OnPipelineDone
- func (p *OnPipelineDone) Actions() []core.Action
- func (p *OnPipelineDone) Color() string
- func (p *OnPipelineDone) Configuration() []configuration.Field
- func (p *OnPipelineDone) Description() string
- func (p *OnPipelineDone) Documentation() string
- func (t *OnPipelineDone) ExampleData() map[string]any
- func (p *OnPipelineDone) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (p *OnPipelineDone) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (p *OnPipelineDone) Icon() string
- func (p *OnPipelineDone) Label() string
- func (p *OnPipelineDone) Name() string
- func (p *OnPipelineDone) Setup(ctx core.TriggerContext) error
- type OnPipelineDoneConfiguration
- type OnPipelineDoneMetadata
- type Parameter
- type Pipeline
- type PipelineMetadata
- type PipelineResponse
- type Project
- type ProjectMetadata
- type ProjectResponse
- type RunWorkflow
- func (r *RunWorkflow) Actions() []core.Action
- func (r *RunWorkflow) Cancel(ctx core.ExecutionContext) error
- func (r *RunWorkflow) Color() string
- func (r *RunWorkflow) Configuration() []configuration.Field
- func (r *RunWorkflow) Description() string
- func (r *RunWorkflow) Documentation() string
- func (c *RunWorkflow) ExampleOutput() map[string]any
- func (r *RunWorkflow) Execute(ctx core.ExecutionContext) error
- func (r *RunWorkflow) HandleAction(ctx core.ActionContext) error
- func (r *RunWorkflow) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (r *RunWorkflow) Icon() string
- func (r *RunWorkflow) Label() string
- func (r *RunWorkflow) Name() string
- func (r *RunWorkflow) OutputChannels(configuration any) []core.OutputChannel
- func (r *RunWorkflow) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (r *RunWorkflow) Setup(ctx core.SetupContext) error
- type RunWorkflowExecutionMetadata
- type RunWorkflowNodeMetadata
- type RunWorkflowSpec
- type Secret
- type SecretMetadata
- type SecretSpecData
- type SecretSpecDataEnvVar
- type Semaphore
- func (s *Semaphore) CleanupWebhook(ctx core.CleanupWebhookContext) error
- func (s *Semaphore) CompareWebhookConfig(a, b any) (bool, error)
- func (s *Semaphore) Components() []core.Component
- func (s *Semaphore) Configuration() []configuration.Field
- func (s *Semaphore) Description() string
- func (s *Semaphore) HandleRequest(ctx core.HTTPRequestContext)
- func (s *Semaphore) Icon() string
- func (s *Semaphore) Instructions() string
- func (s *Semaphore) Label() string
- func (s *Semaphore) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (s *Semaphore) Name() string
- func (s *Semaphore) SetupWebhook(ctx core.SetupWebhookContext) (any, error)
- func (s *Semaphore) Sync(ctx core.SyncContext) error
- func (s *Semaphore) Triggers() []core.Trigger
- type WebhookConfiguration
- type WebhookMetadata
- type WebhookNotificationMetadata
- type WebhookSecretMetadata
- type WorkflowMetadata
Constants ¶
View Source
const FailedOutputChannel = "failed"
View Source
const PassedOutputChannel = "passed"
View Source
const PayloadType = "semaphore.workflow.finished"
View Source
const PipelineResultPassed = "passed"
View Source
const PipelineStateDone = "done"
View Source
const PollInterval = 5 * time.Minute
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.5.0
func NewClient ¶ added in v0.5.0
func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)
func (*Client) CreateNotification ¶ added in v0.5.0
func (c *Client) CreateNotification(params any) (*Notification, error)
func (*Client) CreateWebhookSecret ¶ added in v0.5.0
func (*Client) DeleteNotification ¶ added in v0.5.0
func (*Client) DeleteSecret ¶ added in v0.5.0
func (*Client) GetNotification ¶ added in v0.5.0
func (c *Client) GetNotification(id string) (*Notification, error)
func (*Client) GetPipeline ¶ added in v0.5.0
func (*Client) GetProject ¶ added in v0.5.0
func (c *Client) GetProject(idOrName string) (*ProjectResponse, error)
func (*Client) ListPipelines ¶ added in v0.5.0
func (*Client) RunWorkflow ¶ added in v0.5.0
func (c *Client) RunWorkflow(params any) (*CreateWorkflowResponse, error)
type Configuration ¶ added in v0.5.0
type CreateWorkflowResponse ¶
type Notification ¶
type Notification struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata NotificationMetadata `json:"metadata"`
Spec NotificationSpec `json:"spec"`
}
type NotificationMetadata ¶
type NotificationNotifySlack ¶
type NotificationRule ¶
type NotificationRule struct {
Name string `json:"name"`
Filter NotificationRuleFilter `json:"filter"`
Notify NotificationRuleNotify `json:"notify"`
}
type NotificationRuleFilter ¶
type NotificationRuleNotify ¶
type NotificationRuleNotify struct {
Webhook NotificationNotifyWebhook `json:"webhook"`
// TODO
// we don't really need this, but if it's not in the request,
// the API does not work properly.
// Once it's fixed, or we migrate to v2 API, we can remove it from here.
//
Slack NotificationNotifySlack `json:"slack"`
}
type NotificationSpec ¶
type NotificationSpec struct {
Rules []NotificationRule `json:"rules"`
}
type OnPipelineDone ¶ added in v0.5.0
type OnPipelineDone struct{}
func (*OnPipelineDone) Actions ¶ added in v0.5.0
func (p *OnPipelineDone) Actions() []core.Action
func (*OnPipelineDone) Color ¶ added in v0.5.0
func (p *OnPipelineDone) Color() string
func (*OnPipelineDone) Configuration ¶ added in v0.5.0
func (p *OnPipelineDone) Configuration() []configuration.Field
func (*OnPipelineDone) Description ¶ added in v0.5.0
func (p *OnPipelineDone) Description() string
func (*OnPipelineDone) Documentation ¶ added in v0.5.0
func (p *OnPipelineDone) Documentation() string
func (*OnPipelineDone) ExampleData ¶ added in v0.5.0
func (t *OnPipelineDone) ExampleData() map[string]any
func (*OnPipelineDone) HandleAction ¶ added in v0.5.0
func (p *OnPipelineDone) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
func (*OnPipelineDone) HandleWebhook ¶ added in v0.5.0
func (p *OnPipelineDone) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*OnPipelineDone) Icon ¶ added in v0.5.0
func (p *OnPipelineDone) Icon() string
func (*OnPipelineDone) Label ¶ added in v0.5.0
func (p *OnPipelineDone) Label() string
func (*OnPipelineDone) Name ¶ added in v0.5.0
func (p *OnPipelineDone) Name() string
func (*OnPipelineDone) Setup ¶ added in v0.5.0
func (p *OnPipelineDone) Setup(ctx core.TriggerContext) error
type OnPipelineDoneConfiguration ¶ added in v0.5.0
type OnPipelineDoneConfiguration struct {
Project string `json:"project"`
}
type OnPipelineDoneMetadata ¶ added in v0.5.0
type OnPipelineDoneMetadata struct {
Project *Project `json:"project"`
}
type PipelineMetadata ¶ added in v0.5.0
type PipelineResponse ¶
type PipelineResponse struct {
Pipeline *Pipeline `json:"pipeline"`
}
type ProjectMetadata ¶
type ProjectResponse ¶ added in v0.5.0
type ProjectResponse struct {
Metadata *ProjectMetadata `json:"metadata"`
}
type RunWorkflow ¶ added in v0.5.0
type RunWorkflow struct{}
func (*RunWorkflow) Actions ¶ added in v0.5.0
func (r *RunWorkflow) Actions() []core.Action
func (*RunWorkflow) Cancel ¶ added in v0.5.0
func (r *RunWorkflow) Cancel(ctx core.ExecutionContext) error
func (*RunWorkflow) Color ¶ added in v0.5.0
func (r *RunWorkflow) Color() string
func (*RunWorkflow) Configuration ¶ added in v0.5.0
func (r *RunWorkflow) Configuration() []configuration.Field
func (*RunWorkflow) Description ¶ added in v0.5.0
func (r *RunWorkflow) Description() string
func (*RunWorkflow) Documentation ¶ added in v0.5.0
func (r *RunWorkflow) Documentation() string
func (*RunWorkflow) ExampleOutput ¶ added in v0.5.0
func (c *RunWorkflow) ExampleOutput() map[string]any
func (*RunWorkflow) Execute ¶ added in v0.5.0
func (r *RunWorkflow) Execute(ctx core.ExecutionContext) error
func (*RunWorkflow) HandleAction ¶ added in v0.5.0
func (r *RunWorkflow) HandleAction(ctx core.ActionContext) error
func (*RunWorkflow) HandleWebhook ¶ added in v0.5.0
func (r *RunWorkflow) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*RunWorkflow) Icon ¶ added in v0.5.0
func (r *RunWorkflow) Icon() string
func (*RunWorkflow) Label ¶ added in v0.5.0
func (r *RunWorkflow) Label() string
func (*RunWorkflow) Name ¶ added in v0.5.0
func (r *RunWorkflow) Name() string
func (*RunWorkflow) OutputChannels ¶ added in v0.5.0
func (r *RunWorkflow) OutputChannels(configuration any) []core.OutputChannel
func (*RunWorkflow) ProcessQueueItem ¶ added in v0.5.0
func (r *RunWorkflow) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*RunWorkflow) Setup ¶ added in v0.5.0
func (r *RunWorkflow) Setup(ctx core.SetupContext) error
type RunWorkflowExecutionMetadata ¶ added in v0.5.0
type RunWorkflowExecutionMetadata struct {
Workflow *WorkflowMetadata `json:"workflow" mapstructure:"workflow"`
Pipeline *PipelineMetadata `json:"pipeline" mapstructure:"pipeline"`
Extra map[string]any `json:"extra,omitempty" mapstructure:"extra,omitempty"`
}
type RunWorkflowNodeMetadata ¶ added in v0.5.0
type RunWorkflowNodeMetadata struct {
Project *Project `json:"project" mapstructure:"project"`
}
type RunWorkflowSpec ¶ added in v0.5.0
type Secret ¶
type Secret struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata SecretMetadata `json:"metadata"`
Data SecretSpecData `json:"data"`
}
type SecretMetadata ¶
type SecretSpecData ¶
type SecretSpecData struct {
EnvVars []SecretSpecDataEnvVar `json:"env_vars"`
}
type SecretSpecDataEnvVar ¶
type Semaphore ¶ added in v0.5.0
type Semaphore struct{}
func (*Semaphore) CleanupWebhook ¶ added in v0.5.0
func (s *Semaphore) CleanupWebhook(ctx core.CleanupWebhookContext) error
func (*Semaphore) CompareWebhookConfig ¶ added in v0.5.0
func (*Semaphore) Components ¶ added in v0.5.0
func (*Semaphore) Configuration ¶ added in v0.5.0
func (s *Semaphore) Configuration() []configuration.Field
func (*Semaphore) Description ¶ added in v0.5.0
func (*Semaphore) HandleRequest ¶ added in v0.5.0
func (s *Semaphore) HandleRequest(ctx core.HTTPRequestContext)
func (*Semaphore) Instructions ¶ added in v0.5.0
func (*Semaphore) ListResources ¶ added in v0.5.0
func (s *Semaphore) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*Semaphore) SetupWebhook ¶ added in v0.5.0
func (s *Semaphore) SetupWebhook(ctx core.SetupWebhookContext) (any, error)
type WebhookConfiguration ¶ added in v0.5.0
type WebhookConfiguration struct {
Project string `json:"project"`
}
type WebhookMetadata ¶
type WebhookMetadata struct {
Secret WebhookSecretMetadata `json:"secret"`
Notification WebhookNotificationMetadata `json:"notification"`
}
type WebhookSecretMetadata ¶
type WorkflowMetadata ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.