api

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Platform is a pair of lists of Platform API versions:
	// 1. All supported versions (including deprecated versions)
	// 2. The versions that are deprecated
	Platform = newApisMustParse([]string{"0.7", "0.8", "0.9", "0.10", "0.11", "0.12", "0.13"}, []string{})
	// Buildpack is a pair of lists of Buildpack API versions:
	// 1. All supported versions (including deprecated versions)
	// 2. The versions that are deprecated
	Buildpack = newApisMustParse([]string{"0.7", "0.8", "0.9", "0.10", "0.11"}, []string{})
)

Functions

This section is empty.

Types

type APIs added in v0.9.0

type APIs struct {
	Supported  List
	Deprecated List
}

func NewAPIs added in v0.9.0

func NewAPIs(supported []string, deprecated []string) (APIs, error)

NewApis constructs an instance of APIs

supported must be a superset of deprecated
deprecated APIs greater than 1.0 should should not include minor versions
supported APIs should always include minor versions
Examples:
   deprecated API 1 implies all 1.x APIs are deprecated
   supported API 1 implies only 1.0 is supported

func (APIs) IsDeprecated added in v0.9.0

func (a APIs) IsDeprecated(target *Version) bool

IsDeprecated returns true or false depending on whether the target API is deprecated

func (APIs) IsSupported added in v0.9.0

func (a APIs) IsSupported(target *Version) bool

IsSupported returns true or false depending on whether the target API is supported

func (APIs) Latest added in v0.10.0

func (a APIs) Latest() *Version

Latest returns the latest API that is supported

type List added in v0.13.0

type List []*Version

func (List) String added in v0.13.0

func (l List) String() string

type Version

type Version struct {
	Major,
	Minor uint64
}

func MustParse

func MustParse(v string) *Version

func NewVersion

func NewVersion(v string) (*Version, error)

func (*Version) AtLeast added in v0.12.0

func (v *Version) AtLeast(other string) bool

func (*Version) Compare

func (v *Version) Compare(o *Version) int

Compare returns one of the following results

-1 is less than *Version o
 0 is equal to *Version o
 1 is greater than *Version o

func (*Version) Equal

func (v *Version) Equal(o *Version) bool

func (*Version) IsSupersetOf added in v0.9.0

func (v *Version) IsSupersetOf(o *Version) bool

func (*Version) LessThan added in v0.12.0

func (v *Version) LessThan(other string) bool

func (*Version) MarshalText

func (v *Version) MarshalText() ([]byte, error)

MarshalText makes Version satisfy the encoding.TextMarshaler interface.

func (*Version) String

func (v *Version) String() string

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) error

UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.

Jump to

Keyboard shortcuts

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