source

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

Extends extends

Functions

This section is empty.

Types

type Driver added in v0.1.3

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

type Entity added in v0.1.5

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 added in v0.1.7

func WithClientset(clientset *kubernetes.Clientset) Option

WithClientset set k8s clientset

func WithConfigmap added in v0.1.7

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 added in v0.1.3

func WithDriver(driver Driver) Option

WithDriver set driver

func WithFrom

func WithFrom(fs fs.ReadFileFS) Option

WithFrom set embed.FS

func WithGORMDriver added in v0.1.3

func WithGORMDriver(driver string) Option

func WithGORMDsn added in v0.1.3

func WithGORMDsn(dsn string) Option

func WithKubeconfig added in v0.1.7

func WithKubeconfig(kubeconfig string) Option

WithKubeconfig set k8s kubeconfig

func WithKubeconfigPath added in v0.1.7

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 added in v0.1.7

func WithNamespace(namespace string) Option

WithNamespace set k8s namespace

func WithPrefixHook added in v0.1.7

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 added in v0.1.5

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
	Client            *s3.Client
	FS                fs.ReadFileFS
	MongoDBURL        string
	MongoDBName       string
	MongoDBCollection string
	Datasource        string
	GORMDriver        string
	GORMDsn           string
	Watch             bool
	Namespace         string
	Configmap         string
	PrefixHook        PrefixHook
	Clientset         *kubernetes.Clientset
	Kubeconfig        string
	KubeconfigPath    string
}

Options options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions default options

func (*Options) GetExtend added in v0.1.7

func (o *Options) GetExtend() Scheme

type PrefixHook added in v0.1.7

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"
)

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