Documentation ¶
Index ¶
- Constants
- func MakeEndpointOfAddRemote(s OSTree) endpoint.Endpoint
- func MakeEndpointOfCreateRepository(s OSTree) endpoint.Endpoint
- func MakeEndpointOfDeleteRemote(s OSTree) endpoint.Endpoint
- func MakeEndpointOfDeleteRepository(s OSTree) endpoint.Endpoint
- func MakeEndpointOfGetRepositorySyncStatus(s OSTree) endpoint.Endpoint
- func MakeEndpointOfListRepositoryRefs(s OSTree) endpoint.Endpoint
- func MakeEndpointOfSyncRepository(s OSTree) endpoint.Endpoint
- func MakeEndpointOfUpdateRemote(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 ValidateDeleteRemoteRequest(newSchema func(*DeleteRemoteRequest) validating.Schema) httpoption.Validator
- func ValidateDeleteRepositoryRequest(newSchema func(*DeleteRepositoryRequest) validating.Schema) httpoption.Validator
- func ValidateGetRepositorySyncStatusRequest(newSchema func(*GetRepositorySyncStatusRequest) validating.Schema) httpoption.Validator
- func ValidateListRepositoryRefsRequest(newSchema func(*ListRepositoryRefsRequest) validating.Schema) httpoption.Validator
- func ValidateSyncRepositoryRequest(newSchema func(*SyncRepositoryRequest) validating.Schema) httpoption.Validator
- func ValidateUpdateRemoteRequest(newSchema func(*UpdateRemoteRequest) validating.Schema) httpoption.Validator
- type AddRemoteRequest
- type AddRemoteResponse
- type CreateRepositoryRequest
- type CreateRepositoryResponse
- type DeleteRemoteRequest
- type DeleteRemoteResponse
- 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) DeleteRemote(ctx context.Context, repository string, remoteName string) (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) ListRepositoryRefs(ctx context.Context, repository string) (refs []OSTreeRef, err error)
- func (c *HTTPClient) SyncRepository(ctx context.Context, repository string, ...) (err error)
- func (c *HTTPClient) UpdateRemote(ctx context.Context, repository string, remoteName string, ...) (err error)
- type ListRepositoryRefsRequest
- type ListRepositoryRefsResponse
- type OSTree
- type OSTreeRef
- type OSTreeRemoteProperties
- type OSTreeRepositoryProperties
- type OSTreeRepositorySyncRequest
- type Page
- type SyncRepositoryRequest
- type SyncRepositoryResponse
- type SyncStatus
- type UpdateRemoteRequest
- type UpdateRemoteResponse
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 MakeEndpointOfDeleteRemote ¶ added in v0.0.22
MakeEndpointOfDeleteRemote creates the endpoint for s.DeleteRemote.
func MakeEndpointOfDeleteRepository ¶
MakeEndpointOfDeleteRepository creates the endpoint for s.DeleteRepository.
func MakeEndpointOfGetRepositorySyncStatus ¶
MakeEndpointOfGetRepositorySyncStatus creates the endpoint for s.GetRepositorySyncStatus.
func MakeEndpointOfListRepositoryRefs ¶ added in v0.0.25
MakeEndpointOfListRepositoryRefs creates the endpoint for s.ListRepositoryRefs.
func MakeEndpointOfSyncRepository ¶
MakeEndpointOfSyncRepository creates the endpoint for s.SyncRepository.
func MakeEndpointOfUpdateRemote ¶ added in v0.0.22
MakeEndpointOfUpdateRemote creates the endpoint for s.UpdateRemote.
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 ValidateDeleteRemoteRequest ¶ added in v0.0.22
func ValidateDeleteRemoteRequest(newSchema func(*DeleteRemoteRequest) validating.Schema) httpoption.Validator
ValidateDeleteRemoteRequest creates a validator for DeleteRemoteRequest.
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 ValidateListRepositoryRefsRequest ¶ added in v0.0.25
func ValidateListRepositoryRefsRequest(newSchema func(*ListRepositoryRefsRequest) validating.Schema) httpoption.Validator
ValidateListRepositoryRefsRequest creates a validator for ListRepositoryRefsRequest.
func ValidateSyncRepositoryRequest ¶
func ValidateSyncRepositoryRequest(newSchema func(*SyncRepositoryRequest) validating.Schema) httpoption.Validator
ValidateSyncRepositoryRequest creates a validator for SyncRepositoryRequest.
func ValidateUpdateRemoteRequest ¶ added in v0.0.22
func ValidateUpdateRemoteRequest(newSchema func(*UpdateRemoteRequest) validating.Schema) httpoption.Validator
ValidateUpdateRemoteRequest creates a validator for UpdateRemoteRequest.
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 DeleteRemoteRequest ¶ added in v0.0.22
type DeleteRemoteResponse ¶ added in v0.0.22
type DeleteRemoteResponse struct {
Err error `json:"-"`
}
func (*DeleteRemoteResponse) Body ¶ added in v0.0.22
func (r *DeleteRemoteResponse) Body() interface{}
func (*DeleteRemoteResponse) Failed ¶ added in v0.0.22
func (r *DeleteRemoteResponse) 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) DeleteRemote ¶ added in v0.0.22
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) ListRepositoryRefs ¶ added in v0.0.25
func (*HTTPClient) SyncRepository ¶
func (c *HTTPClient) SyncRepository(ctx context.Context, repository string, properties *OSTreeRepositorySyncRequest) (err error)
func (*HTTPClient) UpdateRemote ¶ added in v0.0.22
func (c *HTTPClient) UpdateRemote(ctx context.Context, repository string, remoteName string, properties *OSTreeRemoteProperties) (err error)
type ListRepositoryRefsRequest ¶ added in v0.0.25
type ListRepositoryRefsRequest struct {
Repository string `json:"repository"`
}
type ListRepositoryRefsResponse ¶ added in v0.0.25
func (*ListRepositoryRefsResponse) Body ¶ added in v0.0.25
func (r *ListRepositoryRefsResponse) Body() interface{}
func (*ListRepositoryRefsResponse) Failed ¶ added in v0.0.25
func (r *ListRepositoryRefsResponse) Failed() error
Failed implements endpoint.Failer.
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) // List OSTree repository refs (A.K.A. Branches). //kun:op GET /repository/refs //kun:success statusCode=200 ListRepositoryRefs(ctx context.Context, repository string) (refs []OSTreeRef, 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) // Updates a remote in the OSTree repository. If it doesn't exist it will be created. //kun:op PUT /repository/remote //kun:success statusCode=200 UpdateRemote(ctx context.Context, repository string, remoteName string, properties *OSTreeRemoteProperties) (err error) // Delete an existing remote to the OSTree repository. //kun:op DELETE /repository/remote //kun:success statusCode=200 DeleteRemote(ctx context.Context, repository string, remoteName string) (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 and EphemeralRemote are mutually exclusive. EphemeralRemote takes precedence. Remote string `json:"remote"` // EphemeralRemote - A remote to add to the repository in Beskar for the duration of the sync. // Remote and EphemeralRemote are mutually exclusive. EphemeralRemote takes precedence. EphemeralRemote *OSTreeRemoteProperties `json:"ephemeral_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"` // Timeout - The timeout for the sync in seconds. Default is 1 hour. Timeout *durationpb.Duration `json:"timeout"` }
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.
type SyncStatus ¶
type SyncStatus struct { Syncing bool `json:"syncing"` StartTime string `json:"start_time"` EndTime string `json:"end_time"` SyncError string `json:"sync_error"` SyncedRefs []OSTreeRef `json:"synced_refs"` }
Mirror sync status.
type UpdateRemoteRequest ¶ added in v0.0.22
type UpdateRemoteRequest struct { Repository string `json:"repository"` RemoteName string `json:"remote_name"` Properties *OSTreeRemoteProperties `json:"properties"` }
type UpdateRemoteResponse ¶ added in v0.0.22
type UpdateRemoteResponse struct {
Err error `json:"-"`
}
func (*UpdateRemoteResponse) Body ¶ added in v0.0.22
func (r *UpdateRemoteResponse) Body() interface{}
func (*UpdateRemoteResponse) Failed ¶ added in v0.0.22
func (r *UpdateRemoteResponse) Failed() error
Failed implements endpoint.Failer.