service

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFile = func(file string, message string) error {
		return fmt.Errorf("invalid file format: %s => %s", file, message)
	}
	ErrInvalidOutput = func(output string) error {
		return fmt.Errorf("invalid output type: %s", output)
	}
)

Functions

This section is empty.

Types

type Downloader

type Downloader interface {
	GetFile(file *domain.File) ([]byte, error)
}

type Service

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

func New

func New(writer Writer) *Service

func (*Service) Download

func (s *Service) Download(file string, outDirectory string, outPath string) error

func (*Service) GenConfig

func (s *Service) GenConfig(configFile string) error

GenConfig generates a default configuration file for the protosync tool in the current directory

func (*Service) GetDownloader

func (s *Service) GetDownloader(domain string) (Downloader, bool)

func (*Service) Register

func (s *Service) Register(domain string, d Downloader)

type WriteProvider

type WriteProvider struct{}

func NewWriteProvider

func NewWriteProvider() *WriteProvider

func (*WriteProvider) Write

func (p *WriteProvider) Write(file string, content []byte, overide bool) error

type Writer

type Writer interface {
	Write(file string, content []byte, overide bool) error
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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