Documentation
¶
Overview ¶
Package workflows runs project-owned JavaScript against a narrow document API.
Index ¶
- Variables
- func Definitions(dir string) ([]string, error)
- type Change
- type Definition
- type Invocation
- type ModelFunc
- type Run
- type Service
- func (s *Service) Decide(ctx context.Context, dir, id, decision string) (Run, error)
- func (s *Service) Get(ctx context.Context, dir, id string) (Run, error)
- func (s *Service) Recent(ctx context.Context, dir string) ([]Run, error)
- func (s *Service) Run(ctx context.Context, dir string, invocation Invocation) (Run, error)
- func (s *Service) Save(dir string, d Definition) (Definition, error)
- type Usage
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConflict = errors.New("workflow conflict")
Functions ¶
func Definitions ¶
Types ¶
type Definition ¶
type Definition struct {
Name string `json:"name"`
Source string `json:"source"`
Revision string `json:"revision"`
}
func Load ¶
func Load(dir, name string) (Definition, error)
type Invocation ¶
type Invocation struct {
Name, Revision, ID, Origin string
EventNID int64
Payload json.RawMessage
}
type Run ¶
type Run struct {
EventNID int64 `json:"eventNid,omitempty"`
RequireLatest bool `json:"requireLatest,omitempty"`
HasPacket bool `json:"hasPacket,omitempty"`
ID string `json:"id"`
Name string `json:"name"`
Revision string `json:"revision"`
Origin string `json:"origin"`
Status string `json:"status"`
Summary string `json:"summary"`
Error string `json:"error,omitempty"`
Created time.Time `json:"created"`
Updated time.Time `json:"updated"`
Changes []Change `json:"changes,omitempty"`
Model *Usage `json:"model,omitempty"`
}
type Service ¶
type Service struct {
DB libdb.DBManager
WorkspaceID string
Model ModelFunc
AuthorizeRead func(context.Context, string) error
// contains filtered or unexported fields
}
func (*Service) Save ¶
func (s *Service) Save(dir string, d Definition) (Definition, error)
Click to show internal directories.
Click to hide internal directories.