us

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: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrorsUSPNotSupported occurs when a protocal is not supported
	ErrorsUSPNotSupported = errors.New("protocal is not supported")
)

Functions

func Register

func Register(name string, f UpdateService) error

Register provides a way to dynamically register an implementation of a protocal.

If Register is called twice with the same name if 'protocal' is nil, or if the name is blank, it panics.

Types

type UpdateService

type UpdateService interface {
	Supported(protocal string) bool
	New(protocal string, storageURL string, kmURL string) (UpdateService, error)
	List(nr string) ([]string, error)
	GetPublicKey(nr string) ([]byte, error)
	GetMeta(nr string) ([]byte, error)
	GetMetaSign(nr string) ([]byte, error)
	Get(nr string, name string) ([]byte, error)
	// Return the path of local storage or key of object store
	Put(nr string, name string, data []byte, method utils.EncryptMethod) (string, error)
	Delete(nr string, name string) error
}

UpdateService represents the update service interface

func NewUpdateService

func NewUpdateService(protocal string, storageURL string, kmURL string) (UpdateService, error)

NewUpdateService create a update service protocal interface by a protocal type

type UpdateServiceAppV1

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

UpdateServiceAppV1 is the appV1 implementation of the update service proto

func (*UpdateServiceAppV1) Delete

func (app *UpdateServiceAppV1) Delete(nr, name string) error

Delete removes a appV1 file from a repository

func (*UpdateServiceAppV1) Get

func (app *UpdateServiceAppV1) Get(nr, name string) ([]byte, error)

Get gets the appV1 file data of a repository

func (*UpdateServiceAppV1) GetMeta

func (app *UpdateServiceAppV1) GetMeta(nr string) ([]byte, error)

GetMeta returns the meta data of a repository

func (*UpdateServiceAppV1) GetMetaSign

func (app *UpdateServiceAppV1) GetMetaSign(nr string) ([]byte, error)

GetMetaSign returns the meta signature data of a repository

func (*UpdateServiceAppV1) GetPublicKey

func (app *UpdateServiceAppV1) GetPublicKey(namespace string) ([]byte, error)

GetPublicKey returns the public key data of a repository

func (*UpdateServiceAppV1) List

func (app *UpdateServiceAppV1) List(nr string) ([]string, error)

List lists the applications of a repository

func (*UpdateServiceAppV1) New

func (app *UpdateServiceAppV1) New(proto string, storageURL string, kmURL string) (UpdateService, error)

New creates a update service interface by an appV1 proto

func (*UpdateServiceAppV1) Put

func (app *UpdateServiceAppV1) Put(nr, name string, data []byte, method utils.EncryptMethod) (string, error)

Put adds a appV1 file to a repository

func (*UpdateServiceAppV1) Supported

func (app *UpdateServiceAppV1) Supported(proto string) bool

Supported checks if a proto is 'appV1'

Jump to

Keyboard shortcuts

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