format

package
v0.21.13-rc.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferFlowSchemaSpec

func BufferFlowSchemaSpec(buf *bytes.Buffer, fsSpec *flowcontrol.FlowSchemaSpec)

BufferFlowSchemaSpec writes a golang source expression for the given value to the given buffer

func BufferFmtPolicyRulesWithSubjectsSlim

func BufferFmtPolicyRulesWithSubjectsSlim(buf *bytes.Buffer, rule flowcontrol.PolicyRulesWithSubjects)

BufferFmtPolicyRulesWithSubjectsSlim writes a golang source expression for the given value to the given buffer but excludes the leading type name

func BufferPriorityLevelConfigurationSpec

func BufferPriorityLevelConfigurationSpec(buf *bytes.Buffer, plSpec *flowcontrol.PriorityLevelConfigurationSpec)

BufferPriorityLevelConfigurationSpec writes a golang source expression for the given value to the given buffer

func FmtFlowSchema

func FmtFlowSchema(fs *flowcontrol.FlowSchema) string

FmtFlowSchema produces a golang source expression of the value.

func FmtFlowSchemaSpec

func FmtFlowSchemaSpec(fsSpec *flowcontrol.FlowSchemaSpec) string

FmtFlowSchemaSpec produces a golang source expression equivalent to the given spec

func FmtPolicyRulesWithSubjects

func FmtPolicyRulesWithSubjects(rule flowcontrol.PolicyRulesWithSubjects) string

FmtPolicyRulesWithSubjects produces a golang source expression of the value.

func FmtPolicyRulesWithSubjectsSlim

func FmtPolicyRulesWithSubjectsSlim(rule flowcontrol.PolicyRulesWithSubjects) string

FmtPolicyRulesWithSubjectsSlim produces a golang source expression of the value but without the leading type name. See above for an example context where this is useful.

func FmtPriorityLevelConfiguration

func FmtPriorityLevelConfiguration(pl *flowcontrol.PriorityLevelConfiguration) string

FmtPriorityLevelConfiguration returns a golang source expression equivalent to the given value

func FmtPriorityLevelConfigurationSpec

func FmtPriorityLevelConfigurationSpec(plSpec *flowcontrol.PriorityLevelConfigurationSpec) string

FmtPriorityLevelConfigurationSpec returns a golang source expression equivalent to the given value

func FmtRequests

func FmtRequests(list []*request.RequestInfo) string

FmtRequests produces a golang source expression of the value.

func FmtUsers

func FmtUsers(list []user.Info) string

FmtUsers produces a golang source expression of the value.

func ToJSON

func ToJSON(val interface{}) string

ToJSON converts using encoding/json and handles errors by formatting them

Types

type Stringer

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

Stringer marks the given value for custom formatting by this package.

func Fmt

func Fmt(val interface{}) Stringer

Fmt marks the given value for custom formatting by this package.

func (Stringer) String

func (sr Stringer) String() string

String formats to a string in full detail

Jump to

Keyboard shortcuts

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