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

jerk

package
v1.44.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MinVersion      = "0.6.0"
	DefaultDuration = 3600
	MaxDuration     = 86400
	Timeout         = 60 * time.Second
)

Variables

This section is empty.

Functions

func ValidLeaseID

func ValidLeaseID(id string) bool

func ValidProvider

func ValidProvider(p string) bool

Types

type Call

type Call struct {
	Args     []string
	Env      []string
	Timeout  time.Duration
	Started  func()
	Progress func(message string)
}

type Jerk

type Jerk struct {
	Path    string
	Version string
}

func Find

func Find(dirs ...string) (*Jerk, string)

func (*Jerk) Drop

func (j *Jerk) Drop(ctx context.Context, provider, leaseID string) Outcome

func (*Jerk) Lease

func (j *Jerk) Lease(ctx context.Context, provider string, duration int) Outcome

func (*Jerk) LeaseCall

func (j *Jerk) LeaseCall(ctx context.Context, provider string, c Call) Outcome

func (*Jerk) Run

func (j *Jerk) Run(ctx context.Context, provider string, c Call) Outcome

type Lease

type Lease struct {
	Credentials map[string]string `json:"credentials"`
	ExpiresAt   string            `json:"expires_at"`
	LeaseID     string            `json:"lease_id,omitempty"`
}

type Outcome

type Outcome struct {
	Lease    *Lease `json:"lease,omitempty"`
	Result   Result `json:"result"`
	Died     bool   `json:"-"`
	TimedOut bool   `json:"-"`
}

type Result

type Result struct {
	Exit      int              `json:"exit"`
	Provider  string           `json:"provider,omitempty"`
	User      string           `json:"user,omitempty"`
	Scopes    []string         `json:"scopes,omitempty"`
	ExpiresAt string           `json:"expires_at,omitempty"`
	Env       []string         `json:"env,omitempty"`
	Message   string           `json:"message"`
	Items     []map[string]any `json:"items,omitempty"`
}

Jump to

Keyboard shortcuts

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