client

package
v0.0.0-...-b9a05f1 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type UpdateClientAppV1Repo struct {
	Runmode   string
	Site      string
	Namespace string
	Repo      string
}

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

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

Jump to

Keyboard shortcuts

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