Help us shape the future of Go! Take the 2026 Go Developer Survey

logs

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LokiImage       = "docker.io/grafana/loki:3.7.8"
	AlloyImage      = "docker.io/grafana/alloy:v1.19.2"
	LokiRuntimeUID  = 10001
	LokiRuntimeGID  = 10001
	AlloyRuntimeUID = 473
	AlloyRuntimeGID = 473
)

Variables

This section is empty.

Functions

func DestroyProvider

func DestroyProvider(ctx context.Context, runtime Runtime, m application.Manifest) error

func DestroyProviderAt added in v0.4.15

func DestroyProviderAt(ctx context.Context, runtime Runtime, dataDir, namespace string, m application.Manifest) error

func EnsureRuntimeModuleOverrideForModeAt added in v0.4.17

func EnsureRuntimeModuleOverrideForModeAt(
	dataDir string,
	namespace string,
	m application.Manifest,
	dir string,
	filename string,
	project string,
	mode bhruntime.LogCollectionMode,
	class observability.SourceClass,
	allowedServices []string,
) (string, bool, error)

func EnsureWorkloadOverride

func EnsureWorkloadOverride(m application.Manifest, runtime application.RuntimeFiles, services []string) (string, error)

func EnsureWorkloadOverrideForMode added in v0.4.17

func EnsureWorkloadOverrideForMode(m application.Manifest, runtime application.RuntimeFiles, services []string, mode bhruntime.LogCollectionMode) (string, error)

func EnsureWorkloadOverrideForModeAt added in v0.4.17

func EnsureWorkloadOverrideForModeAt(dataDir, namespace string, m application.Manifest, runtime application.RuntimeFiles, services []string, mode bhruntime.LogCollectionMode) (string, error)

func ExistingProviderSourceOverride added in v0.4.15

func ExistingProviderSourceOverride(runtime application.RuntimeFiles) (string, bool, error)

func ExistingWorkloadOverride

func ExistingWorkloadOverride(runtime application.RuntimeFiles) (string, bool, error)

func ProviderEndpoint

func ProviderEndpoint(files ProviderFiles) (string, error)

func RemoveProviderSourceOverride added in v0.4.15

func RemoveProviderSourceOverride(runtime application.RuntimeFiles) error

func RemoveWorkloadOverride

func RemoveWorkloadOverride(runtime application.RuntimeFiles) error

func RestoreApplicationHistoryAt added in v0.4.16

func RestoreApplicationHistoryAt(ctx context.Context, m application.Manifest, dataDir, namespace string, backup HistoryBackup) error

func StopProvider

func StopProvider(ctx context.Context, runtime Runtime, m application.Manifest) error

func StopProviderAt added in v0.4.15

func StopProviderAt(ctx context.Context, runtime Runtime, dataDir, namespace string, m application.Manifest) error

func UnregisterApplication

func UnregisterApplication(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer, m application.Manifest) error

func UnregisterApplicationAt added in v0.4.15

func UnregisterApplicationAt(ctx context.Context, runtime Runtime, issuer serviceaccess.Issuer, dataDir, namespace string, m application.Manifest) error

func VerifyApplication

func VerifyApplication(ctx context.Context, m application.Manifest, services []string) error

func VerifyApplicationAt added in v0.4.15

func VerifyApplicationAt(ctx context.Context, m application.Manifest, services []string, dataDir, namespace string) error

func VerifyProviderSources added in v0.4.15

func VerifyProviderSources(ctx context.Context, m application.Manifest, sources []observability.SignalSource) error

func VerifyProviderSourcesAt added in v0.4.15

func VerifyProviderSourcesAt(ctx context.Context, m application.Manifest, sources []observability.SignalSource, dataDir, namespace string) error

Types

type Driver

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

func NewDriver

func NewDriver(runtime Runtime, app application.Manifest, issuer serviceaccess.Issuer) *Driver

func NewDriverAt added in v0.4.15

func NewDriverAt(runtime Runtime, app application.Manifest, issuer serviceaccess.Issuer, dataDir, namespace string) *Driver

func NewDriverWithRealization added in v0.4.19

func NewDriverWithRealization(realization LokiRealization, app application.Manifest) *Driver

func (*Driver) Bind

func (d *Driver) Bind(ctx context.Context, resource capability.Resource, binding capability.Binding) error

func (*Driver) Descriptor

func (d *Driver) Descriptor() capability.Provider

func (*Driver) Preflight

func (d *Driver) Preflight(_ context.Context, resource capability.Resource, binding capability.Binding) error

func (*Driver) Provision

func (d *Driver) Provision(ctx context.Context, _ capability.Resource, _ capability.Binding) error

func (*Driver) Verify

func (d *Driver) Verify(ctx context.Context, _ capability.Resource, binding capability.Binding) error

type HistoryBackup added in v0.4.16

type HistoryBackup struct {
	Streams []HistoryStream `json:"streams"`
}

func ExportApplicationHistoryAt added in v0.4.16

func ExportApplicationHistoryAt(ctx context.Context, m application.Manifest, dataDir, namespace string) (HistoryBackup, error)

type HistoryEntry added in v0.4.16

type HistoryEntry struct {
	Timestamp string `json:"timestamp"`
	Line      string `json:"line"`
}

type HistoryStream added in v0.4.16

type HistoryStream struct {
	Labels  map[string]string `json:"labels"`
	Entries []HistoryEntry    `json:"entries"`
}

type LogSource added in v0.4.19

type LogSource struct {
	Application string
	Environment string
	Class       application.LogsSourceClass
	Provider    capability.ProviderKind
	Service     string
}

type LokiInstance added in v0.4.19

type LokiInstance struct {
	Endpoint   string
	HTTPClient *http.Client
}

type LokiRealization added in v0.4.19

type LokiRealization interface {
	Apply(context.Context) (LokiInstance, error)
	Existing(context.Context) (LokiInstance, error)
	RegisterSource(context.Context, LogSource) error
	VerifySource(context.Context, LogSource) error
	Destroy(context.Context) error
}

type Placement

type Placement struct {
	Scope            capability.ProviderScope
	Project          string
	Network          string
	Dir              string
	LokiVolume       string
	AlloyVolume      string
	SharingBoundary  string
	OwnerApplication string
}

func PlacementFor

func PlacementFor(m application.Manifest) (Placement, error)

func PlacementForAt added in v0.4.15

func PlacementForAt(dataDir, namespace string, m application.Manifest) (Placement, error)

type ProviderFiles

type ProviderFiles struct {
	Dir           string
	Compose       string
	Env           string
	LokiConfig    string
	AlloyConfig   string
	Registrations string
}

func EnsureProviderFilesForMode added in v0.4.17

func EnsureProviderFilesForMode(ctx context.Context, issuer serviceaccess.Issuer, m application.Manifest, mode bhruntime.LogCollectionMode) (ProviderFiles, error)

func EnsureProviderFilesForModeAt added in v0.4.17

func EnsureProviderFilesForModeAt(ctx context.Context, issuer serviceaccess.Issuer, dataDir, namespace string, m application.Manifest, mode bhruntime.LogCollectionMode) (ProviderFiles, error)

func ExistingProviderFiles

func ExistingProviderFiles(m application.Manifest) (ProviderFiles, error)

func ExistingProviderFilesAt added in v0.4.15

func ExistingProviderFilesAt(dataDir, namespace string, m application.Manifest) (ProviderFiles, error)

type Registration

type Registration struct {
	Application        string `json:"application"`
	Environment        string `json:"environment"`
	Namespace          string `json:"namespace,omitempty"`
	SyslogPort         int    `json:"syslog_port"`
	ProviderSyslogPort int    `json:"provider_syslog_port"`
}

func ApplicationRegistration

func ApplicationRegistration(m application.Manifest) (Registration, error)

func ApplicationRegistrationAt added in v0.4.15

func ApplicationRegistrationAt(dataDir, namespace string, m application.Manifest) (Registration, error)

type Runtime

type Runtime interface {
	ConfigProject(context.Context, string, string, string) error
	UpProject(context.Context, string, string, string) error
	StopProject(context.Context, string, string, string) error
	DestroyProject(context.Context, string, string, string) error
}

Jump to

Keyboard shortcuts

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