Documentation ¶
Index ¶
- Constants
- func MakeExchangeAction(p nuggit.Point, pipe integrity.NameDigest) nuggit.Action
- func MakePipeAction(pipe integrity.NameDigest) nuggit.Action
- func NewResourceSpec(kind Kind) (any, error)
- func ValidateAction(action nuggit.Action, clientOnly bool) error
- func ValidatePipe(p *Pipe, clientOnly bool) error
- func ValidatePoint(p nuggit.Point) error
- func ValidateRule(c nuggit.Rule) error
- func ValidateScalar(s nuggit.Scalar) error
- func ValidateView(v *nuggit.View) error
- type API
- type APIVersion
- type CloseTriggerRequest
- type CloseTriggerResponse
- type CreatePipeRequest
- type CreatePipeResponse
- type CreatePipesBatchRequest
- type CreatePipesBatchResponse
- type CreateResourceRequest
- type CreateResourceResponse
- type CreateRuleRequest
- type CreateRuleResponse
- type CreateViewRequest
- type CreateViewResponse
- type DeleteRuleRequest
- type DeleteRuleResponse
- type ExchangeResultsRequest
- type ExchangeResultsResponse
- type GetPipeRequest
- type GetPipeResponse
- type Kind
- type ListPipesRequest
- type ListPipesResponse
- type OpenTriggerRequest
- type OpenTriggerResponse
- type Pipe
- type PipeStore
- type PipesAPI
- func (a *PipesAPI) CreatePipe(ctx context.Context, req *CreatePipeRequest) (*CreatePipeResponse, error)
- func (a *PipesAPI) CreatePipesBatch(ctx context.Context, req *CreatePipesBatchRequest) (*CreatePipesBatchResponse, error)
- func (a *PipesAPI) GetPipe(ctx context.Context, req *GetPipeRequest) (*GetPipeResponse, error)
- func (a *PipesAPI) Init(store PipeStore, rule RuleStore)
- func (a *PipesAPI) ListPipes(ctx context.Context, _ *ListPipesRequest) (*ListPipesResponse, error)
- type PlanStore
- type Ref
- type Resource
- func (r *Resource) GetAPIVersion() APIVersion
- func (r *Resource) GetDigest() string
- func (r *Resource) GetKind() Kind
- func (r *Resource) GetMetadata() *ResourceMetadata
- func (r *Resource) GetName() string
- func (r *Resource) GetPipe() *nuggit.Pipe
- func (r *Resource) GetRule() *nuggit.Rule
- func (r *Resource) GetSpec() any
- func (r *Resource) GetView() *nuggit.View
- func (r *Resource) ReplaceSpec(spec any)
- func (r *Resource) SetDigest(digest string)
- func (r *Resource) SetName(name string)
- func (r *Resource) UnmarshalJSON(data []byte) error
- func (r *Resource) UnmarshalYAML(value *yaml.Node) error
- type ResourceMetadata
- func (m *ResourceMetadata) GetDescription() string
- func (m *ResourceMetadata) GetDigest() string
- func (m *ResourceMetadata) GetLabels() []string
- func (m *ResourceMetadata) GetName() string
- func (m *ResourceMetadata) GetUUID() string
- func (m *ResourceMetadata) GetVersion() string
- func (m *ResourceMetadata) SetDigest(digest string)
- func (m *ResourceMetadata) SetName(name string)
- type ResourceStore
- type ResourcesAPI
- type ResultStore
- type RuleStore
- type RulesAPI
- type Runtime
- type TriggerAPI
- func (a *TriggerAPI) CloseTrigger(ctx context.Context, req *CloseTriggerRequest) (*CloseTriggerResponse, error)
- func (a *TriggerAPI) ExchangeResults(ctx context.Context, req *ExchangeResultsRequest) (*ExchangeResultsResponse, error)
- func (a *TriggerAPI) Init(rules RuleStore, pipes PipeStore, planStore PlanStore, resultStore ResultStore, ...)
- func (a *TriggerAPI) OpenTrigger(ctx context.Context, req *OpenTriggerRequest) (*OpenTriggerResponse, error)
- type TriggerEvent
- type TriggerPlanner
- type TriggerResult
- type ViewStore
- type ViewsAPI
Constants ¶
View Source
const ( KindPipe = "pipe" KindView = "view" KindRule = "rule" )
Variables ¶
This section is empty.
Functions ¶
func MakeExchangeAction ¶ added in v1.4.0
func MakePipeAction ¶ added in v1.4.0
func MakePipeAction(pipe integrity.NameDigest) nuggit.Action
func NewResourceSpec ¶ added in v1.3.0
func ValidateAction ¶
ValidateAction validates the action contents.
Use clientOnly for Pipes, and !clientOnly for Plans.
func ValidatePipe ¶
func ValidatePoint ¶
func ValidateRule ¶ added in v1.6.1
func ValidateScalar ¶
func ValidateView ¶ added in v1.5.0
Types ¶
type API ¶
type API struct { *ViewsAPI *PipesAPI *TriggerAPI *ResourcesAPI *RulesAPI }
func NewAPI ¶
func NewAPI(viewStore ViewStore, pipeStore PipeStore, ruleStore RuleStore, planStore PlanStore, resultStore ResultStore, resourceStore ResourceStore, newTriggerPlanner func() TriggerPlanner) *API
type CloseTriggerRequest ¶ added in v1.5.0
type CloseTriggerRequest struct {
Trigger string `json:"trigger,omitempty"`
}
type CloseTriggerResponse ¶ added in v1.5.0
type CloseTriggerResponse struct{}
type CreatePipeRequest ¶
type CreatePipeRequest struct {
Pipe *Pipe `json:"pipe,omitempty"`
}
type CreatePipeResponse ¶
type CreatePipeResponse struct {
Pipe *Ref `json:"pipe,omitempty"`
}
type CreatePipesBatchRequest ¶
type CreatePipesBatchRequest struct {
Pipes []*Pipe `json:"pipes,omitempty"`
}
type CreatePipesBatchResponse ¶
type CreatePipesBatchResponse struct {
Pipes []Ref `json:"pipes,omitempty"`
}
type CreateResourceRequest ¶ added in v1.8.0
type CreateResourceRequest struct {
Resource *Resource `json:"resource,omitempty"`
}
type CreateResourceResponse ¶ added in v1.8.0
type CreateResourceResponse struct{}
type CreateRuleRequest ¶ added in v1.6.1
type CreateRuleResponse ¶ added in v1.6.1
type CreateRuleResponse struct{}
type CreateViewRequest ¶ added in v1.5.0
type CreateViewResponse ¶ added in v1.5.0
type CreateViewResponse struct {
View *Ref `json:"view,omitempty"`
}
type DeleteRuleRequest ¶ added in v1.8.0
type DeleteRuleResponse ¶ added in v1.8.0
type DeleteRuleResponse struct{}
type ExchangeResultsRequest ¶ added in v1.1.0
type ExchangeResultsRequest struct { Trigger *TriggerEvent `json:"trigger,omitempty"` Results []TriggerResult `json:"results,omitempty"` }
type ExchangeResultsResponse ¶ added in v1.1.0
type ExchangeResultsResponse struct{}
type GetPipeRequest ¶
type GetPipeRequest struct {
Pipe string `json:"pipe,omitempty"`
}
type GetPipeResponse ¶
type GetPipeResponse struct {
Pipe *Pipe `json:"pipe,omitempty"`
}
type ListPipesRequest ¶
type ListPipesRequest struct{}
type ListPipesResponse ¶
type ListPipesResponse struct {
Pipes []Ref `json:"pipes,omitempty"`
}
type OpenTriggerRequest ¶ added in v1.5.0
type OpenTriggerRequest struct { URL string `json:"url,omitempty"` Implicit bool `json:"implicit,omitempty"` IncludePipes []integrity.NameDigest `json:"include_views,omitempty"` ExcludePipes []integrity.NameDigest `json:"exclude_views,omitempty"` }
type OpenTriggerResponse ¶ added in v1.5.0
type Pipe ¶
type Pipe struct { Name string `json:"name,omitempty"` Digest string `json:"digest,omitempty"` nuggit.Pipe `json:",omitempty"` }
func (*Pipe) GetActions ¶
type PipeStore ¶
type PipeStore interface { Load(ctx context.Context, pipe integrity.NameDigest) (*Pipe, error) Store(context.Context, *Pipe) error StoreBatch(context.Context, []*Pipe) error ScanNames(context.Context) iter.Seq2[integrity.NameDigest, error] Scan(context.Context) iter.Seq2[*Pipe, error] ScanDependencies(ctx context.Context, pipe integrity.NameDigest) iter.Seq2[*Pipe, error] }
type PipesAPI ¶
type PipesAPI struct {
// contains filtered or unexported fields
}
func (*PipesAPI) CreatePipe ¶
func (a *PipesAPI) CreatePipe(ctx context.Context, req *CreatePipeRequest) (*CreatePipeResponse, error)
func (*PipesAPI) CreatePipesBatch ¶
func (a *PipesAPI) CreatePipesBatch(ctx context.Context, req *CreatePipesBatchRequest) (*CreatePipesBatchResponse, error)
func (*PipesAPI) GetPipe ¶
func (a *PipesAPI) GetPipe(ctx context.Context, req *GetPipeRequest) (*GetPipeResponse, error)
func (*PipesAPI) ListPipes ¶
func (a *PipesAPI) ListPipes(ctx context.Context, _ *ListPipesRequest) (*ListPipesResponse, error)
type Ref ¶
type Resource ¶
type Resource struct { APIVersion APIVersion `json:"api_version,omitempty"` Kind Kind `json:"kind,omitempty"` Metadata *ResourceMetadata `json:"metadata,omitempty"` Spec any `json:"spec,omitempty"` }
func (*Resource) GetAPIVersion ¶ added in v1.3.0
func (r *Resource) GetAPIVersion() APIVersion
func (*Resource) GetMetadata ¶ added in v1.3.0
func (r *Resource) GetMetadata() *ResourceMetadata
func (*Resource) ReplaceSpec ¶ added in v1.5.0
func (*Resource) UnmarshalJSON ¶ added in v1.3.0
func (*Resource) UnmarshalYAML ¶ added in v1.3.0
type ResourceMetadata ¶
type ResourceMetadata struct { Name string `json:"name,omitempty"` Digest string `json:"digest,omitempty"` // TODO: Consider making this json:"-". UUID string `json:"uuid,omitempty"` Version string `json:"version,omitempty"` Description string `json:"description,omitempty"` Labels []string `json:"labels,omitempty"` }
func (*ResourceMetadata) GetDescription ¶ added in v1.3.0
func (m *ResourceMetadata) GetDescription() string
func (*ResourceMetadata) GetDigest ¶ added in v1.7.0
func (m *ResourceMetadata) GetDigest() string
func (*ResourceMetadata) GetLabels ¶ added in v1.3.0
func (m *ResourceMetadata) GetLabels() []string
func (*ResourceMetadata) GetName ¶ added in v1.3.0
func (m *ResourceMetadata) GetName() string
func (*ResourceMetadata) GetUUID ¶ added in v1.8.0
func (m *ResourceMetadata) GetUUID() string
func (*ResourceMetadata) GetVersion ¶ added in v1.3.0
func (m *ResourceMetadata) GetVersion() string
func (*ResourceMetadata) SetDigest ¶ added in v1.7.0
func (m *ResourceMetadata) SetDigest(digest string)
func (*ResourceMetadata) SetName ¶ added in v1.7.0
func (m *ResourceMetadata) SetName(name string)
type ResourceStore ¶ added in v1.5.0
type ResourcesAPI ¶ added in v1.5.0
type ResourcesAPI struct {
// contains filtered or unexported fields
}
func (*ResourcesAPI) CreateResource ¶ added in v1.8.0
func (a *ResourcesAPI) CreateResource(ctx context.Context, req *CreateResourceRequest) (*CreateResourceResponse, error)
func (*ResourcesAPI) Init ¶ added in v1.8.0
func (a *ResourcesAPI) Init(store ResourceStore, pipes *PipesAPI, views *ViewsAPI, rules *RulesAPI)
type ResultStore ¶ added in v1.2.0
type ResultStore interface {
StoreResults(ctx context.Context, trigger *TriggerEvent, results []TriggerResult) error
}
type RulesAPI ¶ added in v1.8.0
type RulesAPI struct {
// contains filtered or unexported fields
}
func (*RulesAPI) CreateRule ¶ added in v1.8.0
func (a *RulesAPI) CreateRule(ctx context.Context, req *CreateRuleRequest) (*CreateRuleResponse, error)
func (*RulesAPI) DeleteRule ¶ added in v1.8.0
func (a *RulesAPI) DeleteRule(ctx context.Context, req *DeleteRuleRequest) (*DeleteRuleResponse, error)
type Runtime ¶
type Runtime struct { Name string `json:"name,omitempty"` SupportedActions []string `json:"supported_actions,omitempty"` }
func (*Runtime) GetSupportedActions ¶
type TriggerAPI ¶
type TriggerAPI struct {
// contains filtered or unexported fields
}
func (*TriggerAPI) CloseTrigger ¶ added in v1.5.0
func (a *TriggerAPI) CloseTrigger(ctx context.Context, req *CloseTriggerRequest) (*CloseTriggerResponse, error)
func (*TriggerAPI) ExchangeResults ¶ added in v1.1.0
func (a *TriggerAPI) ExchangeResults(ctx context.Context, req *ExchangeResultsRequest) (*ExchangeResultsResponse, error)
func (*TriggerAPI) Init ¶
func (a *TriggerAPI) Init(rules RuleStore, pipes PipeStore, planStore PlanStore, resultStore ResultStore, newPlanner func() TriggerPlanner)
func (*TriggerAPI) OpenTrigger ¶ added in v1.5.0
func (a *TriggerAPI) OpenTrigger(ctx context.Context, req *OpenTriggerRequest) (*OpenTriggerResponse, error)
type TriggerEvent ¶ added in v1.5.0
type TriggerEvent struct { Plan string `json:"plan,omitempty"` Implicit bool `json:"implicit,omitempty"` URL string `json:"url,omitempty"` Timestamp time.Time `json:"timestamp,omitempty"` }
func (*TriggerEvent) GetImplicit ¶ added in v1.5.0
func (e *TriggerEvent) GetImplicit() bool
func (*TriggerEvent) GetPlan ¶ added in v1.5.0
func (e *TriggerEvent) GetPlan() string
func (*TriggerEvent) GetTimestamp ¶ added in v1.5.0
func (e *TriggerEvent) GetTimestamp() time.Time
func (*TriggerEvent) GetURL ¶ added in v1.5.0
func (e *TriggerEvent) GetURL() string
type TriggerPlanner ¶
type TriggerResult ¶
type TriggerResult struct { Pipe string `json:"pipe,omitempty"` Scalar nuggit.Scalar `json:"scalar,omitempty"` Result any `json:"result,omitempty"` }
TODO: Add Point to this struct.
func (*TriggerResult) GetPipe ¶ added in v1.5.0
func (r *TriggerResult) GetPipe() string
func (*TriggerResult) GetResult ¶ added in v1.5.0
func (r *TriggerResult) GetResult() any
type ViewsAPI ¶ added in v1.5.0
type ViewsAPI struct {
// contains filtered or unexported fields
}
func (*ViewsAPI) CreateView ¶ added in v1.5.0
func (a *ViewsAPI) CreateView(ctx context.Context, req *CreateViewRequest) (*CreateViewResponse, error)
Click to show internal directories.
Click to hide internal directories.