Documentation
¶
Overview ¶
Package models contains the models and auto generated models for the app.
Index ¶
- Constants
- Variables
- func CreateLineWriter(write func(ownerID, message string, a ...interface{}) string, ownerID string, ...) io.WriteCloser
- func WithModelContext(ctx context.Context, mc *ModelContext) context.Context
- type DateTime
- type DirectorySource
- type DirectorySourceConfig
- type GitSource
- type GitSourceConfig
- type Hash
- type Job
- type JobManager
- type KeysConfig
- func (c *KeysConfig) DeleteKey(nodes *NodeManager, subs *pubsub.PubSub, userID string, id string) error
- func (c KeysConfig) Save() error
- func (c *KeysConfig) UpsertKey(nodes *NodeManager, subs *pubsub.PubSub, userID string, input KeyInput) string
- func (c *KeysConfig) UpsertNodes(nodes *NodeManager, subs *pubsub.PubSub, userID string) error
- type LogEntry
- type Logger
- func (l *Logger) Add(level LogLevel, ownerID string, message string) (string, error)
- func (l *Logger) Debug(message string, a ...interface{}) string
- func (l *Logger) DebugWithOwner(ownerID string, message string, a ...interface{}) string
- func (l *Logger) Error(message string, a ...interface{}) string
- func (l *Logger) ErrorWithOwner(ownerID string, message string, a ...interface{}) string
- func (l *Logger) Info(message string, a ...interface{}) string
- func (l *Logger) InfoWithOwner(ownerID string, message string, a ...interface{}) string
- func (l *Logger) Warning(message string, a ...interface{}) string
- func (l *Logger) WarningWithOwner(ownerID string, message string, a ...interface{}) string
- type ModelContext
- type Node
- type NodeManager
- type Process
- type ProcessGroup
- type ProcessManager
- func (p *ProcessManager) Clean(ctx context.Context)
- func (p *ProcessManager) CreateGroup(ctx context.Context, taskID string) string
- func (p *ProcessManager) Run(ctx context.Context, command string, env []string, processGroupID string, ...) string
- func (p *ProcessManager) Start(ctx context.Context, processID string) error
- func (p *ProcessManager) Stop(ctx context.Context, processID string) error
- type Project
- type ProjectCachePathGetter
- type ProjectConfig
- type ProjectGitSourcePathGetter
- type ProjectPathGetter
- type Source
- type SourcesConfig
- func (c *SourcesConfig) DeleteSource(nodes *NodeManager, subs *pubsub.PubSub, userID string, id string) error
- func (c SourcesConfig) Save() error
- func (c *SourcesConfig) UpsertDirectorySource(nodes *NodeManager, subs *pubsub.PubSub, userID string, ...) string
- func (c *SourcesConfig) UpsertGitSource(nodes *NodeManager, subs *pubsub.PubSub, userID string, input GitSourceInput) string
- func (c *SourcesConfig) UpsertNodes(nodes *NodeManager, subs *pubsub.PubSub, userID string) error
- type Step
- func (s Step) Commands(ctx context.Context, after *string, before *string, first *int, last *int) (CommandConnection, error)
- func (Step) IsNode()
- func (s Step) Projects(ctx context.Context, after *string, before *string, first *int, last *int) (ProjectConnection, error)
- func (s Step) Task(ctx context.Context) Task
- type StepConfig
- type System
- func (System) IsNode()
- func (s System) JobMetrics(ctx context.Context) JobMetrics
- func (s System) Jobs(ctx context.Context, after *string, before *string, first *int, last *int, ...) (JobConnection, error)
- func (s System) LastMessageID(ctx context.Context) string
- func (s System) LogEntries(ctx context.Context, after *string, before *string, first *int, last *int, ...) (LogEntryConnection, error)
- func (s System) LogMetrics(ctx context.Context) LogMetrics
- func (s System) ProcessGroups(ctx context.Context, after *string, before *string, first *int, last *int, ...) (ProcessGroupConnection, error)
- func (s System) ProcessMetrics(ctx context.Context) ProcessMetrics
- type Task
- func (Task) IsNode()
- func (t Task) Steps(ctx context.Context, after *string, before *string, first *int, last *int) (StepConnection, error)
- func (t Task) Variables(ctx context.Context, after *string, before *string, first *int, last *int) (VariableConnection, error)
- func (t Task) Workspace(ctx context.Context) Workspace
- type TaskConfig
- type User
- func (User) IsNode()
- func (u User) Keys(ctx context.Context, after *string, before *string, first *int, last *int) (KeyConnection, error)
- func (u User) Projects(ctx context.Context, after *string, before *string, first *int, last *int) (ProjectConnection, error)
- func (u User) Sources(ctx context.Context, after *string, before *string, first *int, last *int) (SourceConnection, error)
- func (u User) Workspace(ctx context.Context, slug string) *Workspace
- func (u User) WorkspaceIDs(ctx context.Context) []string
- func (u User) Workspaces(ctx context.Context, after *string, before *string, first *int, last *int) (WorkspaceConnection, error)
- type VariableConfig
- type Workspace
- func (w Workspace) IsAhead(ctx context.Context) bool
- func (w Workspace) IsBehind(ctx context.Context) bool
- func (w Workspace) IsCloned(ctx context.Context) bool
- func (w Workspace) IsCloning(ctx context.Context) bool
- func (Workspace) IsNode()
- func (w Workspace) IsPulling(ctx context.Context) bool
- func (w Workspace) Projects(ctx context.Context, after *string, before *string, first *int, last *int) (ProjectConnection, error)
- func (w Workspace) Tasks(ctx context.Context, after *string, before *string, first *int, last *int) (TaskConnection, error)
- type WorkspaceConfig
- type WorkspacesConfig
Constants ¶
const ( SourceUpserted = "SOURCE_UPSERTED" SourceDeleted = "SOURCE_DELETED" WorkspaceUpserted = "WORKSPACE_UPSERTED" ProjectUpserted = "PROJECT_UPSERTED" TaskUpserted = "TASK_UPSERTED" KeyUpserted = "KEY_UPSERTED" KeyDeleted = "KEY_DELETED" JobUpserted = "JOB_UPSERTED" JobMetricsUpdated = "JOB_METRICS_UPDATED" ProcessGroupUpserted = "PROCESS_GROUP_UPSERTED" ProcessUpserted = "PROCESS_UPSERTED" ProcessMetricsUpdated = "PROCESS_METRICS_UPDATED" LogEntryAdded = "LOG_ENTRY_ADDED" LogMetricsUpdated = "LOG_METRICS_UPDATED" )
Message types.
const DateFormat = "2006-01-02T15:04:05-0700"
DateFormat is the date format used throughout the app.
Variables ¶
var ( ErrNotFound = errors.New("not found") ErrType = errors.New("wrong type") ErrFirstNegative = errors.New("first cannot be negative") ErrLastNegative = errors.New("last cannot be negative") ErrNotRunning = errors.New("project isn't running") ErrNotStopped = errors.New("project isn't stopped") )
Errors.
Functions ¶
func CreateLineWriter ¶
func CreateLineWriter( write func(ownerID, message string, a ...interface{}) string, ownerID string, a ...interface{}, ) io.WriteCloser
CreateLineWriter creates a writer with a line splitter. Remember to call close().
func WithModelContext ¶ added in v0.1.5
func WithModelContext(ctx context.Context, mc *ModelContext) context.Context
WithModelContext adds a model context to a Go context.
Types ¶
type DateTime ¶
DateTime holds a date.
func (DateTime) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface.
func (*DateTime) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Marshaler interface.
type DirectorySource ¶ added in v0.2.0
type DirectorySource struct {
// The global ID of the node.
ID string `json:"id"`
// The IDs of the workspaces.
WorkspaceIDs []string `json:"workspaceIds"`
// Whether currently loading workspaces.
IsLoading bool `json:"isLoading"`
// The path to the directory containing the workspaces.
Directory string `json:"directory"`
}
DirectorySource is a collection of workspaces in a directory.
func (DirectorySource) GetWorkspaceIDs ¶ added in v0.2.0
func (n DirectorySource) GetWorkspaceIDs() []string
GetWorkspaceIDs returns the IDs of the workspaces.
func (DirectorySource) IsNode ¶ added in v0.2.0
func (DirectorySource) IsNode()
IsNode tells gqlgen that it implements Node.
func (DirectorySource) IsSource ¶ added in v0.2.0
func (DirectorySource) IsSource()
IsSource tells gqlgen that it implements Source.
func (DirectorySource) Workspaces ¶ added in v0.2.0
func (n DirectorySource) Workspaces( ctx context.Context, after *string, before *string, first *int, last *int, ) (WorkspaceConnection, error)
Workspaces are the workspaces using Relay pagination.
type DirectorySourceConfig ¶ added in v0.2.0
type DirectorySourceConfig struct {
Directory string `json:"directory"`
ID string `json:"-" yaml:"-"`
}
DirectorySourceConfig contains all the data in a YAML directory source config file.
type GitSource ¶ added in v0.2.0
type GitSource struct {
// The global ID of the node.
ID string `json:"id"`
// The IDs of the workspaces.
WorkspaceIDs []string `json:"workspaceIds"`
// Whether currently loading workspaces.
IsLoading bool `json:"isLoading"`
// The Git repository.
Repository string `json:"repository"`
// The Git branch.
Branch string `json:"branch"`
}
GitSource is a collection of workspaces in a Git repository.
func (GitSource) GetWorkspaceIDs ¶ added in v0.2.0
GetWorkspaceIDs returns the IDs of the workspaces.
func (GitSource) IsNode ¶ added in v0.2.0
func (GitSource) IsNode()
IsNode tells gqlgen that it implements Node.
type GitSourceConfig ¶ added in v0.2.0
type GitSourceConfig struct {
Repository string `json:"repository"`
Branch string `json:"branch"`
ID string `json:"-" yaml:"-"`
}
GitSourceConfig contains all the data in a YAML Git source config file.
type Hash ¶
type Hash string
Hash holds a Git hash. TODO: change to bytes.
func (Hash) MarshalGQL ¶
MarshalGQL implements the graphql.Marshaler interface.
func (*Hash) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Marshaler interface.
type Job ¶
type Job struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt DateTime `json:"createdAt"`
UpdatedAt DateTime `json:"updatedAt"`
Status JobStatus `json:"status"`
Priority JobPriority `json:"priority"`
OwnerID string `json:"ownerId"`
}
Job represents a job in the app.
type JobManager ¶
type JobManager struct {
// contains filtered or unexported fields
}
JobManager manages creating and running jobs.
func NewJobManager ¶
func NewJobManager(concurrency int) *JobManager
NewJobManager creates a JobManager with given concurrency.
func (*JobManager) Add ¶
func (j *JobManager) Add( modelCtx *ModelContext, name string, ownerID string, priority JobPriority, fn func(ctx context.Context) error, ) string
Add adds a job to the queue and returns the job's ID.
func (*JobManager) Stop ¶
func (j *JobManager) Stop(modelCtx *ModelContext, id string) error
Stop cancels a running job.
type KeysConfig ¶ added in v0.3.0
type KeysConfig struct {
Filename string `json:"-" yaml:"-"`
Keys map[string]string `json:"keys" yaml:"keys"`
}
KeysConfig contains all the data in a YAML keys config file.
func LoadKeysConfigYAML ¶ added in v0.3.0
func LoadKeysConfigYAML(filename string) (*KeysConfig, error)
LoadKeysConfigYAML loads a key config from a YAML file. It will create a file if it doesn't exist.
func (*KeysConfig) DeleteKey ¶ added in v0.3.0
func (c *KeysConfig) DeleteKey( nodes *NodeManager, subs *pubsub.PubSub, userID string, id string, ) error
DeleteKey deletes a key.
func (KeysConfig) Save ¶ added in v0.3.0
func (c KeysConfig) Save() error
Save saves the config to disk, overwriting the file if it exists.
func (*KeysConfig) UpsertKey ¶ added in v0.3.0
func (c *KeysConfig) UpsertKey( nodes *NodeManager, subs *pubsub.PubSub, userID string, input KeyInput, ) string
UpsertKey upserts a key. It returns the ID of the key.
func (*KeysConfig) UpsertNodes ¶ added in v0.3.0
func (c *KeysConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, userID string, ) error
UpsertNodes upserts nodes for the content of the keys config. The user node must already exists.
type LogEntry ¶
type LogEntry struct {
ID string `json:"id"`
Level LogLevel `json:"level"`
CreatedAt DateTime `json:"createdAt"`
Message string `json:"message"`
OwnerID string `json:"ownerId"`
}
LogEntry represents a log entry in the app.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger logs messages.
func NewLogger ¶
func NewLogger( nodes *NodeManager, subs *pubsub.PubSub, cap int, level LogLevel, systemID string, ) *Logger
NewLogger creates a Logger with given capacity and level.
func (*Logger) DebugWithOwner ¶
DebugWithOwner adds a debug entry with an owner.
func (*Logger) ErrorWithOwner ¶
ErrorWithOwner adds an error entry with an owner.
func (*Logger) InfoWithOwner ¶
InfoWithOwner adds an info entry with an owner.
type ModelContext ¶ added in v0.1.5
type ModelContext struct {
Nodes *NodeManager
Log *Logger
Jobs *JobManager
PM *ProcessManager
Subs *pubsub.PubSub
Sources *SourcesConfig
Keys *KeysConfig
GetGitSourcePath ProjectGitSourcePathGetter
GetProjectPath ProjectPathGetter
GetProjectCachePath ProjectCachePathGetter
ViewerID string
SystemID string
}
ModelContext contains variables that are passed to model functions.
func GetModelContext ¶ added in v0.1.5
func GetModelContext(ctx context.Context) *ModelContext
GetModelContext retrieves the model context from a Go context.
type Node ¶ added in v0.2.0
type Node interface {
IsNode()
GetID() string
}
Node represents a Relay node.
type NodeManager ¶
type NodeManager struct {
// contains filtered or unexported fields
}
NodeManager helps manage nodes with global IDs.
func (*NodeManager) MustLoad ¶
func (n *NodeManager) MustLoad(id string) Node
MustLoad loads a node or panics if it doesn't exist.
func (*NodeManager) MustLoadSource ¶ added in v0.2.0
func (n *NodeManager) MustLoadSource(id string) Source
MustLoadSource loads a Source or panics on failure.
func (*NodeManager) Unlock ¶
func (n *NodeManager) Unlock(ids ...string)
Unlock unlocks the given IDs.
type Process ¶
type Process struct {
ID string `json:"id"`
Command string `json:"command"`
// Env is the environment of the process.
// Each entry is of the form "key=value".
Env []string `json:"env"`
ProcessGroupID string `json:"processGroupId"`
ProjectID string `json:"projectId"`
Status ProcessStatus `json:"status"`
}
Process represents a process in the app.
func (Process) ProcessGroup ¶
func (p Process) ProcessGroup(ctx context.Context) ProcessGroup
ProcessGroup returns the ProcessGroup associated with the Process.
type ProcessGroup ¶
type ProcessGroup struct {
ID string `json:"id"`
CreatedAt DateTime `json:"createdAt"`
TaskID string `json:"taskId"`
ProcessIDs []string `json:"processIds"`
}
ProcessGroup represents a ProcessGroup in the app.
func (ProcessGroup) IsNode ¶
func (ProcessGroup) IsNode()
IsNode tells gqlgen that it implements Node.
func (ProcessGroup) Processes ¶
func (p ProcessGroup) Processes( ctx context.Context, after *string, before *string, first *int, last *int, ) (ProcessConnection, error)
Processes returns the ProcessGroup's processes.
func (ProcessGroup) Status ¶
func (p ProcessGroup) Status(ctx context.Context) ProcessStatus
Status returns the status of the ProcessGroup.
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
ProcessManager manages creating and running jobs.
func NewProcessManager ¶
func NewProcessManager() *ProcessManager
NewProcessManager creates a ProcessManager.
func (*ProcessManager) Clean ¶
func (p *ProcessManager) Clean(ctx context.Context)
Clean terminates all running processes.
func (*ProcessManager) CreateGroup ¶
func (p *ProcessManager) CreateGroup(ctx context.Context, taskID string) string
CreateGroup creates a new ProcessGroup and returns its ID.
func (*ProcessManager) Run ¶
func (p *ProcessManager) Run( ctx context.Context, command string, env []string, processGroupID string, projectID string, ) string
Run launches a new Process and adds it to a ProcessGroup.
type Project ¶
type Project struct {
ID string `json:"id"`
Slug string `json:"slug"`
Repository string `json:"repository"`
Branch string `json:"branch"`
Description *string `json:"description"`
WorkspaceID string `json:"workspaceId"`
CommitIDs []string `json:"commitIds"`
Tasks []Task `json:"projects"`
IsLoadingCommits bool `json:"isLoadingCommits"`
IsCloning bool `json:"isCloning"`
IsPulling bool `json:"isPulling"`
IsBehind bool `json:"isBehind"`
IsAhead bool `json:"isAhead"`
}
Project represents a project in the app.
func (Project) Commits ¶
func (p Project) Commits( ctx context.Context, after *string, before *string, first *int, last *int, ) (CommitConnection, error)
Commits returns paginated commits.
type ProjectCachePathGetter ¶ added in v0.1.5
ProjectCachePathGetter is a function that returns the path to a project's cache.
type ProjectConfig ¶ added in v0.2.0
type ProjectConfig struct {
Slug string `json:"slug"`
Repository string `json:"repository"`
Branch string `json:"branch"`
Description *string `json:"description"`
}
ProjectConfig contains all the data in a YAML project config file.
func (ProjectConfig) UpsertNodes ¶ added in v0.2.0
func (c ProjectConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, workspaceID string, workspaceSlug string, ) string
UpsertNodes upserts nodes for the content of the config. It returns the ID of the project upserted.
type ProjectGitSourcePathGetter ¶ added in v0.2.0
ProjectGitSourcePathGetter is a function that returns the path to a Git source.
type ProjectPathGetter ¶
ProjectPathGetter is a function that returns the path to a project.
type Source ¶ added in v0.2.0
type Source interface {
Node
IsSource()
// GetWorkspaceIDs returns the IDs of the workspaces.
GetWorkspaceIDs() []string
// Workspaces are the workspaces using Relay pagination.
Workspaces(
ctx context.Context,
after *string,
before *string,
first *int,
last *int,
) (WorkspaceConnection, error)
}
Source is a collection of workspaces.
type SourcesConfig ¶ added in v0.2.0
type SourcesConfig struct {
Filename string `json:"-" yaml:"-"`
DirectorySources []DirectorySourceConfig `json:"directorySources" yaml:"directory-sources"`
GitSources []GitSourceConfig `json:"gitSources" yaml:"git-sources"`
}
SourcesConfig contains all the data in a YAML sources config file.
func LoadSourcesConfigYAML ¶ added in v0.2.0
func LoadSourcesConfigYAML(filename string) (*SourcesConfig, error)
LoadSourcesConfigYAML loads a source config from a YAML file. It will create a file if it doesn't exist.
func (*SourcesConfig) DeleteSource ¶ added in v0.2.0
func (c *SourcesConfig) DeleteSource( nodes *NodeManager, subs *pubsub.PubSub, userID string, id string, ) error
DeleteSource deletes a source.
func (SourcesConfig) Save ¶ added in v0.2.0
func (c SourcesConfig) Save() error
Save saves the config to disk, overwriting the file if it exists.
func (*SourcesConfig) UpsertDirectorySource ¶ added in v0.2.0
func (c *SourcesConfig) UpsertDirectorySource( nodes *NodeManager, subs *pubsub.PubSub, userID string, input DirectorySourceInput, ) string
UpsertDirectorySource upserts a directory source. It returns the ID of the source.
func (*SourcesConfig) UpsertGitSource ¶ added in v0.2.0
func (c *SourcesConfig) UpsertGitSource( nodes *NodeManager, subs *pubsub.PubSub, userID string, input GitSourceInput, ) string
UpsertGitSource upserts a repository source. It returns the ID of the source.
func (*SourcesConfig) UpsertNodes ¶ added in v0.2.0
func (c *SourcesConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, userID string, ) error
UpsertNodes upserts nodes for the content of the sources config. The user node must already exists.
type Step ¶
type Step struct {
ID string `json:"id"`
ProjectIDs []string `json:"projectIds"`
CommandIDs []string `json:"commandIds"`
TaskID string `json:"taskId"`
}
Step represents a task step in the app.
func (Step) Commands ¶
func (s Step) Commands( ctx context.Context, after *string, before *string, first *int, last *int, ) (CommandConnection, error)
Commands returns the step's commands.
type StepConfig ¶ added in v0.2.0
StepConfig contains all the data in a YAML step config file.
func (StepConfig) UpsertNodes ¶ added in v0.2.0
func (c StepConfig) UpsertNodes( nodes *NodeManager, workspaceSlug string, taskID string, taskName string, stepIndex int, projectSlugToID map[string]string, ) (string, error)
UpsertNodes upserts nodes for the content of the config. It returns the ID of the step upserted.
type System ¶
type System struct {
ID string `json:"id"`
JobIDs []string `json:"jobsIds"`
JobMetricsID string `json:"jobMetricsId"`
ProcessGroupIDs []string `json:"processGroupIds"`
ProcessMetricsID string `json:"processMetricsId"`
LogEntryIDs []string `json:"logEntryIds"`
LogMetricsID string `json:"logMetricsId"`
}
System contains information about the running app.
func (System) JobMetrics ¶
JobMetrics returns the JobMetrics node.
func (System) Jobs ¶
func (s System) Jobs( ctx context.Context, after *string, before *string, first *int, last *int, status []JobStatus, ) (JobConnection, error)
Jobs returns paginated jobs.
func (System) LastMessageID ¶ added in v0.2.2
LastMessageID is the ID of the last message which can be used for subscriptions.
func (System) LogEntries ¶
func (s System) LogEntries( ctx context.Context, after *string, before *string, first *int, last *int, level []LogLevel, ownerID *string, ) (LogEntryConnection, error)
LogEntries returns paginated log entries.
func (System) LogMetrics ¶
LogMetrics returns the LogMetrics node.
func (System) ProcessGroups ¶
func (s System) ProcessGroups( ctx context.Context, after *string, before *string, first *int, last *int, status []ProcessStatus, ) (ProcessGroupConnection, error)
ProcessGroups returns paginated process groups.
func (System) ProcessMetrics ¶
ProcessMetrics returns the ProcessMetrics node.
type Task ¶
type Task struct {
ID string `json:"id"`
Name string `json:"name"`
VariableIDs []string `json:"variableIds"`
StepIDs []string `json:"stepIds"`
WorkspaceID string `json:"workspace"`
IsRunning bool `json:"isRunning"`
}
Task represents a workspace task in the app.
func (Task) Steps ¶
func (t Task) Steps( ctx context.Context, after *string, before *string, first *int, last *int, ) (StepConnection, error)
Steps returns the task's steps.
type TaskConfig ¶ added in v0.2.0
type TaskConfig struct {
Name string `json:"name"`
Variables []VariableConfig `json:"variables"`
Steps []StepConfig `json:"tasks"`
}
TaskConfig contains all the data in a YAML task config file.
func (TaskConfig) UpsertNodes ¶ added in v0.2.0
func (c TaskConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, workspaceID string, workspaceSlug string, projectSlugToID map[string]string, ) (string, error)
UpsertNodes upserts nodes for the content of the config. It returns the ID of the task upserted.
type User ¶
type User struct {
ID string `json:"id"`
SourceIDs []string `json:"sourceIds"`
KeyIDs []string `json:"keyIds"`
}
User contains all the data of the person using the app.
func (User) Keys ¶ added in v0.3.0
func (u User) Keys( ctx context.Context, after *string, before *string, first *int, last *int, ) (KeyConnection, error)
Keys returns the user's keys.
func (User) Projects ¶
func (u User) Projects( ctx context.Context, after *string, before *string, first *int, last *int, ) (ProjectConnection, error)
Projects returns the user's projects.
func (User) Sources ¶ added in v0.2.0
func (u User) Sources( ctx context.Context, after *string, before *string, first *int, last *int, ) (SourceConnection, error)
Sources returns the user's sources.
func (User) WorkspaceIDs ¶
WorkspaceIDs returns the user's workspace IDs.
type VariableConfig ¶ added in v0.3.0
VariableConfig contains all the data in a YAML variable config file.
func (VariableConfig) UpsertNodes ¶ added in v0.3.0
func (c VariableConfig) UpsertNodes( nodes *NodeManager, workspaceSlug string, taskID string, taskName string, stepIndex int, ) string
UpsertNodes upserts nodes for the content of the config. It returns the ID of the variable upserted.
type Workspace ¶
type Workspace struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
ProjectIDs []string `json:"projectIds"`
TaskIDs []string `json:"taskIds"`
Description string `json:"description"`
Notes *string `json:"notes"`
}
Workspace represents a workspace in the app.
type WorkspaceConfig ¶ added in v0.2.0
type WorkspaceConfig struct {
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
Notes *string `json:"notes"`
Projects []ProjectConfig `json:"projects" yaml:",flow"`
Tasks []TaskConfig `json:"tasks"`
}
WorkspaceConfig contains all the data in a YAML workspace config file.
func (WorkspaceConfig) UpsertNodes ¶ added in v0.2.0
func (c WorkspaceConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, ) (string, error)
UpsertNodes upserts nodes for the content of the config. It returns the ID of the workspace upserted.
type WorkspacesConfig ¶ added in v0.2.0
type WorkspacesConfig struct {
Filename string `json:"-" yaml:"-"`
Workspaces []WorkspaceConfig `json:"workspaces"`
}
WorkspacesConfig contains all the data in a YAML workspaces config file.
func LoadWorkspacesConfigYAML ¶ added in v0.2.0
func LoadWorkspacesConfigYAML(filename string) (WorkspacesConfig, error)
LoadWorkspacesConfigYAML loads a config from a YAML file.
func (WorkspacesConfig) UpsertNodes ¶ added in v0.2.0
func (c WorkspacesConfig) UpsertNodes( nodes *NodeManager, subs *pubsub.PubSub, ) ([]string, error)
UpsertNodes upserts nodes for the content of the config. It returns the IDs of the workspaces upserted.