replicalog

package
v1.36.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJobFailed = errors.New("job has failed")

Functions

func New

func New[T Item](output io.Writer, getReplicas GetReplicasFunc[T], getLogs GetLogFunc[T], since time.Duration) *streamingReplicas[T]

Types

type ComponentItem

type ComponentItem struct {
	Component string
	Replica   string
	// contains filtered or unexported fields
}

func (ComponentItem) Created

func (c ComponentItem) Created() time.Time

func (ComponentItem) Identifier

func (c ComponentItem) Identifier() string

type GetLogFunc

type GetLogFunc[T Item] func(ctx context.Context, item T, since time.Time, callback consumer.EventCallback) error

func GetComponentLog

func GetComponentLog(apiClient *radixapi.Radixapi, appName string, previous bool) GetLogFunc[ComponentItem]

func GetLogsForJob

func GetLogsForJob(apiClient *radixapi.Radixapi, appName, jobName string) GetLogFunc[JobStep]

type GetReplicasFunc

type GetReplicasFunc[T Item] func() ([]T, bool, error)

GetReplicasFunc is a function type that returns a list of items (replicas) to stream logs from, a boolean indicating if we are finished, and an error if any occurred.

func GetComponentReplicasForEnvironment

func GetComponentReplicasForEnvironment(apiClient *radixapi.Radixapi, appName, environmentName string, previousLog bool) GetReplicasFunc[ComponentItem]

getComponentReplicasForEnvironment returns all replicas for all components in an environment, if previousLog is true, only return replicas once

func GetReplicasForComponent

func GetReplicasForComponent(apiClient *radixapi.Radixapi, appName, environmentName, componentName string, previousLog bool) GetReplicasFunc[ComponentItem]

func GetReplicasForJob

func GetReplicasForJob(apiClient *radixapi.Radixapi, appName, jobName string) GetReplicasFunc[JobStep]

type Item

type Item interface {
	Identifier() string
	Created() time.Time
}

type JobStep

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

func (JobStep) Created

func (c JobStep) Created() time.Time

func (JobStep) Identifier

func (j JobStep) Identifier() string

Jump to

Keyboard shortcuts

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