Documentation
¶
Index ¶
- Variables
- func DependencyGraphTreeFormat(groups []VariableDefinitionGroup) string
- func ExtractIndividualErrors(err error) []error
- func IsGRPCFederationGeneratedFile(path string) bool
- func ToCELType(typ *Type) *cel.Type
- type AllMessageDependencyGraph
- type AllMessageDependencyGraphNode
- type AllMessageDependencyGraphNodeReferenceBuilder
- type Argument
- type AutoBindField
- type BadRequest
- type BadRequestFieldViolation
- type CELFunction
- type CELPlugin
- type CELPluginCapability
- type CELPluginEnvCapability
- type CELPluginFileSystemCapability
- type CELPluginFunctionSignature
- type CELPluginNetworkCapability
- type CELRegistry
- func (r *CELRegistry) EnumValue(enumName string) ref.Val
- func (r *CELRegistry) FindStructFieldType(structType, fieldName string) (*celtypes.FieldType, bool)
- func (r *CELRegistry) LookupEnum(t *celtypes.Type) (*Enum, bool)
- func (r *CELRegistry) RegisterFiles(fds ...*descriptorpb.FileDescriptorProto) error
- type CELValue
- type CallExpr
- type ConcurrentVariableDefinitionGroup
- type CustomResolver
- type Enum
- type EnumExpr
- type EnumRule
- type EnumValue
- type EnumValueAlias
- type EnumValueAttribute
- type EnumValueRule
- type Env
- type EnvKey
- type EnvVar
- type EnvVarOption
- type Error
- type Field
- func (f *Field) FQDN() string
- func (f *Field) HasCustomResolver() bool
- func (f *Field) HasMessageCustomResolver() bool
- func (f *Field) HasRule() bool
- func (f *Field) RequiredTypeConversion(kind FieldConversionKind) bool
- func (f *Field) SourceTypes(kind FieldConversionKind) []*Type
- func (f *Field) TypeConversionDecls() []*TypeConversionDecl
- type FieldConversionKind
- type FieldOneofRule
- type FieldRule
- type File
- func (f *File) AllCELPlugins() []*CELPlugin
- func (f *File) AllEnums() []*Enum
- func (f *File) AllEnumsIncludeDeps() []*Enum
- func (f *File) AllUseMethods() []*Method
- func (f *File) HasServiceWithRule() bool
- func (f *File) Message(name string) *Message
- func (f *File) PackageName() string
- func (f *File) PrivatePackageName() string
- type Files
- type GRPCCallOption
- type GRPCError
- func (e *GRPCError) DefinitionGroups() []VariableDefinitionGroup
- func (e *GRPCError) Definitions() VariableDefinitions
- func (e *GRPCError) MarkUsed(nameRefMap map[string]struct{})
- func (e *GRPCError) MessageExprs() []*MessageExpr
- func (e *GRPCError) MessageToDefsMap() map[*Message]VariableDefinitions
- func (e *GRPCError) ProtoFormat(opt *ProtoFormatOption) string
- func (e *GRPCError) ReferenceNames() []string
- type GRPCErrorDetail
- func (detail *GRPCErrorDetail) MarkUsed(nameRefMap map[string]struct{})
- func (detail *GRPCErrorDetail) MessageExprs() []*MessageExpr
- func (detail *GRPCErrorDetail) MessageToDefsMap() map[*Message]VariableDefinitions
- func (detail *GRPCErrorDetail) ProtoFormat(opt *ProtoFormatOption) string
- func (detail *GRPCErrorDetail) ReferenceNames() []string
- type GRPCErrorDetails
- type GRPCErrorIndexes
- type GoPackage
- type Iterator
- type LocalizedMessage
- type LocationError
- type MapExpr
- type MapIteratorExpr
- type Message
- func (m *Message) AllEnums() []*Enum
- func (m *Message) AllMessages() []*Message
- func (m *Message) AllVariableDefinitions() VariableDefinitions
- func (m *Message) CustomResolverFields() []*Field
- func (m *Message) CustomResolvers() []*CustomResolver
- func (m *Message) DependMethods() []*Method
- func (m *Message) DependServices() []*Service
- func (m *Message) DependencyGraphTreeFormat() string
- func (m *Message) FQDN() string
- func (m *Message) Field(name string) *Field
- func (m *Message) FileName() string
- func (m *Message) GoPackage() *GoPackage
- func (m *Message) GoPackageDependencies() []*GoPackage
- func (m *Message) HasCELValue() bool
- func (m *Message) HasCustomResolver() bool
- func (m *Message) HasCustomResolverFields() bool
- func (m *Message) HasField(name string) bool
- func (m *Message) HasFieldRule() bool
- func (m *Message) HasResolvers() bool
- func (m *Message) HasRule() bool
- func (m *Message) HasRuleEveryFields() bool
- func (m *Message) IsEnumSelector() bool
- func (m *Message) Oneof(name string) *Oneof
- func (m *Message) Package() *Package
- func (m *Message) PackageName() string
- func (m *Message) ParentMessageNames() []string
- func (m *Message) ReferenceNames() []string
- func (m *Message) TypeConversionDecls() []*TypeConversionDecl
- func (m *Message) UseAllNameReference()
- func (m *Message) VariableDefinitionGroups() []VariableDefinitionGroup
- type MessageDependencyGraph
- type MessageDependencyGraphNode
- type MessageExpr
- type MessageRule
- type Method
- type MethodCall
- type MethodRule
- type Oneof
- type OneofField
- type Option
- type OutputFilePathConfig
- type OutputFilePathMode
- type OutputFilePathResolver
- type Package
- type PreconditionFailure
- type PreconditionFailureViolation
- type ProtoFormatOption
- type Request
- type Resolver
- type Result
- type RetryPolicy
- type RetryPolicyConstant
- type RetryPolicyExponential
- type SequentialVariableDefinitionGroup
- type Service
- func (s *Service) CustomResolvers() []*CustomResolver
- func (s *Service) ExistsCustomResolver() bool
- func (s *Service) FQDN() string
- func (s *Service) GoPackage() *GoPackage
- func (s *Service) GoPackageDependencies() []*GoPackage
- func (s *Service) HasMessageInMethod(msg *Message) bool
- func (s *Service) HasMessageInVariables(msg *Message) bool
- func (s *Service) Method(name string) *Method
- func (s *Service) Package() *Package
- func (s *Service) PackageName() string
- func (s *Service) ServiceDependencies() []*ServiceDependency
- func (s *Service) UseServices() []*Service
- type ServiceDependency
- type ServiceRule
- type ServiceVariable
- type ServiceVariableExpr
- type ServiceVariableValidationExpr
- type SwitchCaseExpr
- type SwitchDefaultExpr
- type SwitchExpr
- func (e *SwitchExpr) DefinitionGroups() []VariableDefinitionGroup
- func (e *SwitchExpr) Definitions() VariableDefinitions
- func (e *SwitchExpr) MarkUsed(nameRefMap map[string]struct{})
- func (e *SwitchExpr) MessageExprs() []*MessageExpr
- func (e *SwitchExpr) MessageToDefsMap() map[*Message]VariableDefinitions
- func (e *SwitchExpr) ProtoFormat(opt *ProtoFormatOption) string
- func (e *SwitchExpr) ReferenceNames() []string
- type Type
- func NewCELStandardLibraryMessageType(pkgName, msgName string) *Type
- func NewEnumSelectorType(trueType, falseType *Type) *Type
- func NewEnumType(enum *Enum, repeated bool) *Type
- func NewMapType(key, value *Type) *Type
- func NewMapTypeWithName(name string, key, value *Type) *Type
- func NewMessageType(msg *Message, repeated bool) *Type
- type TypeConversionDecl
- type ValidationExpr
- type Value
- type ValueCandidate
- type ValueCandidates
- type VariableDefinition
- func (def *VariableDefinition) IsValidation() bool
- func (def *VariableDefinition) MarkUsed(nameRefMap map[string]struct{})
- func (def *VariableDefinition) MessageExprs() []*MessageExpr
- func (def *VariableDefinition) MessageToDefsMap() map[*Message]VariableDefinitions
- func (def *VariableDefinition) ProtoFormat(opt *ProtoFormatOption) string
- func (def *VariableDefinition) ReferenceNames() []string
- type VariableDefinitionGroup
- type VariableDefinitionGroupType
- type VariableDefinitionSet
- func (set *VariableDefinitionSet) DefinitionGroups() []VariableDefinitionGroup
- func (set *VariableDefinitionSet) Definitions() VariableDefinitions
- func (set *VariableDefinitionSet) DependencyGraph() *MessageDependencyGraph
- func (set *VariableDefinitionSet) MarkUsed(nameRefMap map[string]struct{})
- func (set *VariableDefinitionSet) MessageExprs() []*MessageExpr
- func (set *VariableDefinitionSet) MessageToDefsMap() map[*Message]VariableDefinitions
- func (set *VariableDefinitionSet) ReferenceNames() []string
- type VariableDefinitions
- type VariableExpr
- type Warning
Constants ¶
This section is empty.
Variables ¶
var ( DefaultRetryMaxRetryCount = uint64(5) DefaultRetryConstantInterval = time.Second DefaultRetryExponentialInitialInterval = 500 * time.Millisecond DefaultRetryExponentialRandomizationFactor = float64(0.5) DefaultRetryExponentialMultiplier = float64(1.5) DefaultRetryExponentialMaxInterval = 60 * time.Second )
var ( DoubleType = &Type{Kind: types.Double} FloatType = &Type{Kind: types.Float} Int32Type = &Type{Kind: types.Int32} Int64Type = &Type{Kind: types.Int64} Uint32Type = &Type{Kind: types.Uint32} Uint64Type = &Type{Kind: types.Uint64} Sint32Type = &Type{Kind: types.Sint32} Sint64Type = &Type{Kind: types.Sint64} Fixed32Type = &Type{Kind: types.Fixed32} Fixed64Type = &Type{Kind: types.Fixed64} Sfixed32Type = &Type{Kind: types.Sfixed32} Sfixed64Type = &Type{Kind: types.Sfixed64} BoolType = &Type{Kind: types.Bool} StringType = &Type{Kind: types.String} BytesType = &Type{Kind: types.Bytes} EnumType = &Type{Kind: types.Enum} EnvType = &Type{Kind: types.String} NullType = &Type{IsNull: true} DoubleRepeatedType = &Type{Kind: types.Double, Repeated: true} FloatRepeatedType = &Type{Kind: types.Float, Repeated: true} Int32RepeatedType = &Type{Kind: types.Int32, Repeated: true} Int64RepeatedType = &Type{Kind: types.Int64, Repeated: true} Uint32RepeatedType = &Type{Kind: types.Uint32, Repeated: true} Uint64RepeatedType = &Type{Kind: types.Uint64, Repeated: true} Sint32RepeatedType = &Type{Kind: types.Sint32, Repeated: true} Sint64RepeatedType = &Type{Kind: types.Sint64, Repeated: true} Fixed32RepeatedType = &Type{Kind: types.Fixed32, Repeated: true} Fixed64RepeatedType = &Type{Kind: types.Fixed64, Repeated: true} Sfixed32RepeatedType = &Type{Kind: types.Sfixed32, Repeated: true} Sfixed64RepeatedType = &Type{Kind: types.Sfixed64, Repeated: true} BoolRepeatedType = &Type{Kind: types.Bool, Repeated: true} StringRepeatedType = &Type{Kind: types.String, Repeated: true} BytesRepeatedType = &Type{Kind: types.Bytes, Repeated: true} EnumRepeatedType = &Type{Kind: types.Enum, Repeated: true} EnvRepeatedType = &Type{Kind: types.String, Repeated: true} )
var DefaultProtoFormatOption = &ProtoFormatOption{IndentSpaceNum: 2}
var FieldConversionKindAll = FieldConversionKindValue | FieldConversionKindAutoBind | FieldConversionKindAlias | FieldConversionKindOneof
Functions ¶
func DependencyGraphTreeFormat ¶
func DependencyGraphTreeFormat(groups []VariableDefinitionGroup) string
func ExtractIndividualErrors ¶
ExtractIndividualErrors extracts all error instances from Error type.
func IsGRPCFederationGeneratedFile ¶ added in v0.4.0
Types ¶
type AllMessageDependencyGraph ¶ added in v0.3.0
type AllMessageDependencyGraph struct {
Roots []*AllMessageDependencyGraphNode
}
func CreateAllMessageDependencyGraph ¶ added in v0.3.0
func CreateAllMessageDependencyGraph(ctx *context, msgs []*Message) *AllMessageDependencyGraph
CreateAllMessageDependencyGraph creates a dependency graph for all messages with message options defined.
type AllMessageDependencyGraphNode ¶ added in v0.3.0
type AllMessageDependencyGraphNode struct {
Parent []*AllMessageDependencyGraphNode
Children []*AllMessageDependencyGraphNode
Message *Message
}
type AllMessageDependencyGraphNodeReferenceBuilder ¶ added in v0.13.0
type AllMessageDependencyGraphNodeReferenceBuilder struct {
// contains filtered or unexported fields
}
func (*AllMessageDependencyGraphNodeReferenceBuilder) Build ¶ added in v0.13.0
func (b *AllMessageDependencyGraphNodeReferenceBuilder) Build(ctx *context)
type Argument ¶
func (*Argument) ProtoFormat ¶
func (a *Argument) ProtoFormat(opt *ProtoFormatOption, isRequestArg bool) string
type AutoBindField ¶
type AutoBindField struct {
VariableDefinition *VariableDefinition
Field *Field
}
func (*AutoBindField) ProtoFormat ¶
func (f *AutoBindField) ProtoFormat(opt *ProtoFormatOption) string
type BadRequest ¶ added in v0.5.2
type BadRequest struct {
FieldViolations []*BadRequestFieldViolation
}
type BadRequestFieldViolation ¶ added in v0.5.2
type CELFunction ¶ added in v0.10.0
func (*CELFunction) Signatures ¶ added in v0.15.3
func (f *CELFunction) Signatures() []*CELPluginFunctionSignature
Signatures returns signature for overload function. If there is an enum type, we need to prepare functions for both `opaque<int>` and `int` patterns.
type CELPlugin ¶ added in v0.10.0
type CELPlugin struct {
Name string
Desc string
Functions []*CELFunction
Capability *CELPluginCapability
}
func (*CELPlugin) CompileOptions ¶ added in v0.10.0
func (*CELPlugin) LibraryName ¶ added in v0.10.0
func (*CELPlugin) ProgramOptions ¶ added in v0.10.0
func (plugin *CELPlugin) ProgramOptions() []cel.ProgramOption
type CELPluginCapability ¶ added in v1.12.0
type CELPluginCapability struct {
Env *CELPluginEnvCapability
FileSystem *CELPluginFileSystemCapability
Network *CELPluginNetworkCapability
}
type CELPluginEnvCapability ¶ added in v1.12.0
type CELPluginFileSystemCapability ¶ added in v1.12.0
type CELPluginFileSystemCapability struct {
MountPath string
}
type CELPluginFunctionSignature ¶ added in v0.15.3
type CELPluginNetworkCapability ¶ added in v1.12.0
type CELPluginNetworkCapability struct {
}
type CELRegistry ¶ added in v0.2.0
func (*CELRegistry) EnumValue ¶ added in v1.0.0
func (r *CELRegistry) EnumValue(enumName string) ref.Val
func (*CELRegistry) FindStructFieldType ¶ added in v0.2.0
func (r *CELRegistry) FindStructFieldType(structType, fieldName string) (*celtypes.FieldType, bool)
func (*CELRegistry) LookupEnum ¶ added in v0.2.0
func (r *CELRegistry) LookupEnum(t *celtypes.Type) (*Enum, bool)
func (*CELRegistry) RegisterFiles ¶ added in v0.2.0
func (r *CELRegistry) RegisterFiles(fds ...*descriptorpb.FileDescriptorProto) error
type CELValue ¶ added in v0.2.0
type CELValue struct {
Expr string
Out *Type
CheckedExpr *exprv1.CheckedExpr
}
func (*CELValue) ReferenceNames ¶ added in v0.3.0
type CallExpr ¶ added in v0.6.0
type CallExpr struct {
Method *Method
Request *Request
Timeout *time.Duration
Retry *RetryPolicy
Option *GRPCCallOption
Metadata *CELValue
Errors []*GRPCError
}
func (*CallExpr) MessageExprs ¶ added in v0.13.0
func (e *CallExpr) MessageExprs() []*MessageExpr
func (*CallExpr) MessageToDefsMap ¶ added in v0.13.0
func (e *CallExpr) MessageToDefsMap() map[*Message]VariableDefinitions
func (*CallExpr) ProtoFormat ¶ added in v0.6.0
func (e *CallExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*CallExpr) ReferenceNames ¶ added in v0.6.0
type ConcurrentVariableDefinitionGroup ¶ added in v0.10.0
type ConcurrentVariableDefinitionGroup struct {
Starts []VariableDefinitionGroup
End *VariableDefinition
}
func (*ConcurrentVariableDefinitionGroup) Type ¶ added in v0.10.0
func (g *ConcurrentVariableDefinitionGroup) Type() VariableDefinitionGroupType
func (*ConcurrentVariableDefinitionGroup) VariableDefinitions ¶ added in v0.10.0
func (g *ConcurrentVariableDefinitionGroup) VariableDefinitions() VariableDefinitions
type CustomResolver ¶
func (*CustomResolver) FQDN ¶ added in v0.1.1
func (r *CustomResolver) FQDN() string
type EnumExpr ¶ added in v1.8.0
func (*EnumExpr) ProtoFormat ¶ added in v1.8.0
func (e *EnumExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*EnumExpr) ReferenceNames ¶ added in v1.8.0
type EnumValue ¶
type EnumValue struct {
Value string
Enum *Enum
Rule *EnumValueRule
}
type EnumValueAlias ¶ added in v0.17.0
type EnumValueAttribute ¶ added in v1.8.0
type EnumValueRule ¶
type EnumValueRule struct {
Default bool
NoAlias bool
Aliases []*EnumValueAlias
Attrs []*EnumValueAttribute
}
type EnvVar ¶ added in v1.0.0
type EnvVar struct {
Name string
Type *Type
Option *EnvVarOption
}
type EnvVarOption ¶ added in v1.0.0
type Error ¶
type Error struct {
Errs []error
}
Error represents resolver package's error. this has multiple error instances from resolver.
type Field ¶
type Field struct {
Name string
Desc *descriptorpb.FieldDescriptorProto
Type *Type
Oneof *Oneof
Rule *FieldRule
Message *Message
}
func (*Field) HasCustomResolver ¶
func (*Field) HasMessageCustomResolver ¶
func (*Field) RequiredTypeConversion ¶
func (f *Field) RequiredTypeConversion(kind FieldConversionKind) bool
func (*Field) SourceTypes ¶ added in v0.17.0
func (f *Field) SourceTypes(kind FieldConversionKind) []*Type
func (*Field) TypeConversionDecls ¶
func (f *Field) TypeConversionDecls() []*TypeConversionDecl
type FieldConversionKind ¶ added in v1.21.0
type FieldConversionKind int
const ( FieldConversionKindUnknown FieldConversionKind = 1 << iota FieldConversionKindValue FieldConversionKindAutoBind FieldConversionKindAlias FieldConversionKindOneof )
type FieldOneofRule ¶ added in v0.3.0
type FieldOneofRule struct {
If *CELValue
Default bool
By *CELValue
DefSet *VariableDefinitionSet
}
FieldOneofRule represents grpc.federation.field.oneof.
type FieldRule ¶
type FieldRule struct {
// Value value to bind to field.
Value *Value
// CustomResolver whether `custom_resolver = true` is set in grpc.federation.field option.
CustomResolver bool
// MessageCustomResolver whether `custom_resolver = true` is set in grpc.federation.message option.
MessageCustomResolver bool
// Aliases valid if `alias` is specified in grpc.federation.field option.
Aliases []*Field
// AutoBindField valid if `autobind = true` is specified in resolver.response of grpc.federation.message option.
AutoBindField *AutoBindField
// Oneof represents oneof for field option.
Oneof *FieldOneofRule
// Env option for environment variable.
Env *EnvVarOption
}
func (*FieldRule) ProtoFormat ¶
func (r *FieldRule) ProtoFormat(opt *ProtoFormatOption) string
type File ¶
type File struct {
Package *Package
GoPackage *GoPackage
Name string
Desc *descriptorpb.FileDescriptorProto
ImportFiles []*File
Services []*Service
Messages []*Message
Enums []*Enum
CELPlugins []*CELPlugin
}
func (*File) AllCELPlugins ¶ added in v1.9.8
func (*File) AllEnums ¶ added in v0.13.1
AllEnums returns a list that includes the enums defined in the file itself.
func (*File) AllEnumsIncludeDeps ¶ added in v1.9.7
AllEnumsIncludeDeps recursively searches for the imported file and returns a list of all enums.
func (*File) AllUseMethods ¶ added in v1.22.0
AllUseMethods list of methods that the Services included in the file depend on.
func (*File) HasServiceWithRule ¶ added in v0.4.0
func (*File) PackageName ¶
func (*File) PrivatePackageName ¶ added in v1.9.6
type GRPCCallOption ¶ added in v1.11.0
type GRPCCallOption struct {
Header *VariableDefinition
Trailer *VariableDefinition
ContentSubtype *string
MaxCallRecvMsgSize *int64
MaxCallSendMsgSize *int64
StaticMethod *bool
WaitForReady *bool
}
type GRPCError ¶ added in v0.13.0
type GRPCError struct {
DefSet *VariableDefinitionSet
If *CELValue
Code *code.Code
Message *CELValue
Details GRPCErrorDetails
Ignore bool
IgnoreAndResponse *CELValue
LogLevel slog.Level
}
func (*GRPCError) DefinitionGroups ¶ added in v0.13.0
func (e *GRPCError) DefinitionGroups() []VariableDefinitionGroup
func (*GRPCError) Definitions ¶ added in v1.22.0
func (e *GRPCError) Definitions() VariableDefinitions
func (*GRPCError) MessageExprs ¶ added in v0.13.0
func (e *GRPCError) MessageExprs() []*MessageExpr
func (*GRPCError) MessageToDefsMap ¶ added in v0.13.0
func (e *GRPCError) MessageToDefsMap() map[*Message]VariableDefinitions
func (*GRPCError) ProtoFormat ¶ added in v0.13.0
func (e *GRPCError) ProtoFormat(opt *ProtoFormatOption) string
func (*GRPCError) ReferenceNames ¶ added in v0.13.0
ReferenceNames returns all the unique reference names in the error definition.
type GRPCErrorDetail ¶ added in v0.13.0
type GRPCErrorDetail struct {
If *CELValue
DefSet *VariableDefinitionSet
By []*CELValue
Messages *VariableDefinitionSet
PreconditionFailures []*PreconditionFailure
BadRequests []*BadRequest
LocalizedMessages []*LocalizedMessage
}
func (*GRPCErrorDetail) MarkUsed ¶ added in v0.13.0
func (detail *GRPCErrorDetail) MarkUsed(nameRefMap map[string]struct{})
func (*GRPCErrorDetail) MessageExprs ¶ added in v0.13.0
func (detail *GRPCErrorDetail) MessageExprs() []*MessageExpr
func (*GRPCErrorDetail) MessageToDefsMap ¶ added in v0.13.0
func (detail *GRPCErrorDetail) MessageToDefsMap() map[*Message]VariableDefinitions
func (*GRPCErrorDetail) ProtoFormat ¶ added in v0.13.0
func (detail *GRPCErrorDetail) ProtoFormat(opt *ProtoFormatOption) string
func (*GRPCErrorDetail) ReferenceNames ¶ added in v0.13.0
func (detail *GRPCErrorDetail) ReferenceNames() []string
type GRPCErrorDetails ¶ added in v0.13.0
type GRPCErrorDetails []*GRPCErrorDetail
func (GRPCErrorDetails) ProtoFormat ¶ added in v0.13.0
func (d GRPCErrorDetails) ProtoFormat(opt *ProtoFormatOption) string
type GRPCErrorIndexes ¶ added in v0.13.0
type GoPackage ¶
func ResolveGoPackage ¶
func ResolveGoPackage(def *descriptorpb.FileDescriptorProto) (*GoPackage, error)
type Iterator ¶ added in v0.6.0
type Iterator struct {
Name string
Source *VariableDefinition
}
func (*Iterator) ProtoFormat ¶ added in v0.7.1
func (iter *Iterator) ProtoFormat(opt *ProtoFormatOption) string
type LocalizedMessage ¶ added in v0.5.2
type LocationError ¶
LocationError holds error message with location.
func ErrWithLocation ¶
func ErrWithLocation(msg string, loc *source.Location) *LocationError
ErrWithLocation creates LocationError instance from message and location.
func ToLocationError ¶
func ToLocationError(err error) *LocationError
ToLocationError convert err into LocationError if error instances the one.
func (*LocationError) Error ¶
func (e *LocationError) Error() string
type MapExpr ¶ added in v0.6.0
type MapExpr struct {
Iterator *Iterator
Expr *MapIteratorExpr
}
func (*MapExpr) MessageExprs ¶ added in v0.13.0
func (e *MapExpr) MessageExprs() []*MessageExpr
func (*MapExpr) ProtoFormat ¶ added in v0.7.1
func (e *MapExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*MapExpr) ReferenceNames ¶ added in v0.6.0
type MapIteratorExpr ¶ added in v0.6.0
type MapIteratorExpr struct {
Type *Type
By *CELValue
Message *MessageExpr
Enum *EnumExpr
}
func (*MapIteratorExpr) ProtoFormat ¶ added in v0.7.1
func (e *MapIteratorExpr) ProtoFormat(opt *ProtoFormatOption) []string
func (*MapIteratorExpr) ReferenceNames ¶ added in v0.6.0
func (e *MapIteratorExpr) ReferenceNames() []string
func (*MapIteratorExpr) ToVariableExpr ¶ added in v0.7.1
func (e *MapIteratorExpr) ToVariableExpr() *VariableExpr
type Message ¶
type Message struct {
File *File
Name string
Desc *descriptorpb.DescriptorProto
IsMapEntry bool
ParentMessage *Message
NestedMessages []*Message
Enums []*Enum
Fields []*Field
Oneofs []*Oneof
Rule *MessageRule
}
func NewMessage ¶
func (*Message) AllMessages ¶ added in v0.13.5
func (*Message) AllVariableDefinitions ¶ added in v1.8.0
func (m *Message) AllVariableDefinitions() VariableDefinitions
func (*Message) CustomResolverFields ¶
func (*Message) CustomResolvers ¶ added in v0.5.2
func (m *Message) CustomResolvers() []*CustomResolver
func (*Message) DependMethods ¶ added in v1.22.0
func (*Message) DependServices ¶ added in v0.5.2
func (*Message) DependencyGraphTreeFormat ¶
func (*Message) GoPackageDependencies ¶ added in v0.5.2
func (*Message) HasCELValue ¶ added in v0.2.0
func (*Message) HasCustomResolver ¶
func (*Message) HasCustomResolverFields ¶
func (*Message) HasFieldRule ¶
func (*Message) HasResolvers ¶ added in v0.4.0
func (*Message) HasRuleEveryFields ¶
func (*Message) IsEnumSelector ¶ added in v1.0.0
func (*Message) PackageName ¶
func (*Message) ParentMessageNames ¶
func (*Message) ReferenceNames ¶ added in v0.2.0
func (*Message) TypeConversionDecls ¶
func (m *Message) TypeConversionDecls() []*TypeConversionDecl
func (*Message) UseAllNameReference ¶
func (m *Message) UseAllNameReference()
func (*Message) VariableDefinitionGroups ¶ added in v0.10.0
func (m *Message) VariableDefinitionGroups() []VariableDefinitionGroup
type MessageDependencyGraph ¶
type MessageDependencyGraph struct {
Roots []*MessageDependencyGraphNode
}
func (*MessageDependencyGraph) VariableDefinitionGroups ¶ added in v0.10.0
func (g *MessageDependencyGraph) VariableDefinitionGroups() []VariableDefinitionGroup
type MessageDependencyGraphNode ¶
type MessageDependencyGraphNode struct {
Parent []*MessageDependencyGraphNode
Children []*MessageDependencyGraphNode
ParentMap map[*MessageDependencyGraphNode]struct{}
ChildrenMap map[*MessageDependencyGraphNode]struct{}
BaseMessage *Message
VariableDefinition *VariableDefinition
}
func (*MessageDependencyGraphNode) FQDN ¶ added in v0.3.0
func (n *MessageDependencyGraphNode) FQDN() string
type MessageExpr ¶ added in v0.6.0
func (*MessageExpr) ProtoFormat ¶ added in v0.6.0
func (e *MessageExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*MessageExpr) ReferenceNames ¶ added in v0.6.0
func (e *MessageExpr) ReferenceNames() []string
type MessageRule ¶
type MessageRule struct {
MessageArgument *Message
CustomResolver bool
Aliases []*Message
DefSet *VariableDefinitionSet
}
func (*MessageRule) ProtoFormat ¶
func (r *MessageRule) ProtoFormat(opt *ProtoFormatOption) string
type Method ¶
type Method struct {
Service *Service
Name string
Desc *descriptorpb.MethodDescriptorProto
Request *Message
Response *Message
Rule *MethodRule
}
func (*Method) FederationResponse ¶ added in v1.5.0
func (*Method) ProtoFormat ¶
func (m *Method) ProtoFormat(opt *ProtoFormatOption) string
type MethodCall ¶
type MethodCall struct {
Method *Method
Request *Request
Timeout *time.Duration
Retry *RetryPolicy
}
type MethodRule ¶
type Oneof ¶
func (*Oneof) IsSameType ¶ added in v0.3.0
type OneofField ¶
type OneofField struct {
*Field
}
func (*OneofField) FQDN ¶
func (f *OneofField) FQDN() string
func (*OneofField) IsConflict ¶
func (f *OneofField) IsConflict() bool
type OutputFilePathConfig ¶
type OutputFilePathConfig struct {
// Mode for file output ( default: ImportMode ).
Mode OutputFilePathMode
// Prefix used in ModulePrefixMode.
Prefix string
// FilePath specify if you know the file path specified at compile time.
FilePath string
// ImportPaths list of import paths used during compile.
ImportPaths []string
}
type OutputFilePathMode ¶
type OutputFilePathMode int
const ( ImportMode OutputFilePathMode = 0 ModulePrefixMode OutputFilePathMode = 1 SourceRelativeMode OutputFilePathMode = 2 )
type OutputFilePathResolver ¶
type OutputFilePathResolver struct {
// contains filtered or unexported fields
}
func NewOutputFilePathResolver ¶
func NewOutputFilePathResolver(cfg OutputFilePathConfig) *OutputFilePathResolver
func (*OutputFilePathResolver) FileName ¶
func (r *OutputFilePathResolver) FileName(file *File) string
func (*OutputFilePathResolver) OutputDir ¶
func (r *OutputFilePathResolver) OutputDir(fileName string, gopkg *GoPackage) (string, error)
func (*OutputFilePathResolver) OutputPath ¶
func (r *OutputFilePathResolver) OutputPath(file *File) (string, error)
OutputPath returns the path to the output file. Three output mode supported by protoc-gen-go are available. FYI: https://protobuf.dev/reference/go/go-generated.
type PreconditionFailure ¶ added in v0.5.2
type PreconditionFailure struct {
Violations []*PreconditionFailureViolation
}
type PreconditionFailureViolation ¶ added in v0.5.2
type ProtoFormatOption ¶
type Request ¶
func (*Request) ProtoFormat ¶
func (r *Request) ProtoFormat(opt *ProtoFormatOption) string
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
func New ¶
func New(files []*descriptorpb.FileDescriptorProto, opts ...Option) *Resolver
func (*Resolver) ResolveWellknownFiles ¶
type Result ¶
type Result struct {
// Files list of files with services with the grpc.federation.service option.
Files []*File
// Warnings all warnings occurred during the resolve process.
Warnings []*Warning
}
Result of resolver processing.
type RetryPolicy ¶
type RetryPolicy struct {
If *CELValue
Constant *RetryPolicyConstant
Exponential *RetryPolicyExponential
}
func (*RetryPolicy) MaxRetries ¶
func (p *RetryPolicy) MaxRetries() uint64
type RetryPolicyConstant ¶
type RetryPolicyExponential ¶
type SequentialVariableDefinitionGroup ¶ added in v0.10.0
type SequentialVariableDefinitionGroup struct {
Start VariableDefinitionGroup
End *VariableDefinition
}
func (*SequentialVariableDefinitionGroup) Type ¶ added in v0.10.0
func (g *SequentialVariableDefinitionGroup) Type() VariableDefinitionGroupType
func (*SequentialVariableDefinitionGroup) VariableDefinitions ¶ added in v0.10.0
func (g *SequentialVariableDefinitionGroup) VariableDefinitions() VariableDefinitions
type Service ¶
type Service struct {
File *File
Name string
Desc *descriptorpb.ServiceDescriptorProto
Methods []*Method
Rule *ServiceRule
Messages []*Message
MessageArgs []*Message
CELPlugins []*CELPlugin
}
func (*Service) CustomResolvers ¶
func (s *Service) CustomResolvers() []*CustomResolver
func (*Service) ExistsCustomResolver ¶
func (*Service) GoPackageDependencies ¶
func (*Service) HasMessageInMethod ¶ added in v0.4.0
func (*Service) HasMessageInVariables ¶ added in v1.9.0
func (*Service) PackageName ¶
func (*Service) ServiceDependencies ¶
func (s *Service) ServiceDependencies() []*ServiceDependency
func (*Service) UseServices ¶
type ServiceDependency ¶
type ServiceRule ¶
type ServiceRule struct {
Env *Env
Vars []*ServiceVariable
}
type ServiceVariable ¶ added in v1.9.0
type ServiceVariable struct {
Name string
If *CELValue
Expr *ServiceVariableExpr
}
func (*ServiceVariable) MessageExprs ¶ added in v1.9.0
func (sv *ServiceVariable) MessageExprs() []*MessageExpr
func (*ServiceVariable) ToVariableDefinition ¶ added in v1.9.0
func (sv *ServiceVariable) ToVariableDefinition() *VariableDefinition
type ServiceVariableExpr ¶ added in v1.9.0
type ServiceVariableExpr struct {
Type *Type
By *CELValue
Map *MapExpr
Message *MessageExpr
Enum *EnumExpr
Switch *SwitchExpr
Validation *ServiceVariableValidationExpr
}
type ServiceVariableValidationExpr ¶ added in v1.9.0
type SwitchCaseExpr ¶ added in v1.24.0
type SwitchCaseExpr struct {
DefSet *VariableDefinitionSet
If *CELValue
By *CELValue
}
func (*SwitchCaseExpr) ProtoFormat ¶ added in v1.24.0
func (c *SwitchCaseExpr) ProtoFormat(opt *ProtoFormatOption) string
type SwitchDefaultExpr ¶ added in v1.24.0
type SwitchDefaultExpr struct {
DefSet *VariableDefinitionSet
By *CELValue
}
func (*SwitchDefaultExpr) ProtoFormat ¶ added in v1.24.0
func (d *SwitchDefaultExpr) ProtoFormat(opt *ProtoFormatOption) string
type SwitchExpr ¶ added in v1.24.0
type SwitchExpr struct {
Type *Type
Cases []*SwitchCaseExpr
Default *SwitchDefaultExpr
}
func (*SwitchExpr) DefinitionGroups ¶ added in v1.24.0
func (e *SwitchExpr) DefinitionGroups() []VariableDefinitionGroup
func (*SwitchExpr) Definitions ¶ added in v1.24.0
func (e *SwitchExpr) Definitions() VariableDefinitions
func (*SwitchExpr) MarkUsed ¶ added in v1.24.0
func (e *SwitchExpr) MarkUsed(nameRefMap map[string]struct{})
func (*SwitchExpr) MessageExprs ¶ added in v1.24.0
func (e *SwitchExpr) MessageExprs() []*MessageExpr
func (*SwitchExpr) MessageToDefsMap ¶ added in v1.24.0
func (e *SwitchExpr) MessageToDefsMap() map[*Message]VariableDefinitions
func (*SwitchExpr) ProtoFormat ¶ added in v1.24.0
func (e *SwitchExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*SwitchExpr) ReferenceNames ¶ added in v1.24.0
func (e *SwitchExpr) ReferenceNames() []string
type Type ¶
type Type struct {
Kind types.Kind
IsNull bool
Repeated bool
Message *Message
Enum *Enum
OneofField *OneofField
}
var ( AnyType *Type TimestampType *Type DurationType *Type DurationRepeatedType *Type EmptyType *Type Int64ValueType *Type Int32ValueType *Type Uint64ValueType *Type Uint32ValueType *Type DoubleValueType *Type FloatValueType *Type BytesValueType *Type BoolValueType *Type StringValueType *Type WrapperNumberTypeMap map[string]struct{} )
func NewCELStandardLibraryMessageType ¶ added in v0.9.2
func NewEnumSelectorType ¶ added in v1.0.0
func NewEnumType ¶ added in v1.8.0
func NewMapType ¶ added in v1.0.0
func NewMapTypeWithName ¶ added in v1.0.0
func NewMessageType ¶
func (*Type) IsEnumSelector ¶ added in v1.8.1
func (*Type) IsNumberWrapper ¶ added in v0.17.4
type TypeConversionDecl ¶
func (*TypeConversionDecl) FQDN ¶
func (decl *TypeConversionDecl) FQDN() string
type ValidationExpr ¶ added in v0.6.0
func (*ValidationExpr) MarkUsed ¶ added in v0.13.0
func (e *ValidationExpr) MarkUsed(nameRefMap map[string]struct{})
func (*ValidationExpr) MessageExprs ¶ added in v0.13.0
func (e *ValidationExpr) MessageExprs() []*MessageExpr
func (*ValidationExpr) MessageToDefsMap ¶ added in v0.13.0
func (e *ValidationExpr) MessageToDefsMap() map[*Message]VariableDefinitions
func (*ValidationExpr) ProtoFormat ¶ added in v0.6.0
func (e *ValidationExpr) ProtoFormat(opt *ProtoFormatOption) string
type Value ¶
func NewByValue ¶ added in v0.7.1
func (*Value) ProtoFormat ¶
func (v *Value) ProtoFormat(opt *ProtoFormatOption) string
func (*Value) ReferenceNames ¶ added in v0.2.0
type ValueCandidate ¶ added in v0.7.0
type ValueCandidates ¶ added in v0.7.0
type ValueCandidates []*ValueCandidate
func (ValueCandidates) Filter ¶ added in v0.7.0
func (c ValueCandidates) Filter(typ *Type) ValueCandidates
func (ValueCandidates) Names ¶ added in v0.7.0
func (c ValueCandidates) Names() []string
func (ValueCandidates) Unique ¶ added in v0.7.0
func (c ValueCandidates) Unique() ValueCandidates
type VariableDefinition ¶ added in v0.6.0
type VariableDefinition struct {
Idx int
Name string
If *CELValue
AutoBind bool
Used bool
Expr *VariableExpr
// contains filtered or unexported fields
}
func (*VariableDefinition) IsValidation ¶ added in v1.3.0
func (def *VariableDefinition) IsValidation() bool
func (*VariableDefinition) MarkUsed ¶ added in v0.13.0
func (def *VariableDefinition) MarkUsed(nameRefMap map[string]struct{})
func (*VariableDefinition) MessageExprs ¶ added in v0.7.1
func (def *VariableDefinition) MessageExprs() []*MessageExpr
func (*VariableDefinition) MessageToDefsMap ¶ added in v0.13.0
func (def *VariableDefinition) MessageToDefsMap() map[*Message]VariableDefinitions
func (*VariableDefinition) ProtoFormat ¶ added in v0.6.0
func (def *VariableDefinition) ProtoFormat(opt *ProtoFormatOption) string
func (*VariableDefinition) ReferenceNames ¶ added in v0.6.0
func (def *VariableDefinition) ReferenceNames() []string
type VariableDefinitionGroup ¶ added in v0.10.0
type VariableDefinitionGroup interface {
Type() VariableDefinitionGroupType
VariableDefinitions() VariableDefinitions
// contains filtered or unexported methods
}
type VariableDefinitionGroupType ¶ added in v0.10.0
type VariableDefinitionGroupType string
const ( SequentialVariableDefinitionGroupType VariableDefinitionGroupType = "sequential" ConcurrentVariableDefinitionGroupType VariableDefinitionGroupType = "concurrent" )
type VariableDefinitionSet ¶ added in v0.13.0
type VariableDefinitionSet struct {
Defs VariableDefinitions
Groups []VariableDefinitionGroup
Graph *MessageDependencyGraph
}
func (*VariableDefinitionSet) DefinitionGroups ¶ added in v0.13.0
func (set *VariableDefinitionSet) DefinitionGroups() []VariableDefinitionGroup
func (*VariableDefinitionSet) Definitions ¶ added in v0.13.0
func (set *VariableDefinitionSet) Definitions() VariableDefinitions
func (*VariableDefinitionSet) DependencyGraph ¶ added in v0.13.0
func (set *VariableDefinitionSet) DependencyGraph() *MessageDependencyGraph
func (*VariableDefinitionSet) MarkUsed ¶ added in v0.13.0
func (set *VariableDefinitionSet) MarkUsed(nameRefMap map[string]struct{})
func (*VariableDefinitionSet) MessageExprs ¶ added in v0.13.0
func (set *VariableDefinitionSet) MessageExprs() []*MessageExpr
func (*VariableDefinitionSet) MessageToDefsMap ¶ added in v0.13.0
func (set *VariableDefinitionSet) MessageToDefsMap() map[*Message]VariableDefinitions
func (*VariableDefinitionSet) ReferenceNames ¶ added in v0.13.0
func (set *VariableDefinitionSet) ReferenceNames() []string
type VariableDefinitions ¶ added in v0.6.0
type VariableDefinitions []*VariableDefinition
func (VariableDefinitions) ProtoFormat ¶ added in v0.6.0
func (defs VariableDefinitions) ProtoFormat(opt *ProtoFormatOption) string
type VariableExpr ¶ added in v0.6.0
type VariableExpr struct {
Type *Type
By *CELValue
Map *MapExpr
Call *CallExpr
Message *MessageExpr
Enum *EnumExpr
Switch *SwitchExpr
Validation *ValidationExpr
}
func (*VariableExpr) ProtoFormat ¶ added in v0.6.0
func (e *VariableExpr) ProtoFormat(opt *ProtoFormatOption) string
func (*VariableExpr) ReferenceNames ¶ added in v0.7.2
func (e *VariableExpr) ReferenceNames() []string