Documentation ¶
Index ¶
- Constants
- Variables
- func AddComputeHash(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, ...) *Statement
- func AddCustomComputeHash(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, ...) *Statement
- func AddCustomTyperefComputeHash(name string, f func(def *Group, in, h Code)) *Statement
- func AddCustomTyperefEquals(name string, f func(def *Group, left, right Code)) *Statement
- func AddCustomTyperefMarshal(name string, pt PrimitiveType, f func(def *Group, in, out Code)) *Statement
- func AddCustomTyperefUnmarshal(name string, pt PrimitiveType, f func(def *Group, in, out Code)) *Statement
- func AddEquals(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, ...) *Statement
- func AddMarshalRestLi(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, ...) *Statement
- func AddNewInstance(def *Statement, receiver, typeName string)
- func AddUnmarshalRestli(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, ...) *Statement
- func CallRegisterCustomTyperef(id utils.Identifier) *Statement
- type ComplexKey
- type Enum
- type Field
- type Fixed
- type NamedType
- type PrimitiveType
- func (p *PrimitiveType) Cast(accessor *Statement) *Statement
- func (p *PrimitiveType) GoType() *Statement
- func (p *PrimitiveType) HasherName() string
- func (p *PrimitiveType) HasherQual() Code
- func (p *PrimitiveType) IsBytes() bool
- func (p *PrimitiveType) MarshalJSON() ([]byte, error)
- func (p *PrimitiveType) MarshalerFunc() *Statement
- func (p *PrimitiveType) ReaderName() string
- func (p *PrimitiveType) UnmarshalJSON(data []byte) error
- func (p *PrimitiveType) UnmarshalerFunc() *Statement
- func (p *PrimitiveType) WriterName() string
- type Record
- func (r *Record) GenerateCode() *Statement
- func (r *Record) GenerateComputeHash() Code
- func (r *Record) GenerateEquals() Code
- func (r *Record) GenerateMarshalFields() *Statement
- func (r *Record) GenerateMarshalRestLi() *Statement
- func (r *Record) GeneratePopulateDefaultValues() Code
- func (r *Record) GenerateQueryParamMarshaler(finderName *string, batchKeyType *RestliType) *Statement
- func (r *Record) GenerateQueryParamUnmarshaler(batchKeyType *RestliType) Code
- func (r *Record) GenerateStruct() *Statement
- func (r *Record) GenerateUnmarshalField(batchKeyType *RestliType) *Statement
- func (r *Record) GenerateUnmarshalRestLi() *Statement
- func (r *Record) PartialUpdateDeleteFieldsStructName() string
- func (r *Record) PartialUpdateSetFieldsStructName() string
- func (r *Record) PartialUpdateStruct() *Statement
- func (r *Record) PartialUpdateStructName() string
- func (r *Record) ReferencedTypes() utils.IdentifierSet
- func (r *Record) ShouldReference() utils.ShouldUsePointer
- func (r *Record) SortedFields() (fields []Field)
- type RestliType
- func (t *RestliType) ComplexKey() *ComplexKey
- func (t *RestliType) Enum() *Enum
- func (t *RestliType) GoType() *Statement
- func (t *RestliType) InnerMapOrArray() (innerT RestliType, word string)
- func (t *RestliType) InnerTypes() utils.IdentifierSet
- func (t *RestliType) IsCustomTyperef() bool
- func (t *RestliType) IsMapOrArray() bool
- func (t *RestliType) PointerType() *Statement
- func (t *RestliType) Record() *Record
- func (t *RestliType) ReferencedType() *Statement
- func (t *RestliType) ShouldReference() bool
- func (t *RestliType) StandaloneUnion() *StandaloneUnion
- func (t *RestliType) Typeref() *Typeref
- func (t *RestliType) UnmarshalJSON(data []byte) error
- type StandaloneUnion
- type Typeref
- type UnionMember
- type UnionType
Constants ¶
View Source
const ( PartialUpdate = "_PartialUpdate" DeleteFields = "Delete_Fields" SetFields = "Set_Fields" )
View Source
const EnumShouldUsePointer = utils.No
View Source
const FixedShouldUsePointer = utils.Yes
View Source
const MarshalDeleteFields = "MarshalDeleteFields"
View Source
const MarshalFields = "MarshalFields"
View Source
const MarshalSetFields = "MarshalSetFields"
View Source
const NewInstance = "NewInstance"
View Source
const RecordShouldUsePointer = utils.Yes
View Source
const TyperefShouldUsePointer = utils.No
View Source
const UnionShouldUsePointer = utils.Yes
View Source
const UnmarshalDeleteField = "UnmarshalDeleteField"
View Source
const UnmarshalField = "UnmarshalField"
View Source
const UnmarshalSetField = "UnmarshalSetField"
Variables ¶
View Source
var ( Int32Primitive = PrimitiveType{Type: "int32", /* contains filtered or unexported fields */} Int64Primitive = PrimitiveType{Type: "int64", /* contains filtered or unexported fields */} Float32Primitive = PrimitiveType{Type: "float32", /* contains filtered or unexported fields */} Float64Primitive = PrimitiveType{Type: "float64", /* contains filtered or unexported fields */} BoolPrimitive = PrimitiveType{Type: "bool", /* contains filtered or unexported fields */} StringPrimitive = PrimitiveType{Type: "string", /* contains filtered or unexported fields */} BytesPrimitive = PrimitiveType{Type: "bytes"} )
View Source
var ( KeyWriter = Code(Id("keyWriter")) KeyWriterFunc = Code(Add(KeyWriter).Func().Params(String()).Add(WriterQual)) ItemWriter = Code(Id("itemWriter")) ItemWriterFunc = Code(Add(ItemWriter).Func().Params().Add(WriterQual)) Writer = &writer{Id("writer")} WriterQual = Code(Qual(utils.RestLiCodecPackage, "Writer")) WriterParam = Code(Add(Writer).Add(WriterQual)) )
View Source
var ( Reader = &reader{Id("reader")} ReaderQual = Code(Qual(utils.RestLiCodecPackage, "Reader")) ReaderParam = Code(Add(Reader).Add(ReaderQual)) FieldParamName = Code(Id("field")) )
View Source
var FixedUnderlyingType = RestliType{Primitive: &BytesPrimitive}
View Source
var Found = Code(Id("found"))
View Source
var Ids = Code(Id(batchkeyset.EntityIDsField))
View Source
var PrimitiveTypes = []PrimitiveType{ Int32Primitive, Int64Primitive, Float32Primitive, Float64Primitive, BoolPrimitive, StringPrimitive, BytesPrimitive, }
Functions ¶
func AddComputeHash ¶
func AddComputeHash(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(h Code, def *Group)) *Statement
func AddCustomComputeHash ¶
func AddCustomComputeHash(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(def *Group)) *Statement
func AddCustomTyperefComputeHash ¶
func AddCustomTyperefComputeHash(name string, f func(def *Group, in, h Code)) *Statement
func AddCustomTyperefEquals ¶
func AddCustomTyperefEquals(name string, f func(def *Group, left, right Code)) *Statement
func AddCustomTyperefMarshal ¶
func AddCustomTyperefMarshal(name string, pt PrimitiveType, f func(def *Group, in, out Code)) *Statement
func AddCustomTyperefUnmarshal ¶
func AddCustomTyperefUnmarshal(name string, pt PrimitiveType, f func(def *Group, in, out Code)) *Statement
func AddEquals ¶
func AddEquals(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(other Code, def *Group)) *Statement
func AddMarshalRestLi ¶
func AddMarshalRestLi(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(def *Group)) *Statement
func AddNewInstance ¶
func AddNewInstance(def *Statement, receiver, typeName string)
func AddUnmarshalRestli ¶
func AddUnmarshalRestli(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(def *Group)) *Statement
func CallRegisterCustomTyperef ¶
func CallRegisterCustomTyperef(id utils.Identifier) *Statement
Types ¶
type ComplexKey ¶
type ComplexKey struct { NamedType Key utils.Identifier Params utils.Identifier }
func (*ComplexKey) GenerateCode ¶
func (ck *ComplexKey) GenerateCode() *Statement
func (*ComplexKey) KeyAccessor ¶
func (ck *ComplexKey) KeyAccessor() Code
func (*ComplexKey) ReferencedTypes ¶ added in v2.1.0
func (ck *ComplexKey) ReferencedTypes() utils.IdentifierSet
func (*ComplexKey) ShouldReference ¶
func (ck *ComplexKey) ShouldReference() utils.ShouldUsePointer
type Enum ¶
func (*Enum) GenerateCode ¶
func (e *Enum) GenerateCode() (def *Statement)
func (*Enum) ReferencedTypes ¶ added in v2.1.0
func (e *Enum) ReferencedTypes() utils.IdentifierSet
func (*Enum) ShouldReference ¶
func (e *Enum) ShouldReference() utils.ShouldUsePointer
func (*Enum) SymbolIdentifier ¶
type Field ¶
type Field struct { Name string `json:"name"` Doc string `json:"doc"` Type RestliType `json:"type"` IsOptional bool `json:"isOptional"` DefaultValue *string `json:"defaultValue,omitempty"` // contains filtered or unexported fields }
func (*Field) IsOptionalOrDefault ¶
type Fixed ¶
func (*Fixed) GenerateCode ¶
func (f *Fixed) GenerateCode() (def *Statement)
func (*Fixed) ReferencedTypes ¶ added in v2.1.0
func (f *Fixed) ReferencedTypes() utils.IdentifierSet
func (*Fixed) ShouldReference ¶
func (f *Fixed) ShouldReference() utils.ShouldUsePointer
type NamedType ¶
type NamedType struct { utils.Identifier SourceFile string `json:"sourceFile"` Doc string `json:"doc"` }
func (*NamedType) GetSourceFile ¶
type PrimitiveType ¶
type PrimitiveType struct { Type string // contains filtered or unexported fields }
func (*PrimitiveType) Cast ¶
func (p *PrimitiveType) Cast(accessor *Statement) *Statement
func (*PrimitiveType) GoType ¶
func (p *PrimitiveType) GoType() *Statement
func (*PrimitiveType) HasherName ¶
func (p *PrimitiveType) HasherName() string
func (*PrimitiveType) HasherQual ¶
func (p *PrimitiveType) HasherQual() Code
func (*PrimitiveType) IsBytes ¶
func (p *PrimitiveType) IsBytes() bool
func (*PrimitiveType) MarshalJSON ¶
func (p *PrimitiveType) MarshalJSON() ([]byte, error)
func (*PrimitiveType) MarshalerFunc ¶
func (p *PrimitiveType) MarshalerFunc() *Statement
func (*PrimitiveType) ReaderName ¶
func (p *PrimitiveType) ReaderName() string
func (*PrimitiveType) UnmarshalJSON ¶
func (p *PrimitiveType) UnmarshalJSON(data []byte) error
func (*PrimitiveType) UnmarshalerFunc ¶
func (p *PrimitiveType) UnmarshalerFunc() *Statement
func (*PrimitiveType) WriterName ¶
func (p *PrimitiveType) WriterName() string
type Record ¶
type Record struct { NamedType Includes []utils.Identifier `json:"includes"` Fields []Field `json:"fields"` }
func (*Record) GenerateCode ¶
func (r *Record) GenerateCode() *Statement
func (*Record) GenerateComputeHash ¶
func (r *Record) GenerateComputeHash() Code
func (*Record) GenerateEquals ¶
func (r *Record) GenerateEquals() Code
func (*Record) GenerateMarshalFields ¶
func (r *Record) GenerateMarshalFields() *Statement
func (*Record) GenerateMarshalRestLi ¶
func (r *Record) GenerateMarshalRestLi() *Statement
func (*Record) GeneratePopulateDefaultValues ¶
func (r *Record) GeneratePopulateDefaultValues() Code
func (*Record) GenerateQueryParamMarshaler ¶
func (r *Record) GenerateQueryParamMarshaler(finderName *string, batchKeyType *RestliType) *Statement
func (*Record) GenerateQueryParamUnmarshaler ¶
func (r *Record) GenerateQueryParamUnmarshaler(batchKeyType *RestliType) Code
func (*Record) GenerateStruct ¶
func (r *Record) GenerateStruct() *Statement
func (*Record) GenerateUnmarshalField ¶
func (r *Record) GenerateUnmarshalField(batchKeyType *RestliType) *Statement
func (*Record) GenerateUnmarshalRestLi ¶
func (r *Record) GenerateUnmarshalRestLi() *Statement
func (*Record) PartialUpdateDeleteFieldsStructName ¶
func (*Record) PartialUpdateSetFieldsStructName ¶
func (*Record) PartialUpdateStruct ¶
func (r *Record) PartialUpdateStruct() *Statement
func (*Record) PartialUpdateStructName ¶
func (*Record) ReferencedTypes ¶ added in v2.1.0
func (r *Record) ReferencedTypes() utils.IdentifierSet
func (*Record) ShouldReference ¶
func (r *Record) ShouldReference() utils.ShouldUsePointer
func (*Record) SortedFields ¶
type RestliType ¶
type RestliType struct { Primitive *PrimitiveType `json:"primitive,omitempty"` Reference *utils.Identifier `json:"reference,omitempty"` Array *RestliType `json:"array,omitempty"` Map *RestliType `json:"map,omitempty"` RawRecord bool `json:"rawRecord,omitempty"` }
func (*RestliType) ComplexKey ¶
func (t *RestliType) ComplexKey() *ComplexKey
func (*RestliType) Enum ¶
func (t *RestliType) Enum() *Enum
func (*RestliType) GoType ¶
func (t *RestliType) GoType() *Statement
func (*RestliType) InnerMapOrArray ¶
func (t *RestliType) InnerMapOrArray() (innerT RestliType, word string)
func (*RestliType) InnerTypes ¶
func (t *RestliType) InnerTypes() utils.IdentifierSet
func (*RestliType) IsCustomTyperef ¶
func (t *RestliType) IsCustomTyperef() bool
func (*RestliType) IsMapOrArray ¶
func (t *RestliType) IsMapOrArray() bool
func (*RestliType) PointerType ¶
func (t *RestliType) PointerType() *Statement
func (*RestliType) Record ¶
func (t *RestliType) Record() *Record
func (*RestliType) ReferencedType ¶
func (t *RestliType) ReferencedType() *Statement
func (*RestliType) ShouldReference ¶
func (t *RestliType) ShouldReference() bool
func (*RestliType) StandaloneUnion ¶
func (t *RestliType) StandaloneUnion() *StandaloneUnion
func (*RestliType) Typeref ¶
func (t *RestliType) Typeref() *Typeref
func (*RestliType) UnmarshalJSON ¶
func (t *RestliType) UnmarshalJSON(data []byte) error
type StandaloneUnion ¶
func (*StandaloneUnion) GenerateCode ¶
func (u *StandaloneUnion) GenerateCode() *Statement
func (*StandaloneUnion) ReferencedTypes ¶ added in v2.1.0
func (u *StandaloneUnion) ReferencedTypes() utils.IdentifierSet
func (*StandaloneUnion) ShouldReference ¶
func (u *StandaloneUnion) ShouldReference() utils.ShouldUsePointer
type Typeref ¶
type Typeref struct { NamedType Type *PrimitiveType `json:"type"` IsCustom bool `json:"isCustom"` }
func (*Typeref) GenerateCode ¶
func (r *Typeref) GenerateCode() (def *Statement)
func (*Typeref) ReferencedTypes ¶ added in v2.1.0
func (r *Typeref) ReferencedTypes() utils.IdentifierSet
func (*Typeref) ShouldReference ¶
func (r *Typeref) ShouldReference() utils.ShouldUsePointer
type UnionMember ¶
type UnionMember struct { Type RestliType Alias string }
type UnionType ¶
type UnionType struct { HasNull bool Members []UnionMember }
func (*UnionType) InnerModels ¶
func (u *UnionType) InnerModels() utils.IdentifierSet
Click to show internal directories.
Click to hide internal directories.