source

package
v1.1.71 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Overview

Package source is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVConfig

type CSVConfig struct {
	Delimiter  string `yaml:"delimiter,omitempty" json:"delimiter,omitempty,optional"`
	Comment    string `yaml:"comment,omitempty" json:"comment,omitempty,optional"`
	WithHeader bool   `yaml:"withHeader,omitempty" json:"withHeader,omitempty,optional"`
	LazyQuotes bool   `yaml:"lazyQuotes,omitempty" json:"lazyQuotes,omitempty,optional"`
}

type Config

type Config struct {
	Local *LocalConfig `yaml:"local,omitempty" json:"local,omitempty,optional"`
	S3    *S3Config    `yaml:"s3,omitempty" json:"s3,omitempty,optional"`
	OSS   *OSSConfig   `yaml:"oss,omitempty" json:"oss,omitempty,optional"`
	FTP   *FTPConfig   `yaml:"ftp,omitempty" json:"ftp,omitempty,optional"`
	SFTP  *SFTPConfig  `yaml:"sftp,omitempty" json:"sftp,omitempty,optional"`
	HDFS  *HDFSConfig  `yaml:"hdfs,omitempty" json:"hdfs,omitempty,optional"`
	GCS   *GCSConfig   `yaml:"gcs,omitempty" json:"gcs,omitempty,optional"`
	SQL   *SQLConfig   `yaml:"sql,omitempty" json:"sql,omitempty,optional"`
	// The following is format information
	CSV *CSVConfig `yaml:"csv,omitempty" json:"csv,omitempty,optional"`
}

func (*Config) Clone

func (c *Config) Clone() *Config

type FTPConfig

type FTPConfig struct {
	Host     string `yaml:"host,omitempty" json:"host,omitempty,optional"`
	Port     int    `yaml:"port,omitempty" json:"port,omitempty,optional"`
	User     string `yaml:"user,omitempty" json:"user,omitempty,optional"`
	Password string `yaml:"password,omitempty" json:"password,omitempty,optional"`
	Path     string `yaml:"path,omitempty" json:"path,omitempty,optional"`
}

func (*FTPConfig) String

func (c *FTPConfig) String() string

type GCSConfig

type GCSConfig struct {
	Endpoint              string `yaml:"endpoint,omitempty" json:"endpoint,omitempty,optional"`
	CredentialsFile       string `yaml:"credentialsFile,omitempty" json:"credentialsFile,omitempty,optional"`
	CredentialsJSON       string `yaml:"credentialsJSON,omitempty" json:"credentialsJSON,omitempty,optional"`
	WithoutAuthentication bool   `yaml:"withoutAuthentication,omitempty" json:"withoutAuthentication,omitempty,optional"`
	Bucket                string `yaml:"bucket,omitempty" json:"bucket,omitempty,optional"`
	Key                   string `yaml:"key,omitempty" json:"key,omitempty,optional"`
}

func (*GCSConfig) String

func (c *GCSConfig) String() string

type Globber

type Globber interface {
	Glob() ([]*Config, error)
}

type HDFSConfig

type HDFSConfig struct {
	Address                string `yaml:"address,omitempty" json:"address,omitempty,optional"`
	User                   string `yaml:"user,omitempty" json:"user,omitempty,optional"`
	ServicePrincipalName   string `yaml:"servicePrincipalName,omitempty" json:"servicePrincipalName,omitempty,optional"`
	Krb5ConfigFile         string `yaml:"krb5ConfigFile,omitempty" json:"krb5ConfigFile,omitempty,optional"`
	CCacheFile             string `yaml:"ccacheFile,omitempty" json:"ccacheFile,omitempty,optional"`
	KeyTabFile             string `yaml:"keyTabFile,omitempty" json:"keyTabFile,omitempty,optional"`
	Password               string `yaml:"password,omitempty" json:"password,omitempty,optional"`
	DataTransferProtection string `yaml:"dataTransferProtection,omitempty" json:"dataTransferProtection,omitempty,optional"`
	DisablePAFXFAST        bool   `yaml:"disablePAFXFAST,omitempty" json:"disablePAFXFAST,omitempty,optional"`
	Path                   string `yaml:"path,omitempty" json:"path,omitempty,optional"`
}

func (*HDFSConfig) String

func (c *HDFSConfig) String() string

type LocalConfig

type LocalConfig struct {
	Path string `yaml:"path,omitempty" json:"path,omitempty,optional"`
}

func (*LocalConfig) String

func (c *LocalConfig) String() string

type MockGlobber

type MockGlobber struct {
	// contains filtered or unexported fields
}

MockGlobber is a mock of Globber interface.

func NewMockGlobber

func NewMockGlobber(ctrl *gomock.Controller) *MockGlobber

NewMockGlobber creates a new mock instance.

func (*MockGlobber) EXPECT

func (m *MockGlobber) EXPECT() *MockGlobberMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGlobber) Glob

func (m *MockGlobber) Glob() ([]*Config, error)

Glob mocks base method.

type MockGlobberMockRecorder

type MockGlobberMockRecorder struct {
	// contains filtered or unexported fields
}

MockGlobberMockRecorder is the mock recorder for MockGlobber.

func (*MockGlobberMockRecorder) Glob

func (mr *MockGlobberMockRecorder) Glob() *gomock.Call

Glob indicates an expected call of Glob.

type MockSizer

type MockSizer struct {
	// contains filtered or unexported fields
}

MockSizer is a mock of Sizer interface.

func NewMockSizer

func NewMockSizer(ctrl *gomock.Controller) *MockSizer

NewMockSizer creates a new mock instance.

func (*MockSizer) EXPECT

func (m *MockSizer) EXPECT() *MockSizerMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSizer) Size

func (m *MockSizer) Size() (int64, error)

Size mocks base method.

type MockSizerMockRecorder

type MockSizerMockRecorder struct {
	// contains filtered or unexported fields
}

MockSizerMockRecorder is the mock recorder for MockSizer.

func (*MockSizerMockRecorder) Size

func (mr *MockSizerMockRecorder) Size() *gomock.Call

Size indicates an expected call of Size.

type MockSource

type MockSource struct {
	// contains filtered or unexported fields
}

MockSource is a mock of Source interface.

func NewMockSource

func NewMockSource(ctrl *gomock.Controller) *MockSource

NewMockSource creates a new mock instance.

func (*MockSource) Close

func (m *MockSource) Close() error

Close mocks base method.

func (*MockSource) Config

func (m *MockSource) Config() *Config

Config mocks base method.

func (*MockSource) EXPECT

func (m *MockSource) EXPECT() *MockSourceMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSource) Name

func (m *MockSource) Name() string

Name mocks base method.

func (*MockSource) Open

func (m *MockSource) Open() error

Open mocks base method.

func (*MockSource) Read

func (m *MockSource) Read(p []byte) (int, error)

Read mocks base method.

func (*MockSource) Size

func (m *MockSource) Size() (int64, error)

Size mocks base method.

type MockSourceMockRecorder

type MockSourceMockRecorder struct {
	// contains filtered or unexported fields
}

MockSourceMockRecorder is the mock recorder for MockSource.

func (*MockSourceMockRecorder) Close

func (mr *MockSourceMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockSourceMockRecorder) Config

func (mr *MockSourceMockRecorder) Config() *gomock.Call

Config indicates an expected call of Config.

func (*MockSourceMockRecorder) Name

func (mr *MockSourceMockRecorder) Name() *gomock.Call

Name indicates an expected call of Name.

func (*MockSourceMockRecorder) Open

func (mr *MockSourceMockRecorder) Open() *gomock.Call

Open indicates an expected call of Open.

func (*MockSourceMockRecorder) Read

func (mr *MockSourceMockRecorder) Read(p interface{}) *gomock.Call

Read indicates an expected call of Read.

func (*MockSourceMockRecorder) Size

func (mr *MockSourceMockRecorder) Size() *gomock.Call

Size indicates an expected call of Size.

type OSSConfig

type OSSConfig struct {
	Endpoint        string `yaml:"endpoint,omitempty" json:"endpoint,omitempty,optional"`
	AccessKeyID     string `yaml:"accessKeyID,omitempty" json:"accessKeyID,omitempty,optional"`
	AccessKeySecret string `yaml:"accessKeySecret,omitempty" json:"accessKeySecret,omitempty,optional"`
	Bucket          string `yaml:"bucket,omitempty" json:"bucket,omitempty,optional"`
	Key             string `yaml:"key,omitempty" json:"key,omitempty,optional"`
}

func (*OSSConfig) String

func (c *OSSConfig) String() string

type S3Config

type S3Config struct {
	Endpoint         string `yaml:"endpoint,omitempty" json:"endpoint,omitempty,optional"`
	Region           string `yaml:"region,omitempty" json:"region,omitempty,optional"`
	AccessKeyID      string `yaml:"accessKeyID,omitempty" json:"accessKeyID,omitempty,optional"`
	AccessKeySecret  string `yaml:"accessKeySecret,omitempty" json:"accessKeySecret,omitempty,optional"`
	S3ForcePathStyle bool   `yaml:"s3ForcePathStyle,omitempty" json:"s3ForcePathStyle,omitempty,optional,default=true"`
	Token            string `yaml:"token,omitempty" json:"token,omitempty,optional"`
	Bucket           string `yaml:"bucket,omitempty" json:"bucket,omitempty,optional"`
	Key              string `yaml:"key,omitempty" json:"key,omitempty,optional"`
}

func (*S3Config) String

func (c *S3Config) String() string

type SFTPConfig

type SFTPConfig struct {
	Host       string `yaml:"host,omitempty" json:"host,omitempty,optional"`
	Port       int    `yaml:"port,omitempty" json:"port,omitempty,optional"`
	User       string `yaml:"user,omitempty" json:"user,omitempty,optional"`
	Password   string `yaml:"password,omitempty" json:"password,omitempty,optional"`
	KeyFile    string `yaml:"keyFile,omitempty" json:"keyFile,omitempty,optional"`
	KeyData    string `yaml:"keyData,omitempty" json:"keyData,omitempty,optional"`
	Passphrase string `yaml:"passphrase,omitempty" json:"passphrase,omitempty,optional"`
	Path       string `yaml:"path,omitempty" json:"path,omitempty,optional"`
}

func (*SFTPConfig) String

func (c *SFTPConfig) String() string

type SQLConfig added in v1.0.9

type SQLConfig struct {
	Endpoint         string   `yaml:"endpoint,omitempty" json:"endpoint"`
	DbName           string   `yaml:"dbName,omitempty" json:"dbName"`
	DbTable          SQLTable `yaml:"dbTable" json:"dbTable"`
	Username         string   `yaml:"username,omitempty" json:"username"`
	Password         string   `yaml:"password,omitempty" json:"password"`
	UrlQuery         string   `yaml:"urlQuery,omitempty" json:"urlQuery,omitempty,optional"`
	DriverName       string   `yaml:"driverName,omitempty" json:"driverName,omitempty,optional,default=mysql"`
	MaxConnections   int      `yaml:"maxConnections,omitempty" json:"maxConnections,omitempty,optional,default=100"`
	MaxIdleConns     int      `yaml:"maxIdleConns,omitempty" json:"maxIdleConns,omitempty,optional,default=20"`
	MaxLifetimeMills int      `yaml:"maxLifetimeMills,omitempty" json:"maxLifetimeMills,omitempty,optional,default=3600000000000"`
	MaxIdleTimeMills int      `yaml:"maxIdleTimeMills,omitempty" json:"maxIdleTimeMills,omitempty,optional,default=30000000000"`
}

func (*SQLConfig) String added in v1.0.9

func (c *SQLConfig) String() string

type SQLId added in v1.1.18

type SQLId struct {
	Name  string `yaml:"name,omitempty" json:"name,omitempty,optional,default=id"`
	Index int    `yaml:"index,omitempty" json:"index,omitempty,optional,default=0"`
	Alias string `yaml:"alias,omitempty" json:"alias,omitempty,optional"`
}

type SQLSource added in v1.0.9

type SQLSource struct {
	Db *sql.DB
	// contains filtered or unexported fields
}

func (*SQLSource) BuildCountSQL added in v1.1.24

func (s *SQLSource) BuildCountSQL() (countSQL string, err error)

func (*SQLSource) BuildQuerySQL added in v1.1.24

func (s *SQLSource) BuildQuerySQL(lastId string, batch int) string

func (*SQLSource) Close added in v1.0.9

func (s *SQLSource) Close() error

func (*SQLSource) Config added in v1.0.9

func (s *SQLSource) Config() *Config

func (*SQLSource) Connect added in v1.1.23

func (s *SQLSource) Connect(dbname string) (db *sql.DB, err error)

func (*SQLSource) Name added in v1.0.9

func (s *SQLSource) Name() string

func (*SQLSource) Open added in v1.0.9

func (s *SQLSource) Open() (err error)

func (*SQLSource) Read added in v1.0.9

func (s *SQLSource) Read(p []byte) (int, error)

func (*SQLSource) Size added in v1.0.9

func (s *SQLSource) Size() (total int64, err error)

func (*SQLSource) String added in v1.0.9

func (s *SQLSource) String() string

type SQLTable added in v1.0.9

type SQLTable struct {
	Id     SQLId    `yaml:"id" json:"id"`
	Name   string   `yaml:"name,omitempty" json:"name,omitempty,optional"`
	Fields []string `yaml:"fields,omitempty" json:"fields,omitempty,optional"`
	Query  string   `yaml:"query,omitempty" json:"query,omitempty,optional"`
	Count  string   `yaml:"count,omitempty" json:"count,omitempty,optional"`
	Filter string   `yaml:"filter,omitempty" json:"filter,omitempty,optional"`
}

func (*SQLTable) PrimaryKey added in v1.0.9

func (t *SQLTable) PrimaryKey() string

type Sizer

type Sizer interface {
	Size() (int64, error)
}

type Source

type Source interface {
	Config() *Config
	Name() string
	Open() error
	Sizer
	io.Reader
	io.Closer
}

func New

func New(c *Config) (Source, error)

Jump to

Keyboard shortcuts

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