server

package
v0.0.0-...-a9d9736 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package server implements an HTTP server to make in-progress task logs available to the Airflow UI

Index

Constants

View Source
const (
	DefaultAudience            = "task-instance-logs"
	DefaultAlgorithm           = "HS512"
	DefaultWorkerLogServerPort = 8793
)

Variables

View Source
var DefaultClockLeeway = 30 * time.Second
View Source
var DefaultConfig = Config{
	BaseLogFolder: ".",
	Port:          DefaultWorkerLogServerPort,
	ClockLeeway:   &DefaultClockLeeway,
	Algorithm:     DefaultAlgorithm,
	Audiences:     []string{DefaultAudience},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseLogFolder string `mapstructure:"base_log_folder"`
	Port          int    `mapstructure:"port"`

	SecretKey   string         `mapstructure:"secret_key"`
	ClockLeeway *time.Duration `mapstructure:"clock_leeway"`
	Algorithm   string         `mapstructure:"algorithm"`
	Audiences   []string       `mapstructure:"audiences"`
}

type LogServer

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

func NewFromConfig

func NewFromConfig(v *viper.Viper) (*LogServer, error)

func NewLogServer

func NewLogServer(logger *slog.Logger, cfg Config) (*LogServer, error)

func (*LogServer) ListenAndServe

func (l *LogServer) ListenAndServe(ctx context.Context, shutdownTimeout time.Duration) error

func (*LogServer) Serve

func (l *LogServer) Serve(
	ctx context.Context,
	shutdownTimeout time.Duration,
	ln net.Listener,
) error

func (*LogServer) ServeLog

func (l *LogServer) ServeLog(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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