Documentation ¶
Overview ¶
Package common shares methods for local builder.
Index ¶
- func Backoff(baseDelay, maxDelay time.Duration, retries int) time.Duration
- func Clean(ctx context.Context, r runner.Runner) error
- func ParseSubstitutionsFlag(substitutions string) (map[string]string, error)
- func RefreshDuration(expiration time.Time) time.Duration
- func SubstituteAndValidate(b *pb.Build, substMap map[string]string) error
- type TokenTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Backoff ¶
Backoff returns a value in [0, maxDelay] that increases exponentially with retries, starting from baseDelay.
func Clean ¶ added in v0.1.1
Clean removes left-over containers, networks, and volumes from a previous run of the local builder. This happens when ctrl+c is used during a local build. Each cleaning is defined by a get command, a warning to print if the get command returns something, and a delete command to apply in that case.
func ParseSubstitutionsFlag ¶
ParseSubstitutionsFlag parses a substitutions string into a map.
func RefreshDuration ¶ added in v0.2.2
RefreshDuration calculates when to refresh the access token. We refresh a bit prior to the token's expiration.
Types ¶
type TokenTransport ¶ added in v0.4.0
type TokenTransport struct {
Ts oauth2.TokenSource
}
TokenTransport is a RoundTripper that automatically applies OAuth credentials from the token source.