synchronization

package
v0.0.0-...-e9f0680 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enable     bool
	StorageDir string
	Repository []*Repository
}

Config defines the config structure

func NewConfig

func NewConfig() *Config

type Repository

type Repository struct {
	Address string
	Branch  string
}

type Service

type Service struct {
	logger.Logger
	// contains filtered or unexported fields
}

func New

func New(cfg *Config, log logger.Logger) (*Service, error)

New 自动同步本地和远程库的服务

func (*Service) Synchronize

func (s *Service) Synchronize(ctx context.Context, callback func(repository string, updated bool, err error) error) error

Synchronize 同步仓库,同步完成后会执行 callback,其中 updated 字段用于通知这个 callback 当前仓库是否有变更过

Jump to

Keyboard shortcuts

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