targets

package
v0.52.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTargetEnvVars added in v0.52.0

func GetTargetEnvVars(target *models.Target, params TargetEnvVarParams) map[string]string

func NewTargetService added in v0.52.0

func NewTargetService(config TargetServiceConfig) services.ITargetService

Types

type TargetEnvVarParams added in v0.52.0

type TargetEnvVarParams struct {
	ApiUrl           string
	ServerUrl        string
	ServerVersion    string
	ClientId         string
	TelemetryEnabled bool
}

type TargetService added in v0.52.0

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

func (*TargetService) Create added in v0.52.0

func (*TargetService) Delete added in v0.52.0

func (s *TargetService) Delete(ctx context.Context, targetId string) error

func (*TargetService) Find added in v0.52.0

func (*TargetService) ForceDelete added in v0.52.0

func (s *TargetService) ForceDelete(ctx context.Context, targetId string) error

ForceDelete ignores provider errors and makes sure the target is deleted from storage.

func (*TargetService) GetTargetLogReader added in v0.52.0

func (s *TargetService) GetTargetLogReader(ctx context.Context, targetId string) (io.Reader, error)

func (*TargetService) GetTargetLogWriter added in v0.52.0

func (s *TargetService) GetTargetLogWriter(ctx context.Context, targetId string) (io.WriteCloser, error)

func (*TargetService) HandleSuccessfulCreation added in v0.52.0

func (s *TargetService) HandleSuccessfulCreation(ctx context.Context, targetId string) error

func (*TargetService) List added in v0.52.0

func (*TargetService) Restart added in v0.52.0

func (s *TargetService) Restart(ctx context.Context, targetId string) error

func (*TargetService) Save added in v0.52.0

func (s *TargetService) Save(ctx context.Context, target *models.Target) error

TODO: revise - "remove default" is enough for now

func (*TargetService) SetDefault added in v0.52.0

func (s *TargetService) SetDefault(ctx context.Context, id string) error

func (*TargetService) Start added in v0.52.0

func (s *TargetService) Start(ctx context.Context, targetId string) error

func (*TargetService) Stop added in v0.52.0

func (s *TargetService) Stop(ctx context.Context, targetId string) error

func (*TargetService) UpdateLastJob added in v0.52.0

func (s *TargetService) UpdateLastJob(ctx context.Context, targetId, jobId string) error

func (*TargetService) UpdateMetadata added in v0.52.0

func (s *TargetService) UpdateMetadata(ctx context.Context, targetId string, metadata *models.TargetMetadata) (*models.TargetMetadata, error)

func (*TargetService) UpdateProviderMetadata added in v0.52.0

func (s *TargetService) UpdateProviderMetadata(ctx context.Context, targetId, metadata string) error

type TargetServiceConfig added in v0.52.0

type TargetServiceConfig struct {
	TargetStore         stores.TargetStore
	TargetMetadataStore stores.TargetMetadataStore

	FindTargetConfig    func(ctx context.Context, name string) (*models.TargetConfig, error)
	CreateApiKey        func(ctx context.Context, name string) (string, error)
	DeleteApiKey        func(ctx context.Context, name string) error
	CreateJob           func(ctx context.Context, targetId string, runnerId string, action models.JobAction) error
	TrackTelemetryEvent func(event telemetry.Event, clientId string) error

	ServerApiUrl  string
	ServerUrl     string
	ServerVersion string
	LoggerFactory logs.ILoggerFactory
}

Jump to

Keyboard shortcuts

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