java

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const AdoptAPI = "https://api.adoptopenjdk.net/v3"

Variables

View Source
var (
	ErrInvalidVersionString     = errors.New("invalid java version string. must consist of at most 3 parts separated by dashes")
	ErrInvalidFeatureVersion    = errors.New("invalid feature version. must be a number between 1 and 65535")
	ErrInvalidImageType         = errors.New("invalid image type. must be either jdk, jre, testimage or debugimage")
	ErrInvalidJvmImplementation = errors.New("invalid jvm implementation. must be hotspot or openj9")
)

Functions

This section is empty.

Types

type AdoptAsset

type AdoptAsset struct {
	Binaries []struct {
		Architecture  string `json:"architecture"`
		DownloadCount int    `json:"download_count"`
		HeapSize      string `json:"heap_size"`
		ImageType     string `json:"image_type"`
		JvmImpl       string `json:"jvm_impl"`
		Os            string `json:"os"`
		Package       struct {
			Checksum      string `json:"checksum"`
			ChecksumLink  string `json:"checksum_link"`
			DownloadCount int    `json:"download_count"`
			Link          string `json:"link"`
			MetadataLink  string `json:"metadata_link"`
			Name          string `json:"name"`
			Size          int    `json:"size"`
		} `json:"package"`
		Project   string    `json:"project"`
		ScmRef    string    `json:"scm_ref"`
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"binaries"`
	DownloadCount int       `json:"download_count"`
	ID            string    `json:"id"`
	ReleaseLink   string    `json:"release_link"`
	ReleaseName   string    `json:"release_name"`
	ReleaseType   string    `json:"release_type"`
	Timestamp     time.Time `json:"timestamp"`
	UpdatedAt     time.Time `json:"updated_at"`
	Vendor        string    `json:"vendor"`
	VersionData   struct {
		Build          int    `json:"build"`
		Major          int    `json:"major"`
		Minor          int    `json:"minor"`
		OpenjdkVersion string `json:"openjdk_version"`
		Security       int    `json:"security"`
		Semver         string `json:"semver"`
	} `json:"version_data"`
}

type AdoptAssetRequest

type AdoptAssetRequest struct {
	// contains filtered or unexported fields
}

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(baseDir string) *Factory

func (*Factory) SetHTTPClient

func (j *Factory) SetHTTPClient(c *http.Client)

SetHTTPClient replaces the default http client with the given one

func (*Factory) Version

func (j *Factory) Version(ctx context.Context, wantedVersion string) (*Java, error)

type Java

type Java struct {
	// contains filtered or unexported fields
}

func (*Java) Bin

func (j *Java) Bin() string

func (*Java) NeedsDownloading

func (j *Java) NeedsDownloading() bool

func (*Java) Update

func (j *Java) Update(ctx context.Context) error

Update downloads or updates this java version

Jump to

Keyboard shortcuts

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