Documentation ¶
Index ¶
- type APIClient
- func (client *APIClient) AddPackageToRepository(pkg, dir, repository string) error
- func (client *APIClient) CreateRepository(name, comment, defaultDistribution, defaultComponent string) (*Repository, error)
- func (client *APIClient) CreateRepositoryDefaults(name, distribution string) (*Repository, error)
- func (client *APIClient) GetOrCreateAndPublishRepository(name, distribution string) (*Repository, error)
- func (client *APIClient) GetRepositories() ([]*Repository, error)
- func (client *APIClient) GetRepository(name string) (*Repository, error)
- func (client *APIClient) Publish(prefix string, publishParameters *PublishParameters) error
- func (client *APIClient) PublishDefaults(repositoryName string) error
- func (client *APIClient) UpdatePublishedRepository(prefix, distribution string, params *PublishedRepositoryUpdateParameters) error
- func (client *APIClient) UpdatePublishedRepositoryDefaults(repositoryName, distribution string) error
- func (client *APIClient) UploadFileInDirectory(content io.Reader, filename, directory string) error
- func (client *APIClient) UploadPackageAndAddToRepository(packageName string, packageContent io.Reader, repositoryName string) error
- type HTTPClient
- type PublishParameters
- type PublishedRepositoryUpdateParameters
- type Repository
- type SigningOptions
- type Source
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 ¶
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.1
func (client *APIClient) CreateRepositoryDefaults(name, distribution string) (*Repository, error)
CreateRepositoryDefaults creates a new repository with sensible defaults
func (*APIClient) GetOrCreateAndPublishRepository ¶ added in v0.15.1
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 ¶
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 ¶
UploadFileInDirectory will upload a file in a directory
type HTTPClient ¶
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