contrib

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithFactory

func WithFactory(ft Factory)

WithFactory set factory singleton

Types

type Contrib

type Contrib interface {
	GetHeadSHA1() (string, error)
	Sync(*SyncReq) (SyncRes, error)
}

Contrib contrib to be implement

type Factory

type Factory func(options interface {
	repository.ConfigReader
}) (Contrib, error)

Factory factory function to new contrib instance

func UseFactory

func UseFactory() Factory

UseFactory get factory singleton

type PrefixConfig

type PrefixConfig string

PrefixConfig config prefix

func (PrefixConfig) MayConfig

func (p PrefixConfig) MayConfig(r repository.ConfigReader, key string) string

MayConfig get config with prefix, if error occur, return ""

func (PrefixConfig) MustConfig

func (p PrefixConfig) MustConfig(r repository.ConfigReader, key string) (string, error)

MustConfig get config with prefix

type SyncReq

type SyncReq struct {
	SHA1    string
	Uploads []string
	Deletes []string
}

SyncReq sync request info

type SyncRes

type SyncRes struct {
	SHA1     string
	Uploaded []string
	Deleted  []string
}

SyncRes sync response info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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