usecase

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelWorkflowInput

type CancelWorkflowInput struct {
	Repository string
	WorkflowID int64
}

type CancelWorkflowOutput

type CancelWorkflowOutput struct {
}

type GetTriggerableWorkflowsInput

type GetTriggerableWorkflowsInput struct {
	Repository string
	Branch     string
}

type GetTriggerableWorkflowsOutput

type GetTriggerableWorkflowsOutput struct {
	TriggerableWorkflows []TriggerableWorkflow
}

type GetWorkflowHistoryInput

type GetWorkflowHistoryInput struct {
	Repository string
	Branch     string
}

type GetWorkflowHistoryOutput

type GetWorkflowHistoryOutput struct {
	Workflows []Workflow
}

type GithubRepository

type GithubRepository struct {
	Name          string
	Private       bool
	DefaultBranch string
	Stars         int

	Workflows []Workflow
}

type InspectWorkflowInput

type InspectWorkflowInput struct {
	Repository   string
	Branch       string
	WorkflowFile string
}

type InspectWorkflowOutput

type InspectWorkflowOutput struct {
	Workflow *pw.Pretty
}

type ListRepositoriesInput

type ListRepositoriesInput struct {
	Limit int
}

type ListRepositoriesOutput

type ListRepositoriesOutput struct {
	Repositories []GithubRepository
}

type ReRunFailedJobsInput

type ReRunFailedJobsInput struct {
	Repository string
	WorkflowID int64
}

type ReRunFailedJobsOutput

type ReRunFailedJobsOutput struct {
}

type ReRunWorkflowInput

type ReRunWorkflowInput struct {
	Repository string
	WorkflowID int64
}

type ReRunWorkflowOutput

type ReRunWorkflowOutput struct {
}

type TriggerWorkflowInput

type TriggerWorkflowInput struct {
	WorkflowFile string
	Repository   string
	Branch       string
	Content      string // workflow content in json format
}

type TriggerWorkflowOutput

type TriggerWorkflowOutput struct {
}

type TriggerableWorkflow

type TriggerableWorkflow struct {
	ID   int64
	Name string
	Path string
}

type UseCase

type UseCase interface {
	ListRepositories(ctx context.Context, input ListRepositoriesInput) (*ListRepositoriesOutput, error)
	GetWorkflowHistory(ctx context.Context, input GetWorkflowHistoryInput) (*GetWorkflowHistoryOutput, error)
	GetTriggerableWorkflows(ctx context.Context, input GetTriggerableWorkflowsInput) (*GetTriggerableWorkflowsOutput, error)
	InspectWorkflow(ctx context.Context, input InspectWorkflowInput) (*InspectWorkflowOutput, error)
	TriggerWorkflow(ctx context.Context, input TriggerWorkflowInput) (*TriggerWorkflowOutput, error)
	ReRunFailedJobs(ctx context.Context, input ReRunFailedJobsInput) (*ReRunFailedJobsOutput, error)
	ReRunWorkflow(ctx context.Context, input ReRunWorkflowInput) (*ReRunWorkflowOutput, error)
	CancelWorkflow(ctx context.Context, input CancelWorkflowInput) (*CancelWorkflowOutput, error)
}

func New

func New(githubRepository gr.Repository) UseCase

type Workflow

type Workflow struct {
	ID           int64  // workflow id
	WorkflowName string // workflow name
	ActionName   string // commit message
	TriggeredBy  string // who triggered this workflow
	StartedAt    string // workflow's started at
	Status       string // workflow's status, like success, failure, etc.
	Conclusion   string // workflow's conclusion, like success, failure, etc.
	Duration     string // workflow's duration
}

Jump to

Keyboard shortcuts

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