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 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
- 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) 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 RawRecord
- type Record
- func (r *Record) GenerateCode() *Statement
- func (r *Record) GenerateComputeHash() Code
- func (r *Record) GenerateEquals() Code
- 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) GenerateUnmarshalRestLi() *Statement
- func (r *Record) InnerTypes() utils.IdentifierSet
- func (r *Record) PartialUpdateDeleteFieldsStructName() string
- func (r *Record) PartialUpdateSetFieldsStructName() string
- func (r *Record) PartialUpdateStruct() *Statement
- func (r *Record) PartialUpdateStructName() string
- 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) 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 NewInstance = "NewInstance"
View Source
const RecordShouldUsePointer = utils.Yes
View Source
const TyperefShouldUsePointer = utils.No
View Source
const UnionShouldUsePointer = utils.Yes
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")) ItemWriter = Code(Id("itemWriter")) Writer = &writer{Id("writer")} WriterQual = Code(Qual(utils.RestLiCodecPackage, "Writer")) WriterParam = Code(Add(Writer).Add(WriterQual)) )
View Source
var ( Reader = &reader{Id("reader")} ReaderQual = Qual(utils.RestLiCodecPackage, "Reader") ReaderParam = Add(Reader).Add(ReaderQual) )
View Source
var FixedUnderlyingType = RestliType{Primitive: &BytesPrimitive}
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 ¶ added in v0.26.8
func AddCustomComputeHash(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(def *Group)) *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 ¶ added in v1.0.3
func AddNewInstance(def *Statement, receiver, typeName string)
func AddUnmarshalRestli ¶
func AddUnmarshalRestli(def *Statement, receiver, typeName string, pointer utils.ShouldUsePointer, f func(def *Group)) *Statement
Types ¶
type ComplexKey ¶
type ComplexKey struct { NamedType Key utils.Identifier Params utils.Identifier }
func (*ComplexKey) GenerateCode ¶
func (ck *ComplexKey) GenerateCode() *Statement
func (*ComplexKey) InnerTypes ¶
func (ck *ComplexKey) InnerTypes() utils.IdentifierSet
func (*ComplexKey) KeyAccessor ¶
func (ck *ComplexKey) KeyAccessor() Code
func (*ComplexKey) ShouldReference ¶ added in v1.0.0
func (ck *ComplexKey) ShouldReference() utils.ShouldUsePointer
type Enum ¶
func (*Enum) GenerateCode ¶
func (e *Enum) GenerateCode() (def *Statement)
func (*Enum) InnerTypes ¶
func (e *Enum) InnerTypes() utils.IdentifierSet
func (*Enum) ShouldReference ¶ added in v1.0.0
func (e *Enum) ShouldReference() utils.ShouldUsePointer
func (*Enum) SymbolIdentifier ¶
type Field ¶
type Field struct { Type RestliType Name string Doc string IsOptional bool DefaultValue *string IncludedFrom *utils.Identifier // contains filtered or unexported fields }
func (*Field) IsOptionalOrDefault ¶
func (*Field) ResolveRecord ¶
type Fixed ¶
func (*Fixed) GenerateCode ¶
func (f *Fixed) GenerateCode() (def *Statement)
func (*Fixed) InnerTypes ¶
func (f *Fixed) InnerTypes() utils.IdentifierSet
func (*Fixed) ShouldReference ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (p *PrimitiveType) HasherQual() Code
func (*PrimitiveType) IsBytes ¶
func (p *PrimitiveType) IsBytes() bool
func (*PrimitiveType) MarshalerFunc ¶ added in v1.0.0
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 ¶ added in v1.0.0
func (p *PrimitiveType) UnmarshalerFunc() *Statement
func (*PrimitiveType) WriterName ¶
func (p *PrimitiveType) WriterName() string
type RawRecord ¶
type RawRecord struct{}
func (*RawRecord) GenerateCode ¶
func (r *RawRecord) GenerateCode() (def *Statement)
func (*RawRecord) GetIdentifier ¶
func (r *RawRecord) GetIdentifier() utils.Identifier
func (*RawRecord) GetSourceFile ¶
func (*RawRecord) InnerTypes ¶
func (r *RawRecord) InnerTypes() utils.IdentifierSet
func (*RawRecord) ShouldReference ¶ added in v1.0.0
func (r *RawRecord) ShouldReference() utils.ShouldUsePointer
type Record ¶
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) GenerateMarshalRestLi ¶
func (r *Record) GenerateMarshalRestLi() *Statement
func (*Record) GeneratePopulateDefaultValues ¶ added in v1.0.3
func (r *Record) GeneratePopulateDefaultValues() Code
func (*Record) GenerateQueryParamMarshaler ¶
func (r *Record) GenerateQueryParamMarshaler(finderName *string, batchKeyType *RestliType) *Statement
func (*Record) GenerateQueryParamUnmarshaler ¶ added in v1.0.3
func (r *Record) GenerateQueryParamUnmarshaler(batchKeyType *RestliType) Code
func (*Record) GenerateStruct ¶
func (r *Record) GenerateStruct() *Statement
func (*Record) GenerateUnmarshalRestLi ¶
func (r *Record) GenerateUnmarshalRestLi() *Statement
func (*Record) InnerTypes ¶
func (r *Record) InnerTypes() utils.IdentifierSet
func (*Record) PartialUpdateDeleteFieldsStructName ¶ added in v1.0.0
func (*Record) PartialUpdateSetFieldsStructName ¶ added in v1.0.0
func (*Record) PartialUpdateStruct ¶
func (r *Record) PartialUpdateStruct() *Statement
func (*Record) PartialUpdateStructName ¶
func (*Record) ShouldReference ¶ added in v1.0.0
func (r *Record) ShouldReference() utils.ShouldUsePointer
func (*Record) SortedFields ¶
type RestliType ¶
type RestliType struct { Primitive *PrimitiveType `json:"primitive"` Reference *utils.Identifier `json:"reference"` Array *RestliType `json:"array"` Map *RestliType `json:"map"` RawRecord bool `json:"rawRecord"` }
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 ¶ added in v1.0.0
func (t *RestliType) InnerMapOrArray() (innerT RestliType, word string)
func (*RestliType) InnerTypes ¶
func (t *RestliType) InnerTypes() utils.IdentifierSet
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) InnerTypes ¶
func (u *StandaloneUnion) InnerTypes() utils.IdentifierSet
func (*StandaloneUnion) ShouldReference ¶ added in v1.0.0
func (u *StandaloneUnion) ShouldReference() utils.ShouldUsePointer
type Typeref ¶
type Typeref struct { NamedType Type *PrimitiveType `json:"type"` }
func (*Typeref) GenerateCode ¶
func (r *Typeref) GenerateCode() (def *Statement)
func (*Typeref) InnerTypes ¶
func (r *Typeref) InnerTypes() utils.IdentifierSet
func (*Typeref) ShouldReference ¶ added in v1.0.0
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.