core

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationStore

type ApplicationStore struct {
	// contains filtered or unexported fields
}

ApplicationStore describes in memory store for applications

func NewApplicationStore

func NewApplicationStore() *ApplicationStore

NewApplicationStore returns an in-memory application store instance

func (*ApplicationStore) Add

Add adds a new application, based on the Application structure provided as argument

func (*ApplicationStore) Delete

func (as *ApplicationStore) Delete(ctx context.Context, name string) error

Delete deletes the application registered by FuseML

func (*ApplicationStore) Find

Find returns a application identified by id

func (*ApplicationStore) GetAll

func (as *ApplicationStore) GetAll(ctx context.Context, applicationType *string, applicationWorkflow *string) ([]*domain.Application, error)

GetAll returns all applications of a given type. If type is not specified, return all applications.

type GitAdmin

type GitAdmin interface {
	PrepareRepository(*domain.Codeset, *string) (*string, *string, error)
	CreateRepoWebhook(string, string, *string) (*int64, error)
	DeleteRepoWebhook(string, string, *int64) error
	GetRepositories(org, label *string) ([]*domain.Codeset, error)
	GetRepository(org, name string) (*domain.Codeset, error)
	DeleteRepository(org, name string) error
}

GitAdmin is an inteface to git administration clients

type GitCodesetStore

type GitCodesetStore struct {
	// contains filtered or unexported fields
}

GitCodesetStore describes a stucture that accesses codeset store implemented in git

func NewGitCodesetStore

func NewGitCodesetStore(gitAdmin GitAdmin) *GitCodesetStore

NewGitCodesetStore returns codeset store instance

func (*GitCodesetStore) Add

Add creates new codeset

func (*GitCodesetStore) CreateWebhook

func (cs *GitCodesetStore) CreateWebhook(ctx context.Context, c *domain.Codeset, listenerURL string) (*int64, error)

CreateWebhook adds a new webhook to a codeset

func (*GitCodesetStore) Delete

func (cs *GitCodesetStore) Delete(ctx context.Context, project, name string) error

Delete removes a codeset identified by project and name

func (*GitCodesetStore) DeleteWebhook added in v0.1.0

func (cs *GitCodesetStore) DeleteWebhook(ctx context.Context, c *domain.Codeset, hookID *int64) error

DeleteWebhook deletes a webhook from a codeset

func (*GitCodesetStore) Find

func (cs *GitCodesetStore) Find(ctx context.Context, project, name string) (*domain.Codeset, error)

Find returns a codeset identified by project and name

func (*GitCodesetStore) GetAll

func (cs *GitCodesetStore) GetAll(ctx context.Context, project, label *string) ([]*domain.Codeset, error)

GetAll returns all codesets matching given project and label

type RunnableStore

type RunnableStore struct {
	// contains filtered or unexported fields
}

RunnableStore describes in memory store for runnables

func NewRunnableStore

func NewRunnableStore() *RunnableStore

NewRunnableStore creates and returns an in-memory runnable store instance

func (*RunnableStore) Find

func (s *RunnableStore) Find(ctx context.Context, id string, kind string, labels map[string]string) (res []*domain.Runnable, err error)

Find returns a list of runnables matching the input query. Runnables may be matched by id, kind or labels. Only runnables that match all the supplied criteria will be returned.

func (*RunnableStore) Get

func (s *RunnableStore) Get(ctx context.Context, id string) (res *domain.Runnable, err error)

Get returns a runnable identified by id

func (*RunnableStore) Register

func (s *RunnableStore) Register(ctx context.Context, r *domain.Runnable) (res *domain.Runnable, err error)

Register adds a new runnable, based on the Runnable structure provided as argument

type WorkflowStore

type WorkflowStore struct {
	// contains filtered or unexported fields
}

WorkflowStore describes in memory store for workflows

func NewWorkflowStore

func NewWorkflowStore() *WorkflowStore

NewWorkflowStore returns an in-memory workflow store instance

func (*WorkflowStore) AddCodesetAssignment added in v0.0.2

func (ws *WorkflowStore) AddCodesetAssignment(ctx context.Context, workflowName string,
	assignedCodeset *domain.AssignedCodeset) []*domain.AssignedCodeset

AddCodesetAssignment adds a codeset to the list of assigned codesets of a workflow if it does not already exists

func (*WorkflowStore) AddWorkflow added in v0.0.2

func (ws *WorkflowStore) AddWorkflow(ctx context.Context, w *workflow.Workflow) (*workflow.Workflow, error)

AddWorkflow adds a new workflow based on the Workflow structure provided as argument

func (*WorkflowStore) DeleteCodesetAssignment added in v0.1.0

func (ws *WorkflowStore) DeleteCodesetAssignment(ctx context.Context, workflowName string, codeset *domain.Codeset) []*domain.AssignedCodeset

DeleteCodesetAssignment deletes a codeset from the list of assigned codesets of a workflow if it exists

func (*WorkflowStore) DeleteWorkflow added in v0.1.0

func (ws *WorkflowStore) DeleteWorkflow(ctx context.Context, name string) error

DeleteWorkflow deletes the workflow from the store

func (*WorkflowStore) GetAssignedCodeset added in v0.1.0

func (ws *WorkflowStore) GetAssignedCodeset(ctx context.Context, workflowName string, codeset *domain.Codeset) *domain.AssignedCodeset

GetAssignedCodeset returns a AssignedCodeset for the Workflow and Codeset

func (*WorkflowStore) GetAssignedCodesets added in v0.0.2

func (ws *WorkflowStore) GetAssignedCodesets(ctx context.Context, workflowName string) []*domain.AssignedCodeset

GetAssignedCodesets returns a list of codesets assigned to the specified workflow

func (*WorkflowStore) GetAssignments added in v0.0.2

func (ws *WorkflowStore) GetAssignments(ctx context.Context, workflowName *string) (result map[string][]*domain.AssignedCodeset)

GetAssignments returns a map of workflows and its assigned codesets

func (*WorkflowStore) GetWorkflow added in v0.0.2

func (ws *WorkflowStore) GetWorkflow(ctx context.Context, name string) *workflow.Workflow

GetWorkflow returns a workflow identified by its name

func (*WorkflowStore) GetWorkflows added in v0.1.0

func (ws *WorkflowStore) GetWorkflows(ctx context.Context, name *string) (result []*workflow.Workflow)

GetWorkflows returns all workflows or the one that matches a given name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL