repository

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateFunc

type CreateFunc func(name string) (io.Writer, error)

type FileRepository

type FileRepository struct {
	MkdirAll  func(path string, perm os.FileMode) error
	Create    func(name string) (io.Writer, error)
	CSVWriter utils.CSVWriterUtilInterface
}

func (*FileRepository) CreateDirectory

func (r *FileRepository) CreateDirectory(filePath string) error

func (*FileRepository) EncodeCSV

func (r *FileRepository) EncodeCSV(writer io.Writer, data interface{}) error

func (*FileRepository) EncodeJSON

func (r *FileRepository) EncodeJSON(writer io.Writer, data interface{}) error

func (*FileRepository) EncodeXML

func (r *FileRepository) EncodeXML(writer io.Writer, data interface{}) error

func (*FileRepository) EncodeYAML

func (r *FileRepository) EncodeYAML(writer io.Writer, data interface{}) error

func (*FileRepository) SaveFile

func (r *FileRepository) SaveFile(filePath string, data interface{}, format string) error

func (*FileRepository) WriteCSV

func (r *FileRepository) WriteCSV(writer io.Writer, header []string, rows [][]string) error

func (*FileRepository) WriteTxt

func (r *FileRepository) WriteTxt(writer io.Writer, data interface{}) error

type FileRepositoryInterface

type FileRepositoryInterface interface {
	SaveFile(filePath string, data interface{}, format string) error
	CreateDirectory(filePath string) error
	WriteTxt(writer io.Writer, data interface{}) error
	EncodeCSV(writer io.Writer, data interface{}) error
	WriteCSV(writer io.Writer, header []string, rows [][]string) error
	EncodeJSON(writer io.Writer, data interface{}) error
	EncodeXML(writer io.Writer, data interface{}) error
	EncodeYAML(writer io.Writer, data interface{}) error
}

func NewFileRepository

func NewFileRepository(mkdirAll MkdirAllFunc, create CreateFunc, csvWriter utils.CSVWriterUtilInterface) FileRepositoryInterface

type MkdirAllFunc

type MkdirAllFunc func(path string, perm os.FileMode) error

type ProxyRepository

type ProxyRepository struct {
	Mutex              sync.RWMutex
	AllClassicView     []string
	HTTPClassicView    []string
	HTTPSClassicView   []string
	SOCKS4ClassicView  []string
	SOCKS5ClassicView  []string
	AllAdvancedView    []entity.AdvancedProxy
	HTTPAdvancedView   []entity.Proxy
	HTTPSAdvancedView  []entity.Proxy
	SOCKS4AdvancedView []entity.Proxy
	SOCKS5AdvancedView []entity.Proxy
}

func (*ProxyRepository) GetAllAdvancedView

func (r *ProxyRepository) GetAllAdvancedView() []entity.AdvancedProxy

func (*ProxyRepository) GetAllClassicView

func (r *ProxyRepository) GetAllClassicView() []string

func (*ProxyRepository) GetHTTPAdvancedView

func (r *ProxyRepository) GetHTTPAdvancedView() []entity.Proxy

func (*ProxyRepository) GetHTTPClassicView

func (r *ProxyRepository) GetHTTPClassicView() []string

func (*ProxyRepository) GetHTTPSAdvancedView

func (r *ProxyRepository) GetHTTPSAdvancedView() []entity.Proxy

func (*ProxyRepository) GetHTTPSClassicView

func (r *ProxyRepository) GetHTTPSClassicView() []string

func (*ProxyRepository) GetSOCKS4AdvancedView

func (r *ProxyRepository) GetSOCKS4AdvancedView() []entity.Proxy

func (*ProxyRepository) GetSOCKS4ClassicView

func (r *ProxyRepository) GetSOCKS4ClassicView() []string

func (*ProxyRepository) GetSOCKS5AdvancedView

func (r *ProxyRepository) GetSOCKS5AdvancedView() []entity.Proxy

func (*ProxyRepository) GetSOCKS5ClassicView

func (r *ProxyRepository) GetSOCKS5ClassicView() []string

func (*ProxyRepository) Store

func (r *ProxyRepository) Store(proxy *entity.Proxy)

type ProxyRepositoryInterface

type ProxyRepositoryInterface interface {
	Store(proxy *entity.Proxy)
	GetAllClassicView() []string
	GetHTTPClassicView() []string
	GetHTTPSClassicView() []string
	GetSOCKS4ClassicView() []string
	GetSOCKS5ClassicView() []string
	GetAllAdvancedView() []entity.AdvancedProxy
	GetHTTPAdvancedView() []entity.Proxy
	GetHTTPSAdvancedView() []entity.Proxy
	GetSOCKS4AdvancedView() []entity.Proxy
	GetSOCKS5AdvancedView() []entity.Proxy
}

func NewProxyRepository

func NewProxyRepository() ProxyRepositoryInterface

type SourceRepository

type SourceRepository struct {
	ProxyResources string
}

func (*SourceRepository) LoadSources

func (r *SourceRepository) LoadSources() ([]entity.Source, error)

type SourceRepositoryInterface

type SourceRepositoryInterface interface {
	LoadSources() ([]entity.Source, error)
}

func NewSourceRepository

func NewSourceRepository(proxyResources string) SourceRepositoryInterface

Jump to

Keyboard shortcuts

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