v1

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Builtin_name = map[int32]string{
		0:  "ANY",
		1:  "BOOL",
		2:  "INT8",
		3:  "INT16",
		4:  "INT32",
		5:  "INT64",
		6:  "UINT8",
		7:  "UINT16",
		8:  "UINT32",
		9:  "UINT64",
		10: "FLOAT32",
		11: "FLOAT64",
		12: "STRING",
		13: "BYTES",
		14: "TIME",
		15: "UUID",
		16: "JSON",
		17: "USER_ID",
		18: "INT",
		19: "UINT",
	}
	Builtin_value = map[string]int32{
		"ANY":     0,
		"BOOL":    1,
		"INT8":    2,
		"INT16":   3,
		"INT32":   4,
		"INT64":   5,
		"UINT8":   6,
		"UINT16":  7,
		"UINT32":  8,
		"UINT64":  9,
		"FLOAT32": 10,
		"FLOAT64": 11,
		"STRING":  12,
		"BYTES":   13,
		"TIME":    14,
		"UUID":    15,
		"JSON":    16,
		"USER_ID": 17,
		"INT":     18,
		"UINT":    19,
	}
)

Enum value maps for Builtin.

View Source
var File_encore_parser_schema_v1_schema_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Builtin

type Builtin int32

Builtin represents a type which Encore (and Go) have inbuilt support for and so can be represented by Encore's tooling directly, rather than needing to understand the full implementation details of how the type is structured.

const (
	// Inbuilt Go Types
	Builtin_ANY     Builtin = 0
	Builtin_BOOL    Builtin = 1
	Builtin_INT8    Builtin = 2
	Builtin_INT16   Builtin = 3
	Builtin_INT32   Builtin = 4
	Builtin_INT64   Builtin = 5
	Builtin_UINT8   Builtin = 6
	Builtin_UINT16  Builtin = 7
	Builtin_UINT32  Builtin = 8
	Builtin_UINT64  Builtin = 9
	Builtin_FLOAT32 Builtin = 10
	Builtin_FLOAT64 Builtin = 11
	Builtin_STRING  Builtin = 12
	Builtin_BYTES   Builtin = 13
	// Additional Encore Types
	Builtin_TIME    Builtin = 14
	Builtin_UUID    Builtin = 15
	Builtin_JSON    Builtin = 16
	Builtin_USER_ID Builtin = 17
	Builtin_INT     Builtin = 18
	Builtin_UINT    Builtin = 19
)

func (Builtin) Descriptor

func (Builtin) Descriptor() protoreflect.EnumDescriptor

func (Builtin) Enum

func (x Builtin) Enum() *Builtin

func (Builtin) EnumDescriptor deprecated

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

Deprecated: Use Builtin.Descriptor instead.

func (Builtin) Number

func (x Builtin) Number() protoreflect.EnumNumber

func (Builtin) String

func (x Builtin) String() string

func (Builtin) Type

func (Builtin) Type() protoreflect.EnumType

type Decl

type Decl struct {
	Id         uint32           `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                  // A internal ID which we can refer to this declaration by
	Name       string           `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                               // The name of the type as assigned in the code
	Type       *Type            `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`                               // The underlying type of this declaration
	TypeParams []*TypeParameter `protobuf:"bytes,6,rep,name=type_params,json=typeParams,proto3" json:"type_params,omitempty"` // Any type parameters on this declaration (note; instantiated types used within this declaration would not be captured here)
	Doc        string           `protobuf:"bytes,4,opt,name=doc,proto3" json:"doc,omitempty"`                                 // The comment block on the type
	Loc        *Loc             `protobuf:"bytes,5,opt,name=loc,proto3" json:"loc,omitempty"`                                 // The location of the declaration within the project
	// contains filtered or unexported fields
}

Decl represents the declaration of a type within the Go code which is either concrete or _parameterized_. The type is concrete when there are zero type parameters assigned.

For example the Go Code: ``` // Set[A] represents our set type type Set[A any] = map[A]struct{} ```

Would become: ```

_ = &Decl{
    id: 1,
    name: "Set",
    type: &Type{
        typ_map: &Map{
            key: &Type { typ_type_parameter: ... reference to "A" type parameter below ... },
            value: &Type { typ_struct: ... empty struct type ... },
        },
    },
    typeParameters: []*TypeParameter{ { name: "A" } },
    doc: "Set[A] represents our set type",
    loc: &Loc { ... },
}

```

func (*Decl) Descriptor deprecated

func (*Decl) Descriptor() ([]byte, []int)

Deprecated: Use Decl.ProtoReflect.Descriptor instead.

func (*Decl) GetDoc

func (x *Decl) GetDoc() string

func (*Decl) GetId

func (x *Decl) GetId() uint32

func (*Decl) GetLoc

func (x *Decl) GetLoc() *Loc

func (*Decl) GetName

func (x *Decl) GetName() string

func (*Decl) GetType

func (x *Decl) GetType() *Type

func (*Decl) GetTypeParams added in v0.18.0

func (x *Decl) GetTypeParams() []*TypeParameter

func (*Decl) ProtoMessage

func (*Decl) ProtoMessage()

func (*Decl) ProtoReflect

func (x *Decl) ProtoReflect() protoreflect.Message

func (*Decl) Reset

func (x *Decl) Reset()

func (*Decl) String

func (x *Decl) String() string

type Field

type Field struct {
	Typ             *Type  `protobuf:"bytes,1,opt,name=typ,proto3" json:"typ,omitempty"`                                                  // The type of the field
	Name            string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`                                                // The name of the field
	Doc             string `protobuf:"bytes,3,opt,name=doc,proto3" json:"doc,omitempty"`                                                  // The comment for the field
	JsonName        string `protobuf:"bytes,4,opt,name=json_name,json=jsonName,proto3" json:"json_name,omitempty"`                        // The optional json name if it's different from the field name. (The value "-" indicates to omit the field.)
	Optional        bool   `protobuf:"varint,5,opt,name=optional,proto3" json:"optional,omitempty"`                                       // Whether the field is optional.
	QueryStringName string `protobuf:"bytes,6,opt,name=query_string_name,json=queryStringName,proto3" json:"query_string_name,omitempty"` // The query string name to use in GET/HEAD/DELETE requests. (The value "-" indicates to omit the field.)
	// contains filtered or unexported fields
}

Field represents a field within a struct

func (*Field) Descriptor deprecated

func (*Field) Descriptor() ([]byte, []int)

Deprecated: Use Field.ProtoReflect.Descriptor instead.

func (*Field) GetDoc

func (x *Field) GetDoc() string

func (*Field) GetJsonName

func (x *Field) GetJsonName() string

func (*Field) GetName

func (x *Field) GetName() string

func (*Field) GetOptional

func (x *Field) GetOptional() bool

func (*Field) GetQueryStringName added in v0.17.2

func (x *Field) GetQueryStringName() string

func (*Field) GetTyp

func (x *Field) GetTyp() *Type

func (*Field) ProtoMessage

func (*Field) ProtoMessage()

func (*Field) ProtoReflect

func (x *Field) ProtoReflect() protoreflect.Message

func (*Field) Reset

func (x *Field) Reset()

func (*Field) String

func (x *Field) String() string

type List

type List struct {
	Elem *Type `protobuf:"bytes,1,opt,name=elem,proto3" json:"elem,omitempty"` // The type of the elements in the list
	// contains filtered or unexported fields
}

List represents a list type (array or slice)

func (*List) Descriptor deprecated

func (*List) Descriptor() ([]byte, []int)

Deprecated: Use List.ProtoReflect.Descriptor instead.

func (*List) GetElem

func (x *List) GetElem() *Type

func (*List) ProtoMessage

func (*List) ProtoMessage()

func (*List) ProtoReflect

func (x *List) ProtoReflect() protoreflect.Message

func (*List) Reset

func (x *List) Reset()

func (*List) String

func (x *List) String() string

type Loc

type Loc struct {
	PkgPath      string `protobuf:"bytes,1,opt,name=pkg_path,json=pkgPath,proto3" json:"pkg_path,omitempty"`                   // The package path within the repo (i.e. `users/signup`)
	PkgName      string `protobuf:"bytes,2,opt,name=pkg_name,json=pkgName,proto3" json:"pkg_name,omitempty"`                   // The package name (i.e. `signup`)
	Filename     string `protobuf:"bytes,3,opt,name=filename,proto3" json:"filename,omitempty"`                                // The file name (i.e. `signup.go`)
	StartPos     int32  `protobuf:"varint,4,opt,name=start_pos,json=startPos,proto3" json:"start_pos,omitempty"`               // The starting index within the file for this node
	EndPos       int32  `protobuf:"varint,5,opt,name=end_pos,json=endPos,proto3" json:"end_pos,omitempty"`                     // The ending index within the file for this node
	SrcLineStart int32  `protobuf:"varint,6,opt,name=src_line_start,json=srcLineStart,proto3" json:"src_line_start,omitempty"` // The starting line within the file for this node
	SrcLineEnd   int32  `protobuf:"varint,7,opt,name=src_line_end,json=srcLineEnd,proto3" json:"src_line_end,omitempty"`       // The ending line within the file for this node
	SrcColStart  int32  `protobuf:"varint,8,opt,name=src_col_start,json=srcColStart,proto3" json:"src_col_start,omitempty"`    // The starting column on the starting line for this node
	SrcColEnd    int32  `protobuf:"varint,9,opt,name=src_col_end,json=srcColEnd,proto3" json:"src_col_end,omitempty"`          // The ending column on the ending line for this node
	// contains filtered or unexported fields
}

Loc is the location of a declaration within the code base

func (*Loc) Descriptor deprecated

func (*Loc) Descriptor() ([]byte, []int)

Deprecated: Use Loc.ProtoReflect.Descriptor instead.

func (*Loc) GetEndPos

func (x *Loc) GetEndPos() int32

func (*Loc) GetFilename

func (x *Loc) GetFilename() string

func (*Loc) GetPkgName

func (x *Loc) GetPkgName() string

func (*Loc) GetPkgPath

func (x *Loc) GetPkgPath() string

func (*Loc) GetSrcColEnd

func (x *Loc) GetSrcColEnd() int32

func (*Loc) GetSrcColStart

func (x *Loc) GetSrcColStart() int32

func (*Loc) GetSrcLineEnd

func (x *Loc) GetSrcLineEnd() int32

func (*Loc) GetSrcLineStart

func (x *Loc) GetSrcLineStart() int32

func (*Loc) GetStartPos

func (x *Loc) GetStartPos() int32

func (*Loc) ProtoMessage

func (*Loc) ProtoMessage()

func (*Loc) ProtoReflect

func (x *Loc) ProtoReflect() protoreflect.Message

func (*Loc) Reset

func (x *Loc) Reset()

func (*Loc) String

func (x *Loc) String() string

type Map

type Map struct {
	Key   *Type `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`     // The type of the key for this map
	Value *Type `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` // The type of the value of this map
	// contains filtered or unexported fields
}

Map represents a map Type

func (*Map) Descriptor deprecated

func (*Map) Descriptor() ([]byte, []int)

Deprecated: Use Map.ProtoReflect.Descriptor instead.

func (*Map) GetKey

func (x *Map) GetKey() *Type

func (*Map) GetValue

func (x *Map) GetValue() *Type

func (*Map) ProtoMessage

func (*Map) ProtoMessage()

func (*Map) ProtoReflect

func (x *Map) ProtoReflect() protoreflect.Message

func (*Map) Reset

func (x *Map) Reset()

func (*Map) String

func (x *Map) String() string

type Named

type Named struct {
	Id            uint32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`                                           // The `Decl.id` this name refers to
	TypeArguments []*Type `protobuf:"bytes,2,rep,name=type_arguments,json=typeArguments,proto3" json:"type_arguments,omitempty"` // The type arguments used to instantiate this parameterised declaration
	// contains filtered or unexported fields
}

Named references declaration block by name

func (*Named) Descriptor deprecated

func (*Named) Descriptor() ([]byte, []int)

Deprecated: Use Named.ProtoReflect.Descriptor instead.

func (*Named) GetId

func (x *Named) GetId() uint32

func (*Named) GetTypeArguments added in v0.18.0

func (x *Named) GetTypeArguments() []*Type

func (*Named) ProtoMessage

func (*Named) ProtoMessage()

func (*Named) ProtoReflect

func (x *Named) ProtoReflect() protoreflect.Message

func (*Named) Reset

func (x *Named) Reset()

func (*Named) String

func (x *Named) String() string

type Struct

type Struct struct {
	Fields []*Field `protobuf:"bytes,1,rep,name=fields,proto3" json:"fields,omitempty"`
	// contains filtered or unexported fields
}

Struct contains a list of fields which make up the struct

func (*Struct) Descriptor deprecated

func (*Struct) Descriptor() ([]byte, []int)

Deprecated: Use Struct.ProtoReflect.Descriptor instead.

func (*Struct) GetFields

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

func (*Struct) ProtoMessage

func (*Struct) ProtoMessage()

func (*Struct) ProtoReflect

func (x *Struct) ProtoReflect() protoreflect.Message

func (*Struct) Reset

func (x *Struct) Reset()

func (*Struct) String

func (x *Struct) String() string

type Type

type Type struct {

	// Types that are assignable to Typ:
	//	*Type_Named
	//	*Type_Struct
	//	*Type_Map
	//	*Type_List
	//	*Type_Builtin
	//	*Type_TypeParameter
	Typ isType_Typ `protobuf_oneof:"typ"`
	// contains filtered or unexported fields
}

Type represents the base of our schema on which everything else is built on-top of. It has to be one, and only one, thing from our list of meta types.

A type may be concrete or abstract, however to determine if a type is abstract you need to recursive through the structures looking for any uses of the TypeParameterPtr type

func (*Type) Descriptor deprecated

func (*Type) Descriptor() ([]byte, []int)

Deprecated: Use Type.ProtoReflect.Descriptor instead.

func (*Type) GetBuiltin

func (x *Type) GetBuiltin() Builtin

func (*Type) GetList

func (x *Type) GetList() *List

func (*Type) GetMap

func (x *Type) GetMap() *Map

func (*Type) GetNamed

func (x *Type) GetNamed() *Named

func (*Type) GetStruct

func (x *Type) GetStruct() *Struct

func (*Type) GetTyp

func (m *Type) GetTyp() isType_Typ

func (*Type) GetTypeParameter added in v0.18.0

func (x *Type) GetTypeParameter() *TypeParameterRef

func (*Type) ProtoMessage

func (*Type) ProtoMessage()

func (*Type) ProtoReflect

func (x *Type) ProtoReflect() protoreflect.Message

func (*Type) Reset

func (x *Type) Reset()

func (*Type) String

func (x *Type) String() string

type TypeParameter added in v0.18.0

type TypeParameter struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The identifier given to the type parameter
	// contains filtered or unexported fields
}

TypeParameter acts as a place holder for an (as of yet) unknown type in the declaration; the type parameter is replaced with a type argument upon instantiation of the parameterized function or type.

func (*TypeParameter) Descriptor deprecated added in v0.18.0

func (*TypeParameter) Descriptor() ([]byte, []int)

Deprecated: Use TypeParameter.ProtoReflect.Descriptor instead.

func (*TypeParameter) GetName added in v0.18.0

func (x *TypeParameter) GetName() string

func (*TypeParameter) ProtoMessage added in v0.18.0

func (*TypeParameter) ProtoMessage()

func (*TypeParameter) ProtoReflect added in v0.18.0

func (x *TypeParameter) ProtoReflect() protoreflect.Message

func (*TypeParameter) Reset added in v0.18.0

func (x *TypeParameter) Reset()

func (*TypeParameter) String added in v0.18.0

func (x *TypeParameter) String() string

type TypeParameterRef added in v0.18.0

type TypeParameterRef struct {
	DeclId   uint32 `protobuf:"varint,1,opt,name=decl_id,json=declId,proto3" json:"decl_id,omitempty"`       // The ID of the declaration block
	ParamIdx uint32 `protobuf:"varint,2,opt,name=param_idx,json=paramIdx,proto3" json:"param_idx,omitempty"` // The index of the type parameter within the declaration block
	// contains filtered or unexported fields
}

TypeParameterRef is a reference to a `TypeParameter` within a declaration block

func (*TypeParameterRef) Descriptor deprecated added in v0.18.0

func (*TypeParameterRef) Descriptor() ([]byte, []int)

Deprecated: Use TypeParameterRef.ProtoReflect.Descriptor instead.

func (*TypeParameterRef) GetDeclId added in v0.18.0

func (x *TypeParameterRef) GetDeclId() uint32

func (*TypeParameterRef) GetParamIdx added in v0.18.0

func (x *TypeParameterRef) GetParamIdx() uint32

func (*TypeParameterRef) ProtoMessage added in v0.18.0

func (*TypeParameterRef) ProtoMessage()

func (*TypeParameterRef) ProtoReflect added in v0.18.0

func (x *TypeParameterRef) ProtoReflect() protoreflect.Message

func (*TypeParameterRef) Reset added in v0.18.0

func (x *TypeParameterRef) Reset()

func (*TypeParameterRef) String added in v0.18.0

func (x *TypeParameterRef) String() string

type Type_Builtin

type Type_Builtin struct {
	Builtin Builtin `protobuf:"varint,5,opt,name=builtin,proto3,enum=encore.parser.schema.v1.Builtin,oneof"` // The type is one of the base built in types within Go
}

type Type_List

type Type_List struct {
	List *List `protobuf:"bytes,4,opt,name=list,proto3,oneof"` // The type is a slice
}

type Type_Map

type Type_Map struct {
	Map *Map `protobuf:"bytes,3,opt,name=map,proto3,oneof"` // The type is a map
}

type Type_Named

type Type_Named struct {
	// Concrete / non-parameterized Types
	Named *Named `protobuf:"bytes,1,opt,name=named,proto3,oneof"` // A "named" type (https://tip.golang.org/ref/spec#Types)
}

type Type_Struct

type Type_Struct struct {
	Struct *Struct `protobuf:"bytes,2,opt,name=struct,proto3,oneof"` // The type is a struct definition
}

type Type_TypeParameter added in v0.18.0

type Type_TypeParameter struct {
	// Abstract Types
	TypeParameter *TypeParameterRef `protobuf:"bytes,6,opt,name=type_parameter,json=typeParameter,proto3,oneof"` // This is placeholder for a unknown type within the declaration block
}

Jump to

Keyboard shortcuts

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