Skip to content

package libraryapi

import "github.com/cloudboss/unobin/pkg/libraryapi"

Functions

func Check

func Check(required string, descriptor Descriptor) error

Types

type Descriptor

type Descriptor struct {
    FormatVersion   int      `json:"format-version"`
    ImplementedAPIs []string `json:"implemented-apis"`
    GeneratorAPI    string   `json:"generator-api"`
}

func Current

func Current() Descriptor

func ReadDescriptor

func ReadDescriptor(moduleFS fs.FS) (Descriptor, error)

func (Descriptor) Validate

func (d Descriptor) Validate() error

type NewerMinorError

type NewerMinorError struct {
    Required    Version
    Implemented Version
}

func (*NewerMinorError) Error

func (e *NewerMinorError) Error() string

type UnsupportedMajorError

type UnsupportedMajorError struct {
    Required        Version
    ImplementedAPIs []string
}

func (*UnsupportedMajorError) Error

func (e *UnsupportedMajorError) Error() string

type Version

type Version struct {
    Major uint64
    Minor uint64
}

func Parse

func Parse(identifier string) (Version, error)

func (Version) String

func (v Version) String() string