aptly

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

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

APIClient is a client to the aptly REST API

func NewClient

func NewClient(apiURL *url.URL, httpClient HTTPClient) *APIClient

NewClient creates a new APIClient.

apiURL should contain "/api". For example: "http://localhost:8080/api"

func (*APIClient) AddPackageToRepository

func (client *APIClient) AddPackageToRepository(pkg, dir, repository string) error

AddPackageToRepository adds a package to a repository

func (*APIClient) CreateRepository

func (client *APIClient) CreateRepository(name, comment, defaultDistribution, defaultComponent string) (*Repository, error)

CreateRepository creates a new repository

func (*APIClient) CreateRepositoryDefaults added in v0.15.0

func (client *APIClient) CreateRepositoryDefaults(name, distribution string) (*Repository, error)

CreateRepositoryDefaults creates a new repository with sensible defaults

func (*APIClient) GetOrCreateAndPublishRepository added in v0.15.0

func (client *APIClient) GetOrCreateAndPublishRepository(name, distribution string) (*Repository, error)

GetOrCreateAndPublishRepository will get or create and publish a repository with sensible defaults

func (*APIClient) GetRepositories added in v0.14.0

func (client *APIClient) GetRepositories() ([]*Repository, error)

GetRepositories returns the list of existing repositories

func (*APIClient) GetRepository added in v0.14.0

func (client *APIClient) GetRepository(name string) (*Repository, error)

GetRepository will return the repository with the corresponding name

func (*APIClient) Publish

func (client *APIClient) Publish(prefix string, publishParameters *PublishParameters) error

Publish will publish a snapshot or a local repo

func (*APIClient) PublishDefaults

func (client *APIClient) PublishDefaults(repositoryName string) error

PublishDefaults will publish a snapshot or a local repo with sensible defaults

func (*APIClient) UpdatePublishedRepository

func (client *APIClient) UpdatePublishedRepository(prefix, distribution string, params *PublishedRepositoryUpdateParameters) error

UpdatePublishedRepository updates a published repository

func (*APIClient) UpdatePublishedRepositoryDefaults

func (client *APIClient) UpdatePublishedRepositoryDefaults(repositoryName, distribution string) error

UpdatePublishedRepositoryDefaults updates a published repository with sensible defaults

func (*APIClient) UploadFileInDirectory

func (client *APIClient) UploadFileInDirectory(content io.Reader, filename, directory string) error

UploadFileInDirectory will upload a file in a directory

func (*APIClient) UploadPackageAndAddToRepository added in v0.14.0

func (client *APIClient) UploadPackageAndAddToRepository(packageName string, packageContent io.Reader, repositoryName string) error

UploadPackageAndAddToRepository will upload a package and add it to a repository

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPClient is needed for the APIClient to perform requests. Typically, it would be an &http.Client.

type PublishParameters

type PublishParameters struct {
	SourceKind           string          `json:"SourceKind"`
	Sources              []*Source       `json:"Sources"`
	Distribution         string          `json:"Distribution"`
	Label                string          `json:"Label"`
	Origin               string          `json:"Origin"`
	ForceOverwrite       bool            `json:"ForceOverwrite"`
	Architectures        []string        `json:"Architectures"`
	Signing              *SigningOptions `json:"Signing"`
	NotAutomatic         string          `json:"NotAutomatic"`
	ButAutomaticUpgrades string          `json:"ButAutomaticUpgrades"`
	SkipCleanup          string          `json:"SkipCleanup"`
	AcquireByHash        bool            `json:"AcquireByHash"`
}

PublishParameters are used to publish a snapshot or local repository

type PublishedRepositoryUpdateParameters

type PublishedRepositoryUpdateParameters struct {
	Snapshots      []*Source       `json:"Snapshots"`
	ForceOverwrite bool            `json:"ForceOverwrite"`
	Signing        *SigningOptions `json:"Signing"`
	AcquireByHash  bool            `json:"AcquireByHash"`
}

PublishedRepositoryUpdateParameters holds parameters required to update a published repository

type Repository

type Repository struct {
	Name                string `json:"Name"`
	Comment             string `json:"Comment"`
	DefaultDistribution string `json:"DefaultDistribution"`
	DefaultComponent    string `json:"DefaultComponent"`
}

Repository represents a repository

type SigningOptions

type SigningOptions struct {
	Skip           bool   `json:"Skip"`
	Batch          bool   `json:"Batch"`
	GpgKey         string `json:"GpgKey"`
	Keyring        string `json:"Keyring"`
	SecretKeyring  string `json:"SecretKeyring"`
	Passphrase     string `json:"Passphrase"`
	PassphraseFile string `json:"PassphraseFile"`
}

SigningOptions contain gpg options

type Source

type Source struct {
	Component string `json:"Component"`
	Name      string `json:"Name"`
}

Source is a local repository or a snapshot name

Jump to

Keyboard shortcuts

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