varlinkdef

package
v0.0.0-...-b4f51b2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package varlinkdef implements the Varlink interface definition format.

See: https://varlink.org/Interface-Definition

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeBool   = Type{Kind: KindBool}
	TypeInt    = Type{Kind: KindInt}
	TypeFloat  = Type{Kind: KindFloat}
	TypeString = Type{Kind: KindString}
	TypeObject = Type{Kind: KindObject}
)

Functions

This section is empty.

Types

type Enum

type Enum []string

type Interface

type Interface struct {
	Name    string
	Types   map[string]Type // only KindStruct and KindEnum
	Methods map[string]Method
	Errors  map[string]Struct
}

func Read

func Read(r io.Reader) (*Interface, error)

type Kind

type Kind int
const (
	KindStruct Kind = iota + 1
	KindEnum
	KindName
	KindBool
	KindInt
	KindFloat
	KindString
	KindObject
	KindArray
	KindMap
)

func (Kind) String

func (kind Kind) String() string

type Method

type Method struct {
	In, Out Struct
}

type Struct

type Struct map[string]Type

type Type

type Type struct {
	Kind     Kind
	Nullable bool
	Inner    *Type  // for KindArray and KindMap
	Name     string // for KindName
	Struct   Struct // for KindStruct
	Enum     Enum   // for KindEnum
}

Jump to

Keyboard shortcuts

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