Documentation
¶
Index ¶
- Constants
- func MakeEndpointOfDeleteRepository(s Static) endpoint.Endpoint
- func MakeEndpointOfGetRepositoryFileByName(s Static) endpoint.Endpoint
- func MakeEndpointOfGetRepositoryFileByTag(s Static) endpoint.Endpoint
- func MakeEndpointOfListRepositoryFiles(s Static) endpoint.Endpoint
- func MakeEndpointOfListRepositoryLogs(s Static) endpoint.Endpoint
- func MakeEndpointOfRemoveRepositoryFile(s Static) endpoint.Endpoint
- func NewHTTPRouter(svc Static, codecs httpcodec.Codecs, opts ...httpoption.Option) chi.Router
- func OASv2APIDoc(schema oas2.Schema) string
- func RepositoryMatch(repository string) bool
- func ValidateDeleteRepositoryRequest(newSchema func(*DeleteRepositoryRequest) validating.Schema) httpoption.Validator
- func ValidateGetRepositoryFileByNameRequest(newSchema func(*GetRepositoryFileByNameRequest) validating.Schema) httpoption.Validator
- func ValidateGetRepositoryFileByTagRequest(newSchema func(*GetRepositoryFileByTagRequest) validating.Schema) httpoption.Validator
- func ValidateListRepositoryFilesRequest(newSchema func(*ListRepositoryFilesRequest) validating.Schema) httpoption.Validator
- func ValidateListRepositoryLogsRequest(newSchema func(*ListRepositoryLogsRequest) validating.Schema) httpoption.Validator
- func ValidateRemoveRepositoryFileRequest(newSchema func(*RemoveRepositoryFileRequest) validating.Schema) httpoption.Validator
- type DeleteRepositoryRequest
- type DeleteRepositoryResponse
- type GetRepositoryFileByNameRequest
- type GetRepositoryFileByNameResponse
- type GetRepositoryFileByTagRequest
- type GetRepositoryFileByTagResponse
- type HTTPClient
- func (c *HTTPClient) DeleteRepository(ctx context.Context, repository string, deleteFiles bool) (err error)
- func (c *HTTPClient) GetRepositoryFileByName(ctx context.Context, repository string, name string) (repositoryFile *RepositoryFile, err error)
- func (c *HTTPClient) GetRepositoryFileByTag(ctx context.Context, repository string, tag string) (repositoryFile *RepositoryFile, err error)
- func (c *HTTPClient) ListRepositoryFiles(ctx context.Context, repository string, page *Page) (repositoryFiles []*RepositoryFile, err error)
- func (c *HTTPClient) ListRepositoryLogs(ctx context.Context, repository string, page *Page) (logs []RepositoryLog, err error)
- func (c *HTTPClient) RemoveRepositoryFile(ctx context.Context, repository string, tag string) (err error)
- type ListRepositoryFilesRequest
- type ListRepositoryFilesResponse
- type ListRepositoryLogsRequest
- type ListRepositoryLogsResponse
- type Page
- type RemoveRepositoryFileRequest
- type RemoveRepositoryFileResponse
- type RepositoryFile
- type RepositoryLog
- type Static
Constants ¶
const ( RepositoryRegex = "^(artifacts/static/[a-z0-9]+(?:[/._-][a-z0-9]+)*)$" URLPath = "/artifacts/static/api/v1" )
Variables ¶
This section is empty.
Functions ¶
func MakeEndpointOfDeleteRepository ¶
MakeEndpointOfDeleteRepository creates the endpoint for s.DeleteRepository.
func MakeEndpointOfGetRepositoryFileByName ¶
MakeEndpointOfGetRepositoryFileByName creates the endpoint for s.GetRepositoryFileByName.
func MakeEndpointOfGetRepositoryFileByTag ¶
MakeEndpointOfGetRepositoryFileByTag creates the endpoint for s.GetRepositoryFileByTag.
func MakeEndpointOfListRepositoryFiles ¶
MakeEndpointOfListRepositoryFiles creates the endpoint for s.ListRepositoryFiles.
func MakeEndpointOfListRepositoryLogs ¶
MakeEndpointOfListRepositoryLogs creates the endpoint for s.ListRepositoryLogs.
func MakeEndpointOfRemoveRepositoryFile ¶
MakeEndpointOfRemoveRepositoryFile creates the endpoint for s.RemoveRepositoryFile.
func NewHTTPRouter ¶
func OASv2APIDoc ¶
func RepositoryMatch ¶ added in v0.0.12
func ValidateDeleteRepositoryRequest ¶
func ValidateDeleteRepositoryRequest(newSchema func(*DeleteRepositoryRequest) validating.Schema) httpoption.Validator
ValidateDeleteRepositoryRequest creates a validator for DeleteRepositoryRequest.
func ValidateGetRepositoryFileByNameRequest ¶
func ValidateGetRepositoryFileByNameRequest(newSchema func(*GetRepositoryFileByNameRequest) validating.Schema) httpoption.Validator
ValidateGetRepositoryFileByNameRequest creates a validator for GetRepositoryFileByNameRequest.
func ValidateGetRepositoryFileByTagRequest ¶
func ValidateGetRepositoryFileByTagRequest(newSchema func(*GetRepositoryFileByTagRequest) validating.Schema) httpoption.Validator
ValidateGetRepositoryFileByTagRequest creates a validator for GetRepositoryFileByTagRequest.
func ValidateListRepositoryFilesRequest ¶
func ValidateListRepositoryFilesRequest(newSchema func(*ListRepositoryFilesRequest) validating.Schema) httpoption.Validator
ValidateListRepositoryFilesRequest creates a validator for ListRepositoryFilesRequest.
func ValidateListRepositoryLogsRequest ¶
func ValidateListRepositoryLogsRequest(newSchema func(*ListRepositoryLogsRequest) validating.Schema) httpoption.Validator
ValidateListRepositoryLogsRequest creates a validator for ListRepositoryLogsRequest.
func ValidateRemoveRepositoryFileRequest ¶
func ValidateRemoveRepositoryFileRequest(newSchema func(*RemoveRepositoryFileRequest) validating.Schema) httpoption.Validator
ValidateRemoveRepositoryFileRequest creates a validator for RemoveRepositoryFileRequest.
Types ¶
type DeleteRepositoryRequest ¶
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 GetRepositoryFileByNameResponse ¶
type GetRepositoryFileByNameResponse struct {
RepositoryFile *RepositoryFile `json:"repository_file"`
Err error `json:"-"`
}
func (*GetRepositoryFileByNameResponse) Body ¶
func (r *GetRepositoryFileByNameResponse) Body() interface{}
func (*GetRepositoryFileByNameResponse) Failed ¶
func (r *GetRepositoryFileByNameResponse) Failed() error
Failed implements endpoint.Failer.
type GetRepositoryFileByTagResponse ¶
type GetRepositoryFileByTagResponse struct {
RepositoryFile *RepositoryFile `json:"repository_file"`
Err error `json:"-"`
}
func (*GetRepositoryFileByTagResponse) Body ¶
func (r *GetRepositoryFileByTagResponse) Body() interface{}
func (*GetRepositoryFileByTagResponse) Failed ¶
func (r *GetRepositoryFileByTagResponse) Failed() error
Failed implements endpoint.Failer.
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func (*HTTPClient) DeleteRepository ¶
func (*HTTPClient) GetRepositoryFileByName ¶
func (c *HTTPClient) GetRepositoryFileByName(ctx context.Context, repository string, name string) (repositoryFile *RepositoryFile, err error)
func (*HTTPClient) GetRepositoryFileByTag ¶
func (c *HTTPClient) GetRepositoryFileByTag(ctx context.Context, repository string, tag string) (repositoryFile *RepositoryFile, err error)
func (*HTTPClient) ListRepositoryFiles ¶
func (c *HTTPClient) ListRepositoryFiles(ctx context.Context, repository string, page *Page) (repositoryFiles []*RepositoryFile, err error)
func (*HTTPClient) ListRepositoryLogs ¶
func (c *HTTPClient) ListRepositoryLogs(ctx context.Context, repository string, page *Page) (logs []RepositoryLog, err error)
func (*HTTPClient) RemoveRepositoryFile ¶
type ListRepositoryFilesResponse ¶
type ListRepositoryFilesResponse struct {
RepositoryFiles []*RepositoryFile `json:"repository_files"`
Err error `json:"-"`
}
func (*ListRepositoryFilesResponse) Body ¶
func (r *ListRepositoryFilesResponse) Body() interface{}
func (*ListRepositoryFilesResponse) Failed ¶
func (r *ListRepositoryFilesResponse) Failed() error
Failed implements endpoint.Failer.
type ListRepositoryLogsResponse ¶
type ListRepositoryLogsResponse struct {
Logs []RepositoryLog `json:"logs"`
Err error `json:"-"`
}
func (*ListRepositoryLogsResponse) Body ¶
func (r *ListRepositoryLogsResponse) Body() interface{}
func (*ListRepositoryLogsResponse) Failed ¶
func (r *ListRepositoryLogsResponse) Failed() error
Failed implements endpoint.Failer.
type RemoveRepositoryFileResponse ¶
type RemoveRepositoryFileResponse struct {
Err error `json:"-"`
}
func (*RemoveRepositoryFileResponse) Body ¶
func (r *RemoveRepositoryFileResponse) Body() interface{}
func (*RemoveRepositoryFileResponse) Failed ¶
func (r *RemoveRepositoryFileResponse) Failed() error
Failed implements endpoint.Failer.
type RepositoryFile ¶
type RepositoryFile struct {
Tag string `json:"tag"`
ID string `json:"id"`
Name string `json:"name"`
UploadTime string `json:"upload_time"`
Size uint64 `json:"size"`
}
Repository files.
type RepositoryLog ¶
type RepositoryLog struct {
Level string `json:"level"`
Date string `json:"date"`
Message string `json:"message"`
}
Repository logs.
type Static ¶
type Static interface {
// Delete a static repository.
//kun:op DELETE /repository
//kun:success statusCode=200
DeleteRepository(ctx context.Context, repository string, deleteFiles bool) (err error)
// List static repository logs.
//kun:op GET /repository/logs
//kun:success statusCode=200
ListRepositoryLogs(ctx context.Context, repository string, page *Page) (logs []RepositoryLog, err error)
// Get file information by tag from static repository.
//kun:op GET /repository/file:bytag
//kun:success statusCode=200
GetRepositoryFileByTag(ctx context.Context, repository string, tag string) (repositoryFile *RepositoryFile, err error)
// Get file information by name from static repository.
//kun:op GET /repository/file:byname
//kun:success statusCode=200
GetRepositoryFileByName(ctx context.Context, repository string, name string) (repositoryFile *RepositoryFile, err error)
// Remove file from static repository.
//kun:op DELETE /repository/file
//kun:success statusCode=200
RemoveRepositoryFile(ctx context.Context, repository string, tag string) (err error)
// List files for a static repository.
//kun:op GET /repository/file:list
//kun:success statusCode=200
ListRepositoryFiles(ctx context.Context, repository string, page *Page) (repositoryFiles []*RepositoryFile, err error)
}
Static is used for managing static file repositories. This is the API documentation of Static.