Documentation ¶
Index ¶
- Constants
- func MakeEndpointOfAddRemote(s OSTree) endpoint.Endpoint
- func MakeEndpointOfCreateRepository(s OSTree) endpoint.Endpoint
- func MakeEndpointOfDeleteRepository(s OSTree) endpoint.Endpoint
- func MakeEndpointOfGetRepositorySyncStatus(s OSTree) endpoint.Endpoint
- func MakeEndpointOfSyncRepository(s OSTree) endpoint.Endpoint
- func NewHTTPRouter(svc OSTree, codecs httpcodec.Codecs, opts ...httpoption.Option) chi.Router
- func OASv2APIDoc(schema oas2.Schema) string
- func RepositoryMatch(repository string) bool
- func ValidateAddRemoteRequest(newSchema func(*AddRemoteRequest) validating.Schema) httpoption.Validator
- func ValidateCreateRepositoryRequest(newSchema func(*CreateRepositoryRequest) validating.Schema) httpoption.Validator
- func ValidateDeleteRepositoryRequest(newSchema func(*DeleteRepositoryRequest) validating.Schema) httpoption.Validator
- func ValidateGetRepositorySyncStatusRequest(newSchema func(*GetRepositorySyncStatusRequest) validating.Schema) httpoption.Validator
- func ValidateSyncRepositoryRequest(newSchema func(*SyncRepositoryRequest) validating.Schema) httpoption.Validator
- type AddRemoteRequest
- type AddRemoteResponse
- type CreateRepositoryRequest
- type CreateRepositoryResponse
- type DeleteRepositoryRequest
- type DeleteRepositoryResponse
- type GetRepositorySyncStatusRequest
- type GetRepositorySyncStatusResponse
- type HTTPClient
- func (c *HTTPClient) AddRemote(ctx context.Context, repository string, properties *OSTreeRemoteProperties) (err error)
- func (c *HTTPClient) CreateRepository(ctx context.Context, repository string, properties *OSTreeRepositoryProperties) (err error)
- func (c *HTTPClient) DeleteRepository(ctx context.Context, repository string) (err error)
- func (c *HTTPClient) GetRepositorySyncStatus(ctx context.Context, repository string) (syncStatus *SyncStatus, err error)
- func (c *HTTPClient) SyncRepository(ctx context.Context, repository string, ...) (err error)
- type OSTree
- type OSTreeRemoteProperties
- type OSTreeRepositoryProperties
- type OSTreeRepositorySyncRequest
- type Page
- type SyncRepositoryRequest
- type SyncRepositoryResponse
- type SyncStatus
Constants ¶
const ( RepositoryRegex = "^(artifacts/ostree/[a-z0-9]+(?:[/._-][a-z0-9]+)*)$" URLPath = "/artifacts/ostree/api/v1" )
Variables ¶
This section is empty.
Functions ¶
func MakeEndpointOfAddRemote ¶
MakeEndpointOfAddRemote creates the endpoint for s.AddRemote.
func MakeEndpointOfCreateRepository ¶
MakeEndpointOfCreateRepository creates the endpoint for s.CreateRepository.
func MakeEndpointOfDeleteRepository ¶
MakeEndpointOfDeleteRepository creates the endpoint for s.DeleteRepository.
func MakeEndpointOfGetRepositorySyncStatus ¶
MakeEndpointOfGetRepositorySyncStatus creates the endpoint for s.GetRepositorySyncStatus.
func MakeEndpointOfSyncRepository ¶
MakeEndpointOfSyncRepository creates the endpoint for s.SyncRepository.
func NewHTTPRouter ¶
func OASv2APIDoc ¶
func RepositoryMatch ¶
func ValidateAddRemoteRequest ¶
func ValidateAddRemoteRequest(newSchema func(*AddRemoteRequest) validating.Schema) httpoption.Validator
ValidateAddRemoteRequest creates a validator for AddRemoteRequest.
func ValidateCreateRepositoryRequest ¶
func ValidateCreateRepositoryRequest(newSchema func(*CreateRepositoryRequest) validating.Schema) httpoption.Validator
ValidateCreateRepositoryRequest creates a validator for CreateRepositoryRequest.
func ValidateDeleteRepositoryRequest ¶
func ValidateDeleteRepositoryRequest(newSchema func(*DeleteRepositoryRequest) validating.Schema) httpoption.Validator
ValidateDeleteRepositoryRequest creates a validator for DeleteRepositoryRequest.
func ValidateGetRepositorySyncStatusRequest ¶
func ValidateGetRepositorySyncStatusRequest(newSchema func(*GetRepositorySyncStatusRequest) validating.Schema) httpoption.Validator
ValidateGetRepositorySyncStatusRequest creates a validator for GetRepositorySyncStatusRequest.
func ValidateSyncRepositoryRequest ¶
func ValidateSyncRepositoryRequest(newSchema func(*SyncRepositoryRequest) validating.Schema) httpoption.Validator
ValidateSyncRepositoryRequest creates a validator for SyncRepositoryRequest.
Types ¶
type AddRemoteRequest ¶
type AddRemoteRequest struct { Repository string `json:"repository"` Properties *OSTreeRemoteProperties `json:"properties"` }
type AddRemoteResponse ¶
type AddRemoteResponse struct {
Err error `json:"-"`
}
func (*AddRemoteResponse) Body ¶
func (r *AddRemoteResponse) Body() interface{}
func (*AddRemoteResponse) Failed ¶
func (r *AddRemoteResponse) Failed() error
Failed implements endpoint.Failer.
type CreateRepositoryRequest ¶
type CreateRepositoryRequest struct { Repository string `json:"repository"` Properties *OSTreeRepositoryProperties `json:"properties"` }
type CreateRepositoryResponse ¶
type CreateRepositoryResponse struct {
Err error `json:"-"`
}
func (*CreateRepositoryResponse) Body ¶
func (r *CreateRepositoryResponse) Body() interface{}
func (*CreateRepositoryResponse) Failed ¶
func (r *CreateRepositoryResponse) Failed() error
Failed implements endpoint.Failer.
type DeleteRepositoryRequest ¶
type DeleteRepositoryRequest struct {
Repository string `json:"repository"`
}
type DeleteRepositoryResponse ¶
type DeleteRepositoryResponse struct {
Err error `json:"-"`
}
func (*DeleteRepositoryResponse) Body ¶
func (r *DeleteRepositoryResponse) Body() interface{}
func (*DeleteRepositoryResponse) Failed ¶
func (r *DeleteRepositoryResponse) Failed() error
Failed implements endpoint.Failer.
type GetRepositorySyncStatusRequest ¶
type GetRepositorySyncStatusRequest struct {
Repository string `json:"repository"`
}
type GetRepositorySyncStatusResponse ¶
type GetRepositorySyncStatusResponse struct { SyncStatus *SyncStatus `json:"sync_status"` Err error `json:"-"` }
func (*GetRepositorySyncStatusResponse) Body ¶
func (r *GetRepositorySyncStatusResponse) Body() interface{}
func (*GetRepositorySyncStatusResponse) Failed ¶
func (r *GetRepositorySyncStatusResponse) Failed() error
Failed implements endpoint.Failer.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func (*HTTPClient) AddRemote ¶
func (c *HTTPClient) AddRemote(ctx context.Context, repository string, properties *OSTreeRemoteProperties) (err error)
func (*HTTPClient) CreateRepository ¶
func (c *HTTPClient) CreateRepository(ctx context.Context, repository string, properties *OSTreeRepositoryProperties) (err error)
func (*HTTPClient) DeleteRepository ¶
func (c *HTTPClient) DeleteRepository(ctx context.Context, repository string) (err error)
func (*HTTPClient) GetRepositorySyncStatus ¶
func (c *HTTPClient) GetRepositorySyncStatus(ctx context.Context, repository string) (syncStatus *SyncStatus, err error)
func (*HTTPClient) SyncRepository ¶
func (c *HTTPClient) SyncRepository(ctx context.Context, repository string, properties *OSTreeRepositorySyncRequest) (err error)
type OSTree ¶
type OSTree interface { // Create an OSTree repository. //kun:op POST /repository //kun:success statusCode=200 CreateRepository(ctx context.Context, repository string, properties *OSTreeRepositoryProperties) (err error) // Delete a OSTree repository. //kun:op DELETE /repository //kun:success statusCode=202 DeleteRepository(ctx context.Context, repository string) (err error) // Add a new remote to the OSTree repository. //kun:op POST /repository/remote //kun:success statusCode=200 AddRemote(ctx context.Context, repository string, properties *OSTreeRemoteProperties) (err error) // Sync an ostree repository with one of the configured remotes. //kun:op POST /repository/sync //kun:success statusCode=202 SyncRepository(ctx context.Context, repository string, properties *OSTreeRepositorySyncRequest) (err error) // Get OSTree repository sync status. //kun:op GET /repository/sync //kun:success statusCode=200 GetRepositorySyncStatus(ctx context.Context, repository string) (syncStatus *SyncStatus, err error) }
OSTree is used for managing ostree repositories. This is the API documentation of OSTree.
type OSTreeRemoteProperties ¶
type OSTreeRemoteProperties struct { // Name - The name of the remote repository. Name string `json:"name"` // RemoteURL - The http url of the remote repository. RemoteURL string `json:"remote_url"` // GPGVerify - Whether to verify the GPG signature of the repository. NoGPGVerify bool `json:"no_gpg_verify"` }
type OSTreeRepositoryProperties ¶
type OSTreeRepositoryProperties struct { // Remotes - The remote repositories to mirror. Remotes []OSTreeRemoteProperties `json:"remotes"` }
type OSTreeRepositorySyncRequest ¶
type OSTreeRepositorySyncRequest struct { // Remote - The name of the remote to sync. Remote string `json:"remote"` // Refs - The branches/refs to mirror. Leave empty to mirror all branches/refs. Refs []string `json:"refs"` // Depth - The depth of the mirror. Defaults is 0, -1 means infinite. Depth int `json:"depth"` }
type SyncRepositoryRequest ¶
type SyncRepositoryRequest struct { Repository string `json:"repository"` Properties *OSTreeRepositorySyncRequest `json:"properties"` }
type SyncRepositoryResponse ¶
type SyncRepositoryResponse struct {
Err error `json:"-"`
}
func (*SyncRepositoryResponse) Body ¶
func (r *SyncRepositoryResponse) Body() interface{}
func (*SyncRepositoryResponse) Failed ¶
func (r *SyncRepositoryResponse) Failed() error
Failed implements endpoint.Failer.