Documentation
¶
Index ¶
- type CreateFunc
- type FileRepository
- func (r *FileRepository) CreateDirectory(filePath string) error
- func (r *FileRepository) EncodeCSV(writer io.Writer, data interface{}) error
- func (r *FileRepository) EncodeJSON(writer io.Writer, data interface{}) error
- func (r *FileRepository) EncodeXML(writer io.Writer, data interface{}) error
- func (r *FileRepository) EncodeYAML(writer io.Writer, data interface{}) error
- func (r *FileRepository) SaveFile(filePath string, data interface{}, format string) error
- func (r *FileRepository) WriteCSV(writer io.Writer, header []string, rows [][]string) error
- func (r *FileRepository) WriteTxt(writer io.Writer, data interface{}) error
- type FileRepositoryInterface
- type MkdirAllFunc
- type ProxyRepository
- func (r *ProxyRepository) GetAllAdvancedView() []entity.AdvancedProxy
- func (r *ProxyRepository) GetAllClassicView() []string
- func (r *ProxyRepository) GetHTTPAdvancedView() []entity.Proxy
- func (r *ProxyRepository) GetHTTPClassicView() []string
- func (r *ProxyRepository) GetHTTPSAdvancedView() []entity.Proxy
- func (r *ProxyRepository) GetHTTPSClassicView() []string
- func (r *ProxyRepository) GetSOCKS4AdvancedView() []entity.Proxy
- func (r *ProxyRepository) GetSOCKS4ClassicView() []string
- func (r *ProxyRepository) GetSOCKS5AdvancedView() []entity.Proxy
- func (r *ProxyRepository) GetSOCKS5ClassicView() []string
- func (r *ProxyRepository) Store(proxy *entity.Proxy)
- type ProxyRepositoryInterface
- type SourceRepository
- type SourceRepositoryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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
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 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 ¶
func NewSourceRepository ¶
func NewSourceRepository(proxyResources string) SourceRepositoryInterface
Click to show internal directories.
Click to hide internal directories.