Documentation ¶
Index ¶
- Variables
- func AddJobIDToBaggage(ctx context.Context, jobID string) context.Context
- func AddNodeIDToBaggage(ctx context.Context, nodeID string) context.Context
- func ConvertToClientID(key *rsa.PublicKey) string
- func DecodePublicKey(key string) (*rsa.PublicKey, error)
- func FindJobIDInTestOutput(testOutput string) string
- func FindJobIDInTestOutputLegacy(testOutput string) string
- func GetTracer() oteltrace.Tracer
- func MustParseURL(uri string) *url.URL
- func NewRootSpan(ctx context.Context, t oteltrace.Tracer, name string) (context.Context, oteltrace.Span)
- func NewSpan(ctx context.Context, t oteltrace.Tracer, name string, ...) (context.Context, oteltrace.Span)
- func PathExists(path string) (bool, error)
- func PublicKeyMatchesID(publicKey, clientID string) (bool, error)
- func ReverseList(s []string) []string
- func Span(ctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
- func SplitLines(s string) []string
- func Verify(msg []byte, sig, publicKey string) error
- type CleanupManager
- type Environment
- type FunctionWaiter
- type MessageSigner
- type Signer
Constants ¶
This section is empty.
Variables ¶
var MaxStderrFileLength = 1 * datasize.GB
MaxStderrFileLength sets the max size for stderr file during container execution (needed to prevent DoS)
var MaxStderrReturnLength = 2 * datasize.KB
MaxStderrReturnLength sets the max size for stderr string return into RunOutput (with truncation) from container execution (needed to prevent DoS)
var MaxStdoutFileLength = 1 * datasize.GB
MaxStdoutFileLength sets the max size for stdout file during container execution (needed to prevent DoS)
var MaxStdoutReturnLength = 2 * datasize.KB
MaxStdoutReturnLength sets the max size for stdout string return into RunOutput (with truncation) from container execution (needed to prevent DoS)
var Stderr = struct{ io.Writer }{os.Stderr}
var Stdout = struct{ io.Writer }{os.Stdout}
Functions ¶
func AddNodeIDToBaggage ¶
func ConvertToClientID ¶ added in v1.2.1
ConvertToClientID converts a public key to a client ID:
func DecodePublicKey ¶ added in v1.2.1
DecodePublicKey decodes a public key from a string:
func FindJobIDInTestOutput ¶
func FindJobIDInTestOutputLegacy ¶ added in v1.1.0
func MustParseURL ¶ added in v0.3.25
func NewRootSpan ¶
func PathExists ¶
PathExists returns whether the given file or directory exists
func PublicKeyMatchesID ¶
PublicKeyMatchesID returns true if the given base64-encoded public key and the given client ID correspond to each other:
func ReverseList ¶
func Span ¶
func Span(ctx context.Context, spanName string, opts ...oteltrace.SpanStartOption) (context.Context, oteltrace.Span)
Span creates and starts a new span, and a context containing it. For more information see the otel.Tracer.Start(...) docs: https://pkg.go.dev/go.opentelemetry.io/otel/trace#Tracer ctx: the context to use for the span tracerName: the name of the service that the span is for - will be prefixed with "tracer/". Will create a new one if one with the same name does not exist spanName: the name of the span, inside the service opts: additional options to configure the span from trace.SpanStartOption
func SplitLines ¶
Types ¶
type CleanupManager ¶
type CleanupManager struct {
// contains filtered or unexported fields
}
CleanupManager provides utilities for ensuring that sub-goroutines can clean up their resources before the main goroutine exits. Can be used to register callbacks for long-running system processes.
func NewCleanupManager ¶
func NewCleanupManager() *CleanupManager
NewCleanupManager returns a new CleanupManager instance.
func (*CleanupManager) Cleanup ¶
func (cm *CleanupManager) Cleanup(ctx context.Context)
Cleanup runs all registered clean-up functions in sub-goroutines and waits for them all to complete before exiting.
func (*CleanupManager) RegisterCallback ¶
func (cm *CleanupManager) RegisterCallback(fn cleanUpWithoutContext)
RegisterCallback registers a clean-up function.
func (*CleanupManager) RegisterCallbackWithContext ¶
func (cm *CleanupManager) RegisterCallbackWithContext(fn cleanUpWithContext)
RegisterCallbackWithContext registers a clean-up function. The context passed is guaranteed not to be already canceled.
type Environment ¶
type Environment string
const ( // Known environments that are configured in ops/terraform: EnvironmentStaging Environment = "staging" EnvironmentProd Environment = "production" EnvironmentDev Environment = "development" EnvironmentTest Environment = "test" )
func GetEnvironment ¶
func GetEnvironment() Environment
func (Environment) IsKnown ¶
func (e Environment) IsKnown() bool
func (Environment) String ¶
func (e Environment) String() string
type FunctionWaiter ¶
type MessageSigner ¶ added in v1.3.2
type MessageSigner struct {
// contains filtered or unexported fields
}
func NewMessageSigner ¶ added in v1.3.2
func NewMessageSigner(sk *rsa.PrivateKey) *MessageSigner
func (*MessageSigner) PublicKey ¶ added in v1.3.2
func (m *MessageSigner) PublicKey() *rsa.PublicKey
func (*MessageSigner) PublicKeyString ¶ added in v1.3.2
func (m *MessageSigner) PublicKeyString() string
PublicKeyString returns a base64-encoding of the user's public ID key: