types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package types contains representations of the relapse types. These types are specified as a protocol buffer enum so that they can be included in the expr ast protocol buffer specification.

Index

Constants

This section is empty.

Variables

View Source
var Type_name = map[int32]string{
	0:   "UNKNOWN",
	101: "SINGLE_DOUBLE",
	103: "SINGLE_INT",
	104: "SINGLE_UINT",
	108: "SINGLE_BOOL",
	109: "SINGLE_STRING",
	112: "SINGLE_BYTES",
	201: "LIST_DOUBLE",
	203: "LIST_INT",
	204: "LIST_UINT",
	208: "LIST_BOOL",
	209: "LIST_STRING",
	212: "LIST_BYTES",
}
View Source
var Type_value = map[string]int32{
	"UNKNOWN":       0,
	"SINGLE_DOUBLE": 101,
	"SINGLE_INT":    103,
	"SINGLE_UINT":   104,
	"SINGLE_BOOL":   108,
	"SINGLE_STRING": 109,
	"SINGLE_BYTES":  112,
	"LIST_DOUBLE":   201,
	"LIST_INT":      203,
	"LIST_UINT":     204,
	"LIST_BOOL":     208,
	"LIST_STRING":   209,
	"LIST_BYTES":    212,
}

Functions

func IsList

func IsList(typ Type) bool

IsList returns whether the type is a list type

func IsSingle

func IsSingle(typ Type) bool

IsSingle returns whether the type is not a list type.

Types

type Type

type Type int32
const (
	UNKNOWN       Type = 0
	SINGLE_DOUBLE Type = 101
	SINGLE_INT    Type = 103
	SINGLE_UINT   Type = 104
	SINGLE_BOOL   Type = 108
	SINGLE_STRING Type = 109
	SINGLE_BYTES  Type = 112
	LIST_DOUBLE   Type = 201
	LIST_INT      Type = 203
	LIST_UINT     Type = 204
	LIST_BOOL     Type = 208
	LIST_STRING   Type = 209
	LIST_BYTES    Type = 212
)

func FromGo

func FromGo(typ reflect.Type) Type

FromGo is given the reflected type of a native type and returns the corresponding expression type.

func ListToSingle

func ListToSingle(typ Type) Type

ListToSingle returns the respective type as if the type was not a list type.

func SingleToList

func SingleToList(typ Type) Type

SingleToList returns the list type of the respective type.

func (Type) Enum

func (x Type) Enum() *Type

func (Type) EnumDescriptor

func (Type) EnumDescriptor() ([]byte, []int)

func (Type) String

func (x Type) String() string

func (*Type) UnmarshalJSON

func (x *Type) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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