writer

package
v1.7.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(ctx context.Context, ewd *ExpandedWriterData, ri icontext.ReadConfigProvider) (list []error)

Write write the config by the all writers

Types

type ConfigRef

type ConfigRef struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

ConfigRef reference a config secret, it must be system scope.

type ExpandedWriterConfig

type ExpandedWriterConfig struct {
	Nacos *NacosConfig `json:"nacos"`
}

ExpandedWriterConfig define the supported output ways.

func ParseExpandedWriterConfig

func ParseExpandedWriterConfig(template *value.Value) ExpandedWriterConfig

ParseExpandedWriterConfig parse the expanded writer config from the template value

type ExpandedWriterData

type ExpandedWriterData struct {
	Nacos *NacosData `json:"nacos"`
}

ExpandedWriterData the data for the expanded writer

func RenderForExpandedWriter

func RenderForExpandedWriter(ewc ExpandedWriterConfig, template script.CUE, context icontext.ConfigRenderContext, properties map[string]interface{}) (*ExpandedWriterData, error)

RenderForExpandedWriter render the configuration for all expanded writers

type NacosConfig

type NacosConfig struct {
	Endpoint ConfigRef `json:"endpoint"`
	// Format defines the format in which Data will be output.
	Format   string              `json:"format"`
	Metadata NacosConfigMetadata `json:"metadata"`
}

NacosConfig defines the nacos output

type NacosConfigMetadata

type NacosConfigMetadata struct {
	DataID      string `json:"dataId"`
	Group       string `json:"group"`
	NamespaceID string `json:"namespaceId"`
	AppName     string `json:"appName,omitempty"`
	Tenant      string `json:"tenant,omitempty"`
	Tag         string `json:"tag,omitempty"`
}

NacosConfigMetadata the metadata of the nacos config

type NacosData

type NacosData struct {
	NacosConfig
	Content []byte                      `json:"-"`
	Client  config_client.IConfigClient `json:"-"`
}

NacosData merge the nacos endpoint config and the rendered data

Jump to

Keyboard shortcuts

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