agent

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package agent provides the agent that will claim and run the jobs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

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

Agent will claim the next available job and dispatch it using the configured job dispatcher

func NewAgent

func NewAgent(
	ctx context.Context,
	agentID string,
	logger logger.Logger,
	version string,
	client Client,
	jobDispatcherSettings *JobDispatcherSettings,
) (*Agent, error)

NewAgent creates a new Agent

func (*Agent) Start

func (r *Agent) Start(ctx context.Context)

Start will start the agent so it can begin picking up jobs

type ClaimJobInput

type ClaimJobInput struct {
	AgentID string
}

ClaimJobInput is the input for claiming the next available job

type ClaimJobResponse

type ClaimJobResponse struct {
	JobID         string
	Token         string
	ImageOverride *string
}

ClaimJobResponse is the response when claiming a job

type Client

type Client interface {
	CreateSession(ctx context.Context, agentID string) (string, error)
	SendHeartbeat(ctx context.Context, sessionID string) error
	ClaimJob(ctx context.Context, input *ClaimJobInput) (*ClaimJobResponse, error)
	SendError(ctx context.Context, sessionID string, err error) error
}

Client interface for claiming a job

func NewInternalClient

func NewInternalClient(agentService agent.Service, jobService job.Service) Client

NewInternalClient creates a new internal client

type InternalTokenProvider added in v0.39.0

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

InternalTokenProvider is a token provider for internal agents

func NewInternalTokenProvider added in v0.39.0

func NewInternalTokenProvider(agentName, agentID string, signingKeyManager auth.SigningKeyManager) *InternalTokenProvider

NewInternalTokenProvider creates a new InternalTokenProvider for internal agents.

func (*InternalTokenProvider) GetToken added in v0.39.0

func (i *InternalTokenProvider) GetToken(ctx context.Context) (string, error)

GetToken retrieves an ID token for the internal agent, generating a new one if the current one is expired.

type JobDispatcherSettings

type JobDispatcherSettings struct {
	PluginData      map[string]string
	DispatcherType  string
	TokenGetterFunc types.TokenGetterFunc
}

JobDispatcherSettings defines the job dispatcher that'll be used for this agent

Directories

Path Synopsis
Package jobdispatcher package
Package jobdispatcher package
docker
Package docker package
Package docker package
ecs
Package ecs package
Package ecs package
kubernetes
Package kubernetes package
Package kubernetes package
kubernetes/configurer
Package configurer package
Package configurer package
kubernetes/configurer/cert
Package cert provides a Kubernetes configurer that uses TLS certificates for authentication.
Package cert provides a Kubernetes configurer that uses TLS certificates for authentication.
kubernetes/configurer/configfile
Package configfile provides a Configurer implementation that reads Kubernetes configuration from a specified file.
Package configfile provides a Configurer implementation that reads Kubernetes configuration from a specified file.
kubernetes/configurer/eks
Package eks package
Package eks package
kubernetes/configurer/idtoken
Package idtoken provides a Kubernetes configurer that uses the agent's ID token for authentication.
Package idtoken provides a Kubernetes configurer that uses the agent's ID token for authentication.
kubernetes/configurer/incluster
Package incluster provides a Kubernetes configurer that retrieves the configuration from the pod's environment.
Package incluster provides a Kubernetes configurer that retrieves the configuration from the pod's environment.
local
Package local package
Package local package
Package types provides additional types used by different job dispatchers
Package types provides additional types used by different job dispatchers

Jump to

Keyboard shortcuts

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