sdkman

package
v0.9.1-beta2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2021 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
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 SDKDownload struct {
	bytes.Buffer
}

type SDKList added in v0.7.0

type SDKList []string

func (SDKList) Format added in v0.7.0

func (s SDKList) Format(f fmt.State, verb rune)

func (SDKList) String added in v0.7.0

func (s SDKList) String() string

nolint: gomnd

type TableFormatter added in v0.7.0

type TableFormatter func(f fmt.State, verb rune)

type VersionService added in v0.8.0

type VersionService service

func (*VersionService) All added in v0.8.0

func (s *VersionService) All(ctx context.Context, sdk string, arch a.Arch) (versions []string, err error)

func (*VersionService) Default added in v0.8.0

func (s *VersionService) Default(ctx context.Context, sdk string) (version string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL