Documentation
¶
Index ¶
- Constants
- type CreateTemplateInput
- type Definition
- type DefinitionValidator
- type ImportFailure
- type ImportResult
- type PipelineCreator
- type PipelineDocument
- type Service
- func (s *Service) Clone(ctx context.Context, id string) (*TemplateDetail, error)
- func (s *Service) Create(ctx context.Context, input CreateTemplateInput) (*TemplateDetail, error)
- func (s *Service) CreatePipeline(ctx context.Context, id string) (*models.Pipeline, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) ExportBundle(ctx context.Context) (*TemplateBundle, error)
- func (s *Service) ExportTemplate(ctx context.Context, id string) (*TemplateDocument, error)
- func (s *Service) Get(ctx context.Context, id string) (*TemplateDetail, error)
- func (s *Service) Import(ctx context.Context, raw []byte) (*ImportResult, error)
- func (s *Service) List(ctx context.Context) ([]TemplateSummary, error)
- type TemplateBundle
- type TemplateDetail
- type TemplateDocument
- type TemplateStore
- type TemplateSummary
Constants ¶
View Source
const ( DocumentVersion = "v1" KindPipeline = "emerald-pipeline" KindTemplate = "emerald-template" KindTemplateBundle = "emerald-template-bundle" DefaultCategory = "custom" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateTemplateInput ¶
type CreateTemplateInput struct {
Name string
Description *string
Category string
Definition Definition
}
type Definition ¶
type Definition struct {
Nodes json.RawMessage `json:"nodes"`
Edges json.RawMessage `json:"edges"`
Viewport json.RawMessage `json:"viewport,omitempty"`
}
type DefinitionValidator ¶
type ImportFailure ¶
type ImportResult ¶
type ImportResult struct {
Created []TemplateSummary `json:"created"`
Errors []ImportFailure `json:"errors"`
CreatedCount int `json:"created_count"`
FailedCount int `json:"failed_count"`
}
type PipelineCreator ¶
type PipelineDocument ¶
type PipelineDocument struct {
Version string `json:"version"`
Kind string `json:"kind"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Status string `json:"status,omitempty"`
Definition Definition `json:"definition"`
}
func BuildPipelineDocument ¶
func BuildPipelineDocument(pipelineModel models.Pipeline) (*PipelineDocument, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(templates TemplateStore, pipelines PipelineCreator, validators ...DefinitionValidator) *Service
func (*Service) Create ¶
func (s *Service) Create(ctx context.Context, input CreateTemplateInput) (*TemplateDetail, error)
func (*Service) CreatePipeline ¶
func (*Service) ExportBundle ¶
func (s *Service) ExportBundle(ctx context.Context) (*TemplateBundle, error)
func (*Service) ExportTemplate ¶
type TemplateBundle ¶
type TemplateBundle struct {
Version string `json:"version"`
Kind string `json:"kind"`
Templates []TemplateDocument `json:"templates"`
}
type TemplateDetail ¶
type TemplateDocument ¶
type TemplateDocument struct {
Version string `json:"version"`
Kind string `json:"kind"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Definition Definition `json:"definition"`
}
func BuildTemplateDocument ¶
func BuildTemplateDocument(template models.Template) (*TemplateDocument, error)
type TemplateStore ¶
Click to show internal directories.
Click to hide internal directories.