tools

package
v2.49.0-RC2 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 13 Imported by: 14

Documentation

Overview

Package tools contains utilities for Beam bootloader containers, such as for obtaining runtime provision information -- such as pipeline options. or for logging to the log service.

For Beam Internal use.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONToProto

func JSONToProto(data string) (*google_pb.Struct, error)

JSONToProto converts JSON-encoded pipeline options to a proto struct.

func OptionsToProto

func OptionsToProto(v any) (*google_pb.Struct, error)

OptionsToProto converts pipeline options to a proto struct via JSON.

func ProtoToJSON

func ProtoToJSON(opt *google_pb.Struct) (string, error)

ProtoToJSON converts pipeline options from a proto struct to JSON.

func ProtoToOptions

func ProtoToOptions(opt *google_pb.Struct, v any) error

ProtoToOptions converts pipeline options from a proto struct via JSON.

func ProvisionInfo

func ProvisionInfo(ctx context.Context, endpoint string) (*fnpb.ProvisionInfo, error)

ProvisionInfo returns the runtime provisioning info for the worker.

Types

type Logger

type Logger struct {
	Endpoint string
	// contains filtered or unexported fields
}

Logger is a wrapper around the FnAPI Logging Client, intended for container boot loader use. Not intended for Beam end users.

func (*Logger) Close

func (l *Logger) Close()

Close closes the grpc logging client.

func (*Logger) Fatalf

func (l *Logger) Fatalf(ctx context.Context, format string, args ...any)

Fatalf logs the message with Critical severity, and then calls os.Exit(1).

func (*Logger) Log

func (l *Logger) Log(ctx context.Context, sev fnpb.LogEntry_Severity_Enum, message string)

Log a message with the given severity.

func (*Logger) Printf

func (l *Logger) Printf(ctx context.Context, format string, args ...any)

Printf logs the message with Debug severity.

func (*Logger) Warnf

func (l *Logger) Warnf(ctx context.Context, format string, args ...any)

Warnf logs the message with Warning severity.

Jump to

Keyboard shortcuts

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