source

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 4 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

Extends extends

Functions

This section is empty.

Types

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 WithDatasource

func WithDatasource(datasource string) Option

WithDatasource set datasource

func WithDir

func WithDir(dir string) Option

WithDir set dir

func WithFrom

func WithFrom(fs fs.ReadFileFS) Option

WithFrom set embed.FS

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

type Options

type Options struct {
	Provider          Provider
	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
}

Options options

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions default options

type Provider

type Provider string

Provider provider

const (
	// FS fs
	FS Provider = "fs"
	// Local local
	Local Provider = "local"
	// S3 s3
	S3 Provider = "s3"
	// MGDB mongodb
	MGDB Provider = "mgdb"
	// GORM gorm
	GORM Provider = "gorm"
)

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
}

Sourcer source interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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