logging

package
v1.118.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddLogMetricController

func AddLogMetricController(mgr manager.Manager, config *controller.Config, opts directbase.Deps) error

AddLogMetricController creates a new controller and adds it to the Manager. The Manager will set fields on the Controller and start it when the Manager is started.

func GetModel added in v1.118.0

func GetModel(ctx context.Context, config *controller.Config) (directbase.Model, error)

func HasHTTPCode

func HasHTTPCode(err error, code int) bool

HasHTTPCode returns true if the given error is an HTTP response with the given code.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns true if the given error is an HTTP 404.

func LazyPtr added in v1.118.1

func LazyPtr[T comparable](v T) *T

LazyPtr returns a pointer to v, unless it is the empty value, in which case it returns nil. It is essentially the inverse of ValueOf, though it is lossy because we can't tell nil and empty apart without a pointer.

func LogBucketRef_ConvertToExternal added in v1.118.0

func LogBucketRef_ConvertToExternal(ctx context.Context, reader client.Reader, src client.Object, pRef **v1alpha1.ResourceRef) error

func MakeFQN

func MakeFQN(projectID, metricID string) string

MakeFQN constructions a fully qualified name for a LogMetric resources to be used in API calls. The format expected is: "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Func assumes values are well formed and validated.

func ValueOf

func ValueOf[T any](p *T) T

todo acpana: add to factor out to top level package todo acpana: begin

Types

type LogBucket added in v1.118.0

type LogBucket struct {
	// contains filtered or unexported fields
}

func LogBucketRef_Parse added in v1.118.0

func LogBucketRef_Parse(ctx context.Context, external string) (*LogBucket, error)

func (*LogBucket) FQN added in v1.118.0

func (b *LogBucket) FQN() string

func (*LogBucket) ProjectID added in v1.118.0

func (b *LogBucket) ProjectID() string

type Project added in v1.118.0

type Project struct {
	ProjectID string
}

func ResolveProject added in v1.118.0

func ResolveProject(ctx context.Context, reader client.Reader, src client.Object, ref *v1alpha1.ResourceRef) (*Project, error)

Jump to

Keyboard shortcuts

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