types

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	String  = Primitive("string")
	Bool    = Primitive("bool")
	Int     = Primitive("int")
	Float64 = Primitive("float64")
	Byte    = Primitive("byte")
)

Variables

This section is empty.

Functions

func NewField

func NewField(name string, comment []string, t Type) *field

Types

type Array

type Array struct {
	Elem Type
}

func ArrayOf

func ArrayOf(elem Type) *Array

func (*Array) GetComment

func (a *Array) GetComment() []string

func (*Array) GetFields

func (a *Array) GetFields() []Field

func (*Array) GetName

func (a *Array) GetName() string

func (*Array) String

func (a *Array) String() string

type Field

type Field interface {
	GetName() string
	GetComment() []string
	GetType() Type
}

type FieldMapper

type FieldMapper interface {
	GetFromProto(src, dest string) string
	GetToProto(src, dest string) string
}

type FieldMapperFunc

type FieldMapperFunc func(src, dest string) string

type Map

type Map struct {
	Key Primitive
	Val Type
}

func MapOf

func MapOf(key Primitive, val Type) *Map

func (*Map) GetComment

func (m *Map) GetComment() []string

func (*Map) GetFields

func (m *Map) GetFields() []Field

func (*Map) GetName

func (m *Map) GetName() string

func (*Map) String

func (m *Map) String() string

type Pointer

type Pointer struct {
	Type Type
}

func PointerOf

func PointerOf(t Type) *Pointer

func (*Pointer) GetComment

func (p *Pointer) GetComment() []string

func (Pointer) GetFields

func (p Pointer) GetFields() []Field

func (*Pointer) GetName

func (p *Pointer) GetName() string

func (*Pointer) String

func (p *Pointer) String() string

type Primitive

type Primitive string

func (Primitive) GetComment

func (t Primitive) GetComment() []string

func (Primitive) GetFields

func (t Primitive) GetFields() []Field

func (Primitive) GetName

func (t Primitive) GetName() string

func (Primitive) String

func (t Primitive) String() string

type Struct

type Struct struct {
	TypeName string
	Comment  []string
	Fields   []Field
}

func NewStruct

func NewStruct(name string, comment []string) *Struct

func (*Struct) GetComment

func (s *Struct) GetComment() []string

func (*Struct) GetFields

func (s *Struct) GetFields() []Field

func (*Struct) GetName

func (s *Struct) GetName() string

func (*Struct) String

func (s *Struct) String() string

type Type

type Type interface {
	GetName() string
	GetComment() []string
	GetFields() []Field
}

Jump to

Keyboard shortcuts

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