package types

import "github.com/go-logr/zapr/internal/types"

Package types holds a copy of the ObjectRef type from klog for use in the example.

Index

Types

type ObjectRef

type ObjectRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace,omitempty"`
}

ObjectRef references a Kubernetes object

func (ObjectRef) MarshalLog

func (ref ObjectRef) MarshalLog() interface{}

MarshalLog ensures that loggers with structured output ignore the String method.

We implement fmt.Stringer for non-structured logging, but we want the raw struct when using structured logs. Some logr implementations call String if it is present, so we want to convert this struct to something that doesn't have that method.

func (ObjectRef) String

func (ref ObjectRef) String() string

Source Files

objectref.go

Version
v1.3.0 (latest)
Published
Nov 3, 2023
Platform
js/wasm
Imports
2 packages
Last checked
16 hours ago

Tools for package owners.