remote

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 18 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHTTPClient

func CreateHTTPClient(config *core.Remote) (*http.Client, error)

CreateHTTPClient creates a httpClient for the given remote settings.

Types

type FormatURLSchema

type FormatURLSchema struct {
	Endpoint            string
	CreateFormat        string
	GetFormat           string
	GetVersionFormat    string
	GetAllFormat        string
	GetVersionsOfFormat string
}

FormatURLSchema allows the definition of the url schema with string formats. Each format gets the base url plus the the function arguments as format parameters.

func (*FormatURLSchema) Create

func (schema *FormatURLSchema) Create(name string) string

Create returns the url for pushing dogu.json files to the backend

func (*FormatURLSchema) Get

func (schema *FormatURLSchema) Get(name string) string

Get returns the url for the latest version of the dogu

func (*FormatURLSchema) GetAll

func (schema *FormatURLSchema) GetAll() string

GetAll returns the url for fetching all dogu descriptors

func (*FormatURLSchema) GetVersion

func (schema *FormatURLSchema) GetVersion(name string, version string) string

GetVersion returns the url for one specific version of the dogu.json

func (*FormatURLSchema) GetVersionsOf

func (schema *FormatURLSchema) GetVersionsOf(name string) string

GetVersionsOf returns the url for fetching all versions of a dogu

type Registry

type Registry interface {
	// Create the dogu on the remote server.
	Create(dogu *core.Dogu) error
	// Get returns the detail about a dogu from the remote server.
	Get(name string) (*core.Dogu, error)
	// GetVersion returns a version specific detail about the dogu. Name is mandatory. Version is optional; if no version
	// is given then the newest version will be returned.
	GetVersion(name, version string) (*core.Dogu, error)
	// GetAll returns all dogus from the remote server.
	GetAll() ([]*core.Dogu, error)
	// GetVersionsOf return all versions of a dogu.
	GetVersionsOf(name string) ([]core.Version, error)
	// SetUseCache disables or enables the caching for the remote registry.
	SetUseCache(useCache bool)
	// Delete removes a specific dogu descriptor from the dogu registry.
	Delete(dogu *core.Dogu) error
}

Registry is able to manage the remote dogu registry.

func New

func New(remoteConfig *core.Remote, credentials *core.Credentials) (Registry, error)

New creates a new remote registry

type URLSchema

type URLSchema interface {
	// Create returns the url for pushing dogu.json files to the backend
	Create(name string) string
	// Get returns the url for the latest version of the dogu
	Get(name string) string
	// GetVersion returns the url for one specific version of the dogu.json
	GetVersion(name string, version string) string
	// GetAll returns the url for fetching all dogu descriptors
	GetAll() string
	// GetVersionsOf returns the url for fetching all versions of a dogu
	GetVersionsOf(name string) string
}

URLSchema creates the url for the remote backend

func NewDefaultURLSchema

func NewDefaultURLSchema(endpoint string) URLSchema

NewDefaultURLSchema returns the url schema of the active backend.

func NewIndexURLSchema

func NewIndexURLSchema(endpoint string) URLSchema

NewIndexURLSchema returns the url schema which is required if the dogu descriptors are mirrored to a webserver.

func NewURLSchemaByName

func NewURLSchemaByName(name string, endpoint string) URLSchema

NewURLSchemaByName returns the url schema for the given name or nil if no url schema exists with this name.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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