api

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Platform  = newApisMustParse([]string{"0.3", "0.4", "0.5", "0.6"}, nil)
	Buildpack = newApisMustParse([]string{"0.2", "0.3", "0.4", "0.5", "0.6"}, nil)
)

Functions

This section is empty.

Types

type APIs added in v0.9.0

type APIs struct {
	Supported  []*Version
	Deprecated []*Version
}

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 Version

type Version struct {
	Major,
	Minor uint64
}

func MustParse

func MustParse(v string) *Version

func NewVersion

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

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

IsAPICompatible determines if the lifecycle's API version is compatible with another's API version.

Example Usage Pseudocode:

IsAPICompatible(Platform API from Lifecycle, Platform API from Platform)
IsAPICompatible(Buildpack API from Lifecycle, Buildpack API from Buildpack)

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