Documentation
¶
Index ¶
Constants ¶
const BaseURL = "https://api.sdkman.io/2"
BaseUrl BaseUrl of the remote sdkman api
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// Services used for talking to different parts of the SDKMAN API.
Download *DownloadService
Registry *RegistryService
Version *VersionService
ListSdks *ListAllSDKService
// contains filtered or unexported fields
}
Client provides access to the sdkman api
func NewSdkManClient ¶
func NewSdkManClient(options ...ClientOption) *Client
NewSdkManClient creates the default *Client using defaults and then the provided options
func (*Client) NewRequest ¶ added in v0.6.0
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error)
NewRequest creates an API request. A relative URL can be provided in urlStr, in which case it is resolved relative to the BaseURL of the ClientIn. Relative URLs 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 ClientConfig ¶ added in v0.6.0
type ClientConfig struct {
// contains filtered or unexported fields
}
ClientConfig contains configurable values for the creation of the sdkman.Client
type ClientOption ¶ added in v0.6.0
type ClientOption func(config *ClientConfig) *ClientConfig
ClientOption is a function which configures ClientConfig
func DefaultClientOptions ¶ added in v0.7.0
func DefaultClientOptions() []ClientOption
DefaultClientOptions configures the sdkman.Client using defaults
func FileSystemOption ¶ added in v0.6.0
func FileSystemOption(fs afero.Fs) ClientOption
FileSystemOption configures the afero.Fs used in the sdkman.Client
func HTTPClientOption ¶ added in v0.6.0
func HTTPClientOption(client *http.Client) ClientOption
HttpClientOption configures the internal http.Client for the sdkman.Client
func URLOptions ¶ added in v0.6.0
func URLOptions(baseURL string) ClientOption
SdkManUrlOptions configures the api baseurl
type DownloadService ¶
type DownloadService service
DownloadService downloads SDKs to the filesystem
func (*DownloadService) DownloadSDK ¶
func (s *DownloadService) DownloadSDK(ctx context.Context, sdk, version string, arch system.Arch) (dl *SDKDownload, err error)
DownloadSDK downloads the sdk from the sdkman broker. SDK specifies the sdk Version specifies the apiVersion system specifies the system [darwinx64,darwin] https://api.sdkman.io/2/broker/download/scala/scala-2.13.4/darwinx64 https://api.sdkman.io/2/broker/download/scala/2.13.4/darwinx64 nolint: lll
type ListAllSDKService ¶
type ListAllSDKService service
func (*ListAllSDKService) ListAllSDK ¶
func (s *ListAllSDKService) ListAllSDK(ctx context.Context) (sdks SDKList, resp *http.Response, err error)
CreateListAllAvailableSDKURI gets all available SDK and returns them as an array of strings https://api.sdkman.io/2/candidates/all
type RegistryService ¶ added in v0.8.0
type RegistryService service
type SDKDownload ¶
type TableFormatter ¶ added in v0.7.0
type VersionService ¶ added in v0.8.0
type VersionService service