runner

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package runner package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequireViewerAccessToRunnerResource added in v0.23.2

func RequireViewerAccessToRunnerResource(ctx context.Context, runner *models.Runner) error

RequireViewerAccessToRunnerResource checks if the caller has viewer access to a runner's resource like sessions, jobs, logs, etc.

Types

type CreateRunnerInput

type CreateRunnerInput struct {
	GroupID     string
	Disabled    *bool
	Name        string
	Description string
}

CreateRunnerInput is the input for creating a new runner

type CreateRunnerSessionInput added in v0.17.0

type CreateRunnerSessionInput struct {
	RunnerPath string
	Internal   bool
}

CreateRunnerSessionInput is the input for creating a new runner session.

type GetRunnerSessionsInput added in v0.17.0

type GetRunnerSessionsInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.RunnerSessionSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// RunnerID is the runner to return sessions for
	RunnerID string
}

GetRunnerSessionsInput is the input for querying a list of runner sessions

type GetRunnersInput

type GetRunnersInput struct {
	// Sort specifies the field to sort on and direction
	Sort *db.RunnerSortableField
	// PaginationOptions supports cursor based pagination
	PaginationOptions *pagination.Options
	// NamespacePath is the namespace to return runners for
	NamespacePath *string
	// RunnerType is the type of runner to return
	RunnerType *models.RunnerType
	// IncludeInherited includes inherited runners in the result
	IncludeInherited bool
}

GetRunnersInput is the input for querying a list of runners

type Service

type Service interface {
	GetRunnerByPath(ctx context.Context, path string) (*models.Runner, error)
	GetRunnerByID(ctx context.Context, id string) (*models.Runner, error)
	GetRunners(ctx context.Context, input *GetRunnersInput) (*db.RunnersResult, error)
	GetRunnersByIDs(ctx context.Context, idList []string) ([]models.Runner, error)
	CreateRunner(ctx context.Context, input *CreateRunnerInput) (*models.Runner, error)
	UpdateRunner(ctx context.Context, runner *models.Runner) (*models.Runner, error)
	DeleteRunner(ctx context.Context, runner *models.Runner) error
	AssignServiceAccountToRunner(ctx context.Context, serviceAccountID string, runnerID string) error
	UnassignServiceAccountFromRunner(ctx context.Context, serviceAccountID string, runnerID string) error
	CreateRunnerSession(ctx context.Context, input *CreateRunnerSessionInput) (*models.RunnerSession, error)
	GetRunnerSessions(ctx context.Context, input *GetRunnerSessionsInput) (*db.RunnerSessionsResult, error)
	GetRunnerSessionByID(ctx context.Context, id string) (*models.RunnerSession, error)
	AcceptRunnerSessionHeartbeat(ctx context.Context, sessionID string) error
	CreateRunnerSessionError(ctx context.Context, runnerSessionID string, message string) error
	ReadRunnerSessionErrorLog(ctx context.Context, runnerSessionID string, startOffset int, limit int) ([]byte, error)
	SubscribeToRunnerSessionErrorLog(ctx context.Context, options *SubscribeToRunnerSessionErrorLogInput) (<-chan *logstream.LogEvent, error)
	GetLogStreamsByRunnerSessionIDs(ctx context.Context, idList []string) ([]models.LogStream, error)
	SubscribeToRunnerSessions(ctx context.Context, options *SubscribeToRunnerSessionsInput) (<-chan *SessionEvent, error)
}

Service implements all runner related functionality

func NewService

func NewService(
	logger logger.Logger,
	dbClient *db.Client,
	limitChecker limits.LimitChecker,
	activityService activityevent.Service,
	logStreamManager logstream.Manager,
	eventManager *events.EventManager,
) Service

NewService creates an instance of Service

type SessionEvent added in v0.17.0

type SessionEvent struct {
	RunnerSession *models.RunnerSession
	Action        string
}

SessionEvent is a runner session event

type SubscribeToRunnerSessionErrorLogInput added in v0.17.0

type SubscribeToRunnerSessionErrorLogInput struct {
	LastSeenLogSize *int
	RunnerSessionID string
}

SubscribeToRunnerSessionErrorLogInput includes options for setting up a log event subscription

type SubscribeToRunnerSessionsInput added in v0.17.0

type SubscribeToRunnerSessionsInput struct {
	GroupID    *string
	RunnerID   *string
	RunnerType *models.RunnerType
}

SubscribeToRunnerSessionsInput is the input for subscribing to runner sessions

Jump to

Keyboard shortcuts

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