Documentation
¶
Index ¶
- Variables
- func RegisterRepo(name string, f UpdateClientRepo) error
- type UpdateClientAppV1Repo
- func (ap UpdateClientAppV1Repo) Delete(name string) error
- func (ap UpdateClientAppV1Repo) GetFile(fullname string) ([]byte, error)
- func (ap UpdateClientAppV1Repo) GetMeta() ([]byte, error)
- func (ap UpdateClientAppV1Repo) GetMetaSign() ([]byte, error)
- func (ap UpdateClientAppV1Repo) GetPublicKey() ([]byte, error)
- func (ap UpdateClientAppV1Repo) List() ([]string, error)
- func (ap UpdateClientAppV1Repo) NRString() string
- func (ap *UpdateClientAppV1Repo) New(url string) (UpdateClientRepo, error)
- func (ap UpdateClientAppV1Repo) Put(name string, content []byte, method utils.EncryptMethod) error
- func (ap UpdateClientAppV1Repo) String() string
- func (ap *UpdateClientAppV1Repo) Supported(protocal string) bool
- type UpdateClientRepo
Constants ¶
This section is empty.
Variables ¶
var ( // ErrorsUCRepoInvalid occurs when a repository is invalid ErrorsUCRepoInvalid = errors.New("repository is invalid") // ErrorsUCRepoNotSupported occurs when a url is not supported by existed implementations ErrorsUCRepoNotSupported = errors.New("repository protocal is not supported") )
Functions ¶
func RegisterRepo ¶
func RegisterRepo(name string, f UpdateClientRepo) error
RegisterRepo provides a way to dynamically register an implementation of a Repo.
If RegisterRepo is called twice with the same name if Repo is nil, or if the name is blank, it panics.
Types ¶
type UpdateClientAppV1Repo ¶
UpdateClientAppV1Repo represents the 'appV1' repo
func (UpdateClientAppV1Repo) Delete ¶
func (ap UpdateClientAppV1Repo) Delete(name string) error
Delete removes an application with a name from a repository
func (UpdateClientAppV1Repo) GetFile ¶
func (ap UpdateClientAppV1Repo) GetFile(fullname string) ([]byte, error)
GetFile gets the application data by its name
func (UpdateClientAppV1Repo) GetMeta ¶
func (ap UpdateClientAppV1Repo) GetMeta() ([]byte, error)
GetMeta gets the meta data of a repository
func (UpdateClientAppV1Repo) GetMetaSign ¶
func (ap UpdateClientAppV1Repo) GetMetaSign() ([]byte, error)
GetMetaSign gets the meta signature data of a repository
func (UpdateClientAppV1Repo) GetPublicKey ¶
func (ap UpdateClientAppV1Repo) GetPublicKey() ([]byte, error)
GetPublicKey gets the public key data of a repository
func (UpdateClientAppV1Repo) List ¶
func (ap UpdateClientAppV1Repo) List() ([]string, error)
List lists the applications of a remote repository
func (UpdateClientAppV1Repo) NRString ¶
func (ap UpdateClientAppV1Repo) NRString() string
NRString returns 'namespace/repo'
func (*UpdateClientAppV1Repo) New ¶
func (ap *UpdateClientAppV1Repo) New(url string) (UpdateClientRepo, error)
New parses 'http://containerops/dockyard.me/containerops/dockyard/offical' and get
Site: "containerops/dockyard.me" Namespace: "containerops/dockyard" Repo: "offical"
func (UpdateClientAppV1Repo) Put ¶
func (ap UpdateClientAppV1Repo) Put(name string, content []byte, method utils.EncryptMethod) error
Put adds an application with a name to a repository
func (UpdateClientAppV1Repo) String ¶
func (ap UpdateClientAppV1Repo) String() string
String returns the full appV1 url
func (*UpdateClientAppV1Repo) Supported ¶
func (ap *UpdateClientAppV1Repo) Supported(protocal string) bool
Supported checks if a protocal is "appv1"
type UpdateClientRepo ¶
type UpdateClientRepo interface { Supported(url string) bool New(url string) (UpdateClientRepo, error) List() ([]string, error) GetFile(name string) ([]byte, error) GetPublicKey() ([]byte, error) GetMeta() ([]byte, error) GetMetaSign() ([]byte, error) Put(name string, content []byte, method utils.EncryptMethod) error Delete(name string) error NRString() string String() string }
UpdateClientRepo reprensents the local repo interface
func NewUCRepo ¶
func NewUCRepo(url string) (UpdateClientRepo, error)
NewUCRepo creates a update client repo by a url