Documentation ¶
Index ¶
- Constants
- Variables
- type Action
- func (a *Action) FuncName() string
- func (a *Action) FuncParamNames() []Code
- func (a *Action) FuncParamTypes() []Code
- func (a *Action) GenerateCode() *utils.CodeFile
- func (m *Action) GetMethod() *Method
- func (m *Action) GetPathKeys() (keys []*PathKey)
- func (a *Action) NonErrorFuncReturnParam() Code
- func (a *Action) RegisterMethod(server, resource, segments Code) Code
- type Finder
- func (f *Finder) FuncName() string
- func (f *Finder) FuncParamNames() []Code
- func (f *Finder) FuncParamTypes() []Code
- func (f *Finder) GenerateCode() *utils.CodeFile
- func (m *Finder) GetMethod() *Method
- func (m *Finder) GetPathKeys() (keys []*PathKey)
- func (f *Finder) NonErrorFuncReturnParam() Code
- func (f *Finder) RegisterMethod(server, resource, segments Code) Code
- type Method
- type MethodImplementation
- type MethodType
- type PathKey
- type Resource
- func (r *Resource) GenerateCode() []*utils.CodeFile
- func (r *Resource) LastSegment() ResourcePathSegment
- func (r *Resource) LocalType(name string) *Statement
- func (r *Resource) NewCodeFile(filename string) *utils.CodeFile
- func (r *Resource) PackagePath() string
- func (r *Resource) ParentSegments() []ResourcePathSegment
- func (r *Resource) UnmarshalJSON(data []byte) (err error)
- type ResourcePathSegment
- type RestMethod
- func (r *RestMethod) EntityKeyType() *Statement
- func (r *RestMethod) EntityType() *Statement
- func (r *RestMethod) FuncName() string
- func (r *RestMethod) FuncParamNames() (params []Code)
- func (r *RestMethod) FuncParamTypes() (params []Code)
- func (r *RestMethod) GenerateCode() *utils.CodeFile
- func (r *RestMethod) GenericParams() Code
- func (m *RestMethod) GetMethod() *Method
- func (m *RestMethod) GetPathKeys() (keys []*PathKey)
- func (r *RestMethod) NonErrorFuncReturnParam() Code
- func (r *RestMethod) PartialEntityUpdateType() *Statement
- func (r *RestMethod) RegisterMethod(server, resource, segments Code) Code
Constants ¶
View Source
const ( ResourcePath = "ResourcePath" ResourceEntityPath = "ResourceEntityPath" WithContext = "WithContext" FindBy = "FindBy" RestLiClient = "Client" ClientReceiver = "c" ClientType = "client" ClientInterfaceType = "Client" ResourceInterfaceType = "Resource" CreatedEntity = "CreatedEntity" CreatedAndReturnedEntity = "CreatedAndReturnedEntity" Elements = "Elements" BatchEntities = "BatchEntities" BatchResponse = "BatchResponse" )
Variables ¶
View Source
var ( RestLiClientQual = Code(Qual(utils.RestLiPackage, RestLiClient)) RestLiClientReceiver = Code(Id(ClientReceiver).Dot(RestLiClient)) Context = Code(Qual("context", "Context")) RequestContext = Code(Op("*").Qual(utils.RestLiPackage, "RequestContext")) RequestContextParam = Code(Add(Ctx).Add(RequestContext)) ElementsWithMetadata = Code(Qual(utils.RestLiCommonPackage, "ElementsWithMetadata")) BatchEntityUpdateResponse = Code(Op("*").Qual(utils.RestLiCommonPackage, "BatchEntityUpdateResponse")) EmptyRecord = Code(Qual(utils.RestLiCommonPackage, "EmptyRecord")) Rp = Code(Id("rp")) Ctx = Code(Id("ctx")) Entity = Code(Id("entity")) Entities = Code(Id("entities")) Results = Code(Id("results")) Keys = Code(Id("keys")) QueryParams = Code(Id("queryParams")) ActionParams = Code(Id("actionParams")) NoExcludedFields = Code(Qual(utils.RestLiCodecPackage, "NoExcludedFields")) ReadOnlyFields = Code(Id("ReadOnlyFields")) CreateAndReadOnlyFields = Code(Id("CreateAndReadOnlyFields")) )
View Source
var PagingContext = &types.Record{ NamedType: types.NamedType{Identifier: utils.PagingContextIdentifier}, Fields: []types.Field{ { Type: types.RestliType{Primitive: &types.Int32Primitive}, Name: "start", IsOptional: true, }, { Type: types.RestliType{Primitive: &types.Int32Primitive}, Name: "count", IsOptional: true, }, }, }
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct {
// contains filtered or unexported fields
}
func (*Action) FuncParamNames ¶
func (a *Action) FuncParamNames() []Code
func (*Action) FuncParamTypes ¶
func (a *Action) FuncParamTypes() []Code
func (*Action) GenerateCode ¶
func (*Action) GetPathKeys ¶
func (m *Action) GetPathKeys() (keys []*PathKey)
func (*Action) NonErrorFuncReturnParam ¶
func (a *Action) NonErrorFuncReturnParam() Code
func (*Action) RegisterMethod ¶
func (a *Action) RegisterMethod(server, resource, segments Code) Code
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
func (*Finder) FuncParamNames ¶
func (f *Finder) FuncParamNames() []Code
func (*Finder) FuncParamTypes ¶
func (f *Finder) FuncParamTypes() []Code
func (*Finder) GenerateCode ¶
func (*Finder) GetPathKeys ¶
func (m *Finder) GetPathKeys() (keys []*PathKey)
func (*Finder) NonErrorFuncReturnParam ¶
func (f *Finder) NonErrorFuncReturnParam() Code
func (*Finder) RegisterMethod ¶
func (f *Finder) RegisterMethod(server, resource, segments Code) Code
type Method ¶
type Method struct { MethodType MethodType `json:"methodType"` Name string `json:"name"` Doc string `json:"doc"` OnEntity bool `json:"onEntity"` Params []types.Field `json:"params"` IsPagingSupported bool `json:"isPagingSupported"` Return *types.RestliType `json:"return"` Metadata *types.RestliType `json:"metadata"` ReturnEntity bool `json:"returnEntity"` }
type MethodImplementation ¶
type MethodType ¶
type MethodType string
const ( REST_METHOD MethodType = "REST_METHOD" ACTION MethodType = "ACTION" FINDER MethodType = "FINDER" )
type PathKey ¶
type PathKey struct { Name string `json:"name"` Type types.RestliType `json:"type"` }
func (*PathKey) UnmarshalJSON ¶
type Resource ¶
type Resource struct { PackageRoot string `json:"-"` Namespace string `json:"namespace"` Doc string `json:"doc"` SourceFile string `json:"sourceFile"` ResourcePathSegments []ResourcePathSegment `json:"resourcePathSegments"` ResourceSchema *types.RestliType `json:"resourceSchema"` Methods []MethodImplementation `json:"-"` ReadOnlyFields []string `json:"readOnlyFields"` CreateOnlyFields []string `json:"createOnlyFields"` }
func (*Resource) GenerateCode ¶
func (*Resource) LastSegment ¶
func (r *Resource) LastSegment() ResourcePathSegment
func (*Resource) PackagePath ¶
func (*Resource) ParentSegments ¶
func (r *Resource) ParentSegments() []ResourcePathSegment
func (*Resource) UnmarshalJSON ¶
type ResourcePathSegment ¶
type RestMethod ¶
type RestMethod struct {
// contains filtered or unexported fields
}
func (*RestMethod) EntityKeyType ¶
func (r *RestMethod) EntityKeyType() *Statement
func (*RestMethod) EntityType ¶
func (r *RestMethod) EntityType() *Statement
func (*RestMethod) FuncName ¶
func (r *RestMethod) FuncName() string
func (*RestMethod) FuncParamNames ¶
func (r *RestMethod) FuncParamNames() (params []Code)
func (*RestMethod) FuncParamTypes ¶
func (r *RestMethod) FuncParamTypes() (params []Code)
func (*RestMethod) GenerateCode ¶
func (r *RestMethod) GenerateCode() *utils.CodeFile
https://linkedin.github.io/rest.li/user_guide/restli_server#resource-methods
func (*RestMethod) GenericParams ¶
func (r *RestMethod) GenericParams() Code
func (*RestMethod) GetPathKeys ¶
func (m *RestMethod) GetPathKeys() (keys []*PathKey)
func (*RestMethod) NonErrorFuncReturnParam ¶
func (r *RestMethod) NonErrorFuncReturnParam() Code
func (*RestMethod) PartialEntityUpdateType ¶
func (r *RestMethod) PartialEntityUpdateType() *Statement
func (*RestMethod) RegisterMethod ¶
func (r *RestMethod) RegisterMethod(server, resource, segments Code) Code
Click to show internal directories.
Click to hide internal directories.