githubobserver

package
v0.72.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(ctx context.Context, dir string, args ...string) ([]byte, error)

Types

type CommandResponse

type CommandResponse struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
	Err      error
}

func Execute

func Execute(ctx context.Context, dir string, args ...string) CommandResponse

type GetRequest

type GetRequest struct {
	Dir         string
	Repository  string
	Target      string
	Head        string
	Endpoint    string
	Query       map[string]string
	Accept      string
	FreshWindow time.Duration
}

type Observer

type Observer struct {
	StateDir    string
	Now         func() time.Time
	Sleep       func(context.Context, time.Duration) error
	RandomIntn  func(int64) int64
	Run         func(context.Context, string, ...string) commandResult
	MaxAttempts int
	BaseBackoff time.Duration
	MaxBackoff  time.Duration
}

func Default

func Default() *Observer

func (*Observer) Execute

func (o *Observer) Execute(ctx context.Context, dir string, args ...string) CommandResponse

func (*Observer) Get

func (o *Observer) Get(ctx context.Context, request GetRequest) (response Response, err error)

func (*Observer) Read

func (o *Observer) Read(ctx context.Context, dir string, args ...string) ([]byte, error)

type Response

type Response struct {
	Body        []byte
	StatusCode  int
	Headers     map[string]string
	Cached      bool
	ObservedAt  time.Time
	CacheKey    string
	RequestHash string
}

func Get

func Get(ctx context.Context, request GetRequest) (Response, error)

Jump to

Keyboard shortcuts

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