source

package
v0.0.0-...-bb7732e Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Extends extends

Functions

This section is empty.

Types

type Driver

type Driver interface {
	GenerateBytes() ([]byte, error)
	GetExtend() Scheme
}

type Entity

type Entity interface {
	OnChange()
}

Entity 配置实体

type Option

type Option func(*Options)

Option option

func WithBucket

func WithBucket(bucket string) Option

WithBucket set s3 bucket

func WithClient

func WithClient(client *s3.Client) Option

WithClient set s3 client

func WithClientset

func WithClientset(clientset *kubernetes.Clientset) Option

WithClientset set k8s clientset

func WithConfigmap

func WithConfigmap(configmap string) Option

WithConfigmap set k8s configmap name

func WithDatasource

func WithDatasource(datasource string) Option

WithDatasource set datasource

func WithDir

func WithDir(dir string) Option

WithDir set dir

func WithDriver

func WithDriver(driver Driver) Option

WithDriver set driver

func WithFrom

func WithFrom(fs fs.ReadFileFS) Option

WithFrom set embed.FS

func WithGORMDriver

func WithGORMDriver(driver string) Option

func WithGORMDsn

func WithGORMDsn(dsn string) Option

func WithKubeconfig

func WithKubeconfig(kubeconfig string) Option

WithKubeconfig set k8s kubeconfig

func WithKubeconfigPath

func WithKubeconfigPath(kubeconfigPath string) Option

WithKubeconfigPath set k8s kubeconfig path

func WithMongoDBCollection

func WithMongoDBCollection(collection string) Option

WithMongoDBCollection set mongodb collection

func WithMongoDBName

func WithMongoDBName(name string) Option

WithMongoDBName set mongodb name

func WithMongoDBURL

func WithMongoDBURL(url string) Option

WithMongoDBURL set mongodb url

func WithName

func WithName(file string) Option

WithName set config name

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace set k8s namespace

func WithPostfixHook

func WithPostfixHook(hook PostHook) Option

func WithPrefixHook

func WithPrefixHook(hook PrefixHook) Option

WithPrefixHook set prefix hook

func WithProjectName

func WithProjectName(projectName string) Option

WithProjectName set projectName

func WithProvider

func WithProvider(provider Provider) Option

WithProvider set provider

func WithRegion

func WithRegion(region string) Option

WithRegion set s3 region

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout set s3 client timeout

func WithWatch

func WithWatch(watch bool) Option

type Options

type Options struct {
	Provider            Provider
	Driver              Driver
	Name                string
	Extend              Scheme
	Dir                 string
	Region              string
	Bucket              string
	ProjectName         string
	Timeout             time.Duration
	S3Client            *s3.Client
	APPConfigDataClient *appconfigdata.Client
	FS                  fs.ReadFileFS
	MongoDBURL          string
	MongoDBName         string
	MongoDBCollection   string
	Datasource          string
	GORMDriver          string
	GORMDsn             string
	Watch               bool
	Namespace           string
	Configmap           string
	PrefixHook          PrefixHook
	PostfixHook         PostHook
	Clientset           *kubernetes.Clientset
	Kubeconfig          string
	KubeconfigPath      string
}

Options options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions default options

func (*Options) GetExtend

func (o *Options) GetExtend() Scheme

type PostHook

type PostHook interface {
	Entity
}

type PrefixHook

type PrefixHook interface {
	Init()
}

type Provider

type Provider string

Provider provider

const (
	// FS fs
	FS Provider = "fs"
	// Local file
	Local Provider = "local"
	// S3 s3
	S3 Provider = "s3"
	// MGDB mongodb
	MGDB Provider = "mgdb"
	// GORM gorm
	GORM Provider = "gorm"
	// ConfigMap k8s configmap
	ConfigMap Provider = "configmap"
	// Consul consul
	Consul Provider = "consul"
	// APPConfig aws appconfig
	APPConfig Provider = "appconfig"
)

type Scheme

type Scheme string

Scheme scheme

const (
	// SchemeYaml yaml
	SchemeYaml Scheme = "yaml"
	// SchemeYml yml
	SchemeYml Scheme = "yml"
	// SchemeJSOM json
	SchemeJSOM Scheme = "json"
)

func (Scheme) String

func (s Scheme) String() string

String string

type Sourcer

type Sourcer interface {
	fs.ReadFileFS
	GetExtend() Scheme
	Watch(e Entity, unm func([]byte, any) error) error
}

Sourcer source interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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