util

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProviders added in v0.6.2

func GetProviders() map[string]cuexruntime.ProviderFn

GetProviders return the provider

func GetTemplate added in v0.6.2

func GetTemplate() string

GetTemplate return the template

func Log added in v0.6.2

func Log(ctx context.Context, params *LogParams) (*any, error)

Log print cue value in log

func PatchK8sObject added in v0.6.2

func PatchK8sObject(_ context.Context, params *providertypes.Params[cue.Value]) (cue.Value, error)

PatchK8sObject patch k8s object

Types

type LogConfig added in v0.6.2

type LogConfig struct {
	Data   bool       `json:"data,omitempty"`
	Source *LogSource `json:"source,omitempty"`
}

LogConfig is the config of the log

type LogParams added in v0.6.2

type LogParams = providertypes.Params[LogVars]

LogParams .

type LogSource added in v0.6.2

type LogSource struct {
	URL       string     `json:"url,omitempty"`
	Resources []Resource `json:"resources,omitempty"`
}

LogSource is the source of the log

type LogVars added in v0.6.2

type LogVars struct {
	Data   any        `json:"data,omitempty"`
	Level  int        `json:"level"`
	Source *LogSource `json:"source,omitempty"`
}

LogVars is the vars for log

type PatchVars added in v0.6.2

type PatchVars struct {
	Resource cue.Value `json:"value"`
	Patch    cue.Value `json:"patch"`
}

PatchVars is the vars for patch

type Resource added in v0.6.2

type Resource struct {
	Name          string            `json:"name,omitempty"`
	Namespace     string            `json:"namespace,omitempty"`
	Cluster       string            `json:"cluster,omitempty"`
	LabelSelector map[string]string `json:"labelSelector,omitempty"`
}

Resource is the log resources

type StringParams added in v0.6.2

type StringParams = providertypes.Params[StringVars]

StringParams .

type StringReturnVars added in v0.6.2

type StringReturnVars struct {
	String string `json:"str"`
}

StringReturnVars .

type StringReturns added in v0.6.2

type StringReturns = providertypes.Returns[StringReturnVars]

StringReturns .

func String added in v0.6.2

func String(_ context.Context, params *StringParams) (*StringReturns, error)

String convert byte to string

type StringVars added in v0.6.2

type StringVars struct {
	Byte []byte `json:"bt"`
}

StringVars .

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳