filestore

package
v0.0.0-...-9a8bf5a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileConfig

type FileConfig struct {
	Type string
	Name string
	Size int64
}

type FileStore

type FileStore interface {
	ReadFile(path string, startLine ...int) ([]string, error)
	ListFiles(dir string) ([]FileConfig, error)
	Close() error
}

func NewFileStore

func NewFileStore(typ, config, secret, platform string) (FileStore, error)

type S3Config

type S3Config struct {
	Endpoint     string
	Region       string
	Bucket       string
	AccessKeyID  string
	AccessSecret string
}

type S3Store

type S3Store struct {
	S3Client s3iface.S3API
	Bucket   string
}

func NewS3Store

func NewS3Store(platform, endpoint, region, bucket, accessKeyID, accessSecret string) (*S3Store, error)

func (*S3Store) Close

func (s *S3Store) Close() error

func (*S3Store) ListBuckets

func (s *S3Store) ListBuckets() ([]string, error)

func (*S3Store) ListFiles

func (s *S3Store) ListFiles(s3path string) ([]FileConfig, error)

func (*S3Store) ReadFile

func (s *S3Store) ReadFile(s3path string, startLine ...int) ([]string, error)

type SftpConfig

type SftpConfig struct {
	Host     string
	Port     int
	Username string
	Password string
}

type SftpStore

type SftpStore struct {
	Host       string
	Port       int
	Username   string
	Password   string
	SftpClient *sftp.Client
}

func NewSftpStore

func NewSftpStore(host string, port int, username string, password string) (*SftpStore, error)

func (*SftpStore) Close

func (s *SftpStore) Close() error

func (*SftpStore) ListFiles

func (s *SftpStore) ListFiles(dir string) ([]FileConfig, error)

func (*SftpStore) ReadFile

func (s *SftpStore) ReadFile(path string, startLine ...int) ([]string, error)

Jump to

Keyboard shortcuts

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