appstore

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeListAppsEndpoint

func MakeListAppsEndpoint(svc Service) endpoint.Endpoint

func MakeUploadAppEndpiont

func MakeUploadAppEndpiont(svc Service) endpoint.Endpoint

func RegisterHTTPHandlers

func RegisterHTTPHandlers(r *mux.Router, e Endpoints, options ...httptransport.ServerOption)

Types

type AppDTO

type AppDTO struct {
	Name    string `json:"name"`
	Payload []byte `json:"payload,omitempty"`
}

type AppService

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

func New

func New(store Store) *AppService

func (*AppService) ListApplications

func (svc *AppService) ListApplications(ctx context.Context, opts ListAppsOption) ([]AppDTO, error)

func (*AppService) UploadApp

func (svc *AppService) UploadApp(ctx context.Context, manifestName string, manifest io.Reader, pkgName string, pkg io.Reader) error

type Endpoints

type Endpoints struct {
	AppUploadEndpoint endpoint.Endpoint
	ListAppsEndpoint  endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service, outer endpoint.Middleware, others ...endpoint.Middleware) Endpoints

func (Endpoints) ListApplications

func (e Endpoints) ListApplications(ctx context.Context, opts ListAppsOption) ([]AppDTO, error)

func (Endpoints) UploadApp

func (e Endpoints) UploadApp(ctx context.Context, manifestName string, manifest io.Reader, pkgName string, pkg io.Reader) error

type ListAppsOption

type ListAppsOption struct {
	FilterName []string `json:"filter_name"`
}

type Service

type Service interface {
	UploadApp(ctx context.Context, manifestName string, manifest io.Reader, pkgName string, pkg io.Reader) error
	ListApplications(ctx context.Context, opt ListAppsOption) ([]AppDTO, error)
}

func NewHTTPClient

func NewHTTPClient(instance, token string, logger log.Logger, opts ...httptransport.ClientOption) (Service, error)

type Store

type Store interface {
	SaveFile(name string, f io.Reader) error
	Manifest(name string) (*appmanifest.Manifest, error)
	Apps(name string) (map[string]appmanifest.Manifest, error)
}

Directories

Path Synopsis
package builtin provides an abstraction for uploading files and manifests to a file repository.
package builtin provides an abstraction for uploading files and manifests to a file repository.

Jump to

Keyboard shortcuts

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