Documentation ¶
Index ¶
- func AtomicWriteFile(filename string, reader io.Reader, mode os.FileMode) error
- func CheckResponse(r *http.Response) error
- func CopyDir(src, dst string) error
- func IsDir(name string) (bool, error)
- func IsSymlink(path string) (bool, error)
- func RenameWithFallback(src, dst string) error
- func VersionOrdinal(version string) string
- type AuthType
- type ChartOption
- type ChartService
- func (c *ChartService) DeleteChart(repo string, chartVersionOptions ChartVersionOption, ...) (*Response, error)
- func (c *ChartService) DownloadChart(repo string, dest string, chartVersionOptions ChartVersionOption, ...) (*Response, error)
- func (c *ChartService) GetLatestChartVersionWithRegex(repo string, chart ChartOption, regex string, options ...RequestOptionFunc) (version string, err error)
- func (c *ChartService) GetVersion(repo string, chartVersionOptions ChartVersionOption, ...) (*helmrepo.ChartVersion, *Response, error)
- func (c *ChartService) IsExist(repo string, chartOptions ChartOption, options ...RequestOptionFunc) (bool, *Response, error)
- func (c *ChartService) IsExistVersion(repo string, chartVersionOptions ChartVersionOption, ...) (bool, *Response, error)
- func (c *ChartService) ListCharts(repo string, options ...RequestOptionFunc) (*map[string]helmrepo.ChartVersions, *Response, error)
- func (c *ChartService) ListVersions(repo string, chartOptions ChartOption, options ...RequestOptionFunc) (*helmrepo.ChartVersions, *Response, error)
- func (c *ChartService) UploadChart(repo, chartFilePath string, options ...RequestOptionFunc) (*Response, error)
- type ChartVersionOption
- type Client
- type ClientOptionFunc
- type ErrorResponse
- type Healthy
- type InfoService
- type RequestOptionFunc
- type Response
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AtomicWriteFile ¶
AtomicWriteFile atomically (as atomic as os.Rename allows) writes a file to a disk.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present.
func CopyDir ¶
CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist.
func RenameWithFallback ¶
RenameWithFallback attempts to rename a file or directory, but falls back to copying in the event of a cross-device link error. If the fallback copy succeeds, src is still removed, emulating normal rename behavior.
func VersionOrdinal ¶
Types ¶
type ChartOption ¶
type ChartOption struct {
Name *string `json:"chart-name,omitempty"`
}
func NewChartOption ¶
func NewChartOption(name string) ChartOption
type ChartService ¶
type ChartService struct {
// contains filtered or unexported fields
}
func (*ChartService) DeleteChart ¶
func (c *ChartService) DeleteChart(repo string, chartVersionOptions ChartVersionOption, options ...RequestOptionFunc) (*Response, error)
func (*ChartService) DownloadChart ¶
func (c *ChartService) DownloadChart(repo string, dest string, chartVersionOptions ChartVersionOption, options ...RequestOptionFunc) (*Response, error)
func (*ChartService) GetLatestChartVersionWithRegex ¶
func (c *ChartService) GetLatestChartVersionWithRegex(repo string, chart ChartOption, regex string, options ...RequestOptionFunc) (version string, err error)
func (*ChartService) GetVersion ¶
func (c *ChartService) GetVersion(repo string, chartVersionOptions ChartVersionOption, options ...RequestOptionFunc) (*helmrepo.ChartVersion, *Response, error)
func (*ChartService) IsExist ¶
func (c *ChartService) IsExist(repo string, chartOptions ChartOption, options ...RequestOptionFunc) (bool, *Response, error)
func (*ChartService) IsExistVersion ¶
func (c *ChartService) IsExistVersion(repo string, chartVersionOptions ChartVersionOption, options ...RequestOptionFunc) (bool, *Response, error)
func (*ChartService) ListCharts ¶
func (c *ChartService) ListCharts(repo string, options ...RequestOptionFunc) (*map[string]helmrepo.ChartVersions, *Response, error)
func (*ChartService) ListVersions ¶
func (c *ChartService) ListVersions(repo string, chartOptions ChartOption, options ...RequestOptionFunc) (*helmrepo.ChartVersions, *Response, error)
func (*ChartService) UploadChart ¶
func (c *ChartService) UploadChart(repo, chartFilePath string, options ...RequestOptionFunc) (*Response, error)
type ChartVersionOption ¶
type ChartVersionOption struct { ChartOption Version *string `json:"chart-version,omitempty"` }
func NewChartVersionOption ¶
func NewChartVersionOption(name string, version string) ChartVersionOption
type Client ¶
type Client struct { // User agent used when communicating with the GitHub API. UserAgent string // Services used for talking to different parts of the ChartMuseum API. //Repositories *RepositoriesService Charts *ChartService Info *InfoService // contains filtered or unexported fields }
func NewBasicAuthClient ¶
func NewBasicAuthClient(username, password string, options ...ClientOptionFunc) (*Client, error)
NewBasicAuthClient returns a new GitLab API client. To use API methods which require authentication, provide a valid username and password.
func NewClient ¶
func NewClient(options ...ClientOptionFunc) (*Client, error)
NewClient returns a new ChartMuseum API client.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, path string, opt interface{}, options []RequestOptionFunc) (*retryablehttp.Request, error)
NewRequest creates a new API request. The method expects a relative URL path that will be resolved relative to the base URL of the Client. Relative URL paths should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included as the request body.
type ClientOptionFunc ¶
func WithBaseURL ¶
func WithBaseURL(urlStr string) ClientOptionFunc
WithBaseURL sets the base URL for API requests to a custom endpoint.
type ErrorResponse ¶
An ErrorResponse reports one or more errors caused by an API request.
GitLab API docs: https://docs.gitlab.com/ce/api/README.html#data-validation-and-error-reporting
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type InfoService ¶
type InfoService struct {
// contains filtered or unexported fields
}
func (*InfoService) Health ¶
func (s *InfoService) Health(options ...RequestOptionFunc) (*Healthy, error)
func (*InfoService) Index ¶
func (s *InfoService) Index(options ...RequestOptionFunc) (string, error)
func (*InfoService) Info ¶
func (s *InfoService) Info(options ...RequestOptionFunc) (*Version, error)
type RequestOptionFunc ¶
type RequestOptionFunc func(*retryablehttp.Request) error
RequestOptionFunc can be passed to all API requests to customize the API request.
func WithContext ¶
func WithContext(ctx context.Context) RequestOptionFunc
WithContext runs the request with the provided context
func WithUpload ¶
func WithUpload(mediaType string, size int64) RequestOptionFunc
type Response ¶
type Response struct { *http.Response Message string `json:"message,omitempty"` Error string `json:"error,omitempty"` Saved bool `json:"saved,omitempty"` Deleted bool `json:"deleted,omitempty"` Healthy bool `json:"healthy,omitempty"` }
Response wraps http.Response and decodes ChartMuseum response