source

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentOption

type ArgumentOption struct {
	Idx    int
	Name   bool
	By     bool
	Inline bool
}

ArgumentOption represents message argument location of grpc.federation.message option.

type Enum

type Enum struct {
	Name   string
	Option *EnumOption
	Value  *EnumValue
}

Enum represents enum location.

type EnumOption

type EnumOption struct {
	Alias bool
}

EnumOption represents grpc.federation.enum option location.

type EnumValue

type EnumValue struct {
	Value  string
	Option *EnumValueOption
}

EnumValue represents enum value location.

type EnumValueOption

type EnumValueOption struct {
	Alias   bool
	Default bool
}

EnumValueOption represents grpc.federation.enum_value option location.

type Field

type Field struct {
	Name   string
	Option *FieldOption
}

Field represents message field location.

type FieldOption

type FieldOption struct {
	By    bool
	Alias bool
}

FieldOption represents grpc.federation.field option location.

type File

type File struct {
	// contains filtered or unexported fields
}

func NewFile

func NewFile(path string, content []byte) (*File, error)

func (*File) AST

func (f *File) AST() *ast.FileNode

func (*File) Content

func (f *File) Content() []byte

func (*File) FindLocationByPos

func (f *File) FindLocationByPos(pos Position) *Location

FindLocationByPos returns the corresponding location information from the position in the source code.

func (*File) Imports

func (f *File) Imports() []string

func (*File) NodeInfoByLocation

func (f *File) NodeInfoByLocation(loc *Location) *ast.NodeInfo

NodeInfoByLocation returns information about the node at the position specified by location in the AST of the Protocol Buffers.

func (*File) Path

func (f *File) Path() string

func (*File) SemanticTokenTypeMap

func (f *File) SemanticTokenTypeMap() map[ast.Token]protocol.SemanticTokenTypes

type Location

type Location struct {
	FileName  string
	GoPackage bool
	Service   *Service
	Message   *Message
	Enum      *Enum
}

Location represents semantic location information for grpc federation option.

func EnumAliasLocation

func EnumAliasLocation(fileName, msgName, enumName string) *Location

EnumAliasLocation creates location for alias in grpc.federation.enum option.

func EnumLocation

func EnumLocation(fileName, msgName, enumName string) *Location

EnumLocation creates location for enum.

func EnumOptionLocation

func EnumOptionLocation(fileName, msgName, enumName string) *Location

EnumOptionLocation creates location for grpc.federation.enum option.

func EnumValueAliasLocation

func EnumValueAliasLocation(fileName, msgName, enumName, enumValueName string) *Location

EnumValueAliasLocation creates location for alias in grpc.federation.enum_value option.

func EnumValueLocation

func EnumValueLocation(fileName, msgName, enumName, enumValueName string) *Location

EnumValueLocation creates location for enum value.

func EnumValueOptionLocation

func EnumValueOptionLocation(fileName, msgName, enumName, enumValueName string) *Location

EnumValueOptionLocation creates location for grpc.federation.enum_value option.

func FileLocation

func FileLocation(fileName string) *Location

FileLocation creates location for file.

func GoPackageLocation

func GoPackageLocation(fileName string) *Location

GoPackageLocation creates location for go_package option.

func MessageAliasLocation

func MessageAliasLocation(fileName, msgName string) *Location

MessageAliasOptionLocation creates location for alias in grpc.federaiton.message option.

func MessageDependencyArgumentByLocation

func MessageDependencyArgumentByLocation(fileName, msgName string, idx, argIdx int) *Location

MessageDependencyArgumentByLocation creates location for messages[*].args[*].by in grpc.federation.message.

func MessageDependencyArgumentInlineLocation

func MessageDependencyArgumentInlineLocation(fileName, msgName string, idx, argIdx int) *Location

MessageDependencyArgumentInlineLocation creates location for messages[*].args[*].inline in grpc.federation.message.

func MessageDependencyArgumentNameLocation

func MessageDependencyArgumentNameLocation(fileName, msgName string, idx, argIdx int) *Location

MessageDependencyArgumentNameLocation creates location for messages[*].args[*].name in grpc.federation.message.

func MessageDependencyMessageLocation

func MessageDependencyMessageLocation(fileName, msgName string, idx int) *Location

MessageDependencyMessageLocation creates location for messages[*].message in grpc.federation.message.

func MessageFieldAliasLocation

func MessageFieldAliasLocation(fileName, msgName, fieldName string) *Location

MessageFieldAliasLocation creates location for alias in grpc.federation.field option.

func MessageFieldByLocation

func MessageFieldByLocation(fileName, msgName, fieldName string) *Location

MessageFieldByLocation creates location for by in grpc.federation.field option.

func MessageFieldLocation

func MessageFieldLocation(fileName, msgName, fieldName string) *Location

MessageFieldLocation creates location for message field.

func MessageFieldOptionLocation

func MessageFieldOptionLocation(fileName, msgName, fieldName string) *Location

MessageFieldOptionLocation creates location for grpc.federation.field option.

func MessageLocation

func MessageLocation(fileName, msgName string) *Location

MessageLocation creates location for message name.

func MessageOptionLocation

func MessageOptionLocation(fileName, msgName string) *Location

MessageOptionLocation creates location for grpc.federaiton.message option.

func MethodLocation

func MethodLocation(fileName, msgName string) *Location

MethodLocation creates location for resolver.method in grpc.federation.message.

func MethodRetryConstantIntervalLocation

func MethodRetryConstantIntervalLocation(fileName, msgName string) *Location

MethodRetryConstantIntervalLocation creates location for resolver.retry.constant.interval in grpc.federation.message.

func MethodRetryExponentialInitialIntervalLocation

func MethodRetryExponentialInitialIntervalLocation(fileName, msgName string) *Location

MethodRetryExponentialInitialIntervalLocation creates location for resolver.retry.exponential.initial_interval in grpc.federation.message.

func MethodRetryExponentialMaxIntervalLocation

func MethodRetryExponentialMaxIntervalLocation(fileName, msgName string) *Location

MethodRetryExponentialMaxIntervalLocation creates location for resolver.retry.exponential.max_interval in grpc.federation.message.

func MethodTimeoutLocation

func MethodTimeoutLocation(fileName, msgName string) *Location

MethodTimeoutLocation creates location for resolver.timeout in grpc.federation.message.

func OneofOptionLocation

func OneofOptionLocation(fileName, msgName, oneofName string) *Location

OneofOptionLocation creates location for grpc.federaiton.oneof option.

func RequestByLocation

func RequestByLocation(fileName, msgName string, idx int) *Location

RequestByLocation creates location for resolver.request[*].by in grpc.federation.message.

func RequestFieldLocation

func RequestFieldLocation(fileName, msgName string, idx int) *Location

RequestFieldLocation creates location for resolver.request[*].field in grpc.federation.message.

func ResponseFieldLocation

func ResponseFieldLocation(fileName, msgName string, idx int) *Location

ResponseFieldLocation creates location for resolver.response[*].field in grpc.federation.message.

func ServiceDependencyLocation

func ServiceDependencyLocation(fileName, svcName string, idx int) *Location

ServiceDependencyLocation creates location for service dependencies.

func ServiceDependencyNameLocation

func ServiceDependencyNameLocation(fileName, svcName string, idx int) *Location

ServiceDependencyNameLocation creates location for name of service dependencies.

func ServiceDependencyServiceLocation

func ServiceDependencyServiceLocation(fileName, svcName string, idx int) *Location

ServiceDependencyServiceLocation creates location for service of service dependencies.

func ServiceLocation

func ServiceLocation(fileName, svcName string) *Location

ServiceLocation creates location for service name.

func ServiceMethodLocation

func ServiceMethodLocation(fileName, svcName, methodName string) *Location

ServiceMethodLocation creates location for method of service.

func ServiceMethodOptionLocation

func ServiceMethodOptionLocation(fileName, svcName, methodName string) *Location

ServiceMethodOptionLocation creates location for grpc.federation.method option.

func ServiceMethodRequestLocation

func ServiceMethodRequestLocation(fileName, svcName, methodName string) *Location

ServiceMethodRequestLocation creates location for method request type of service.

func ServiceMethodResponseLocation

func ServiceMethodResponseLocation(fileName, svcName, methodName string) *Location

ServiceMethodResponseLocation creates location for method response type of service.

func ServiceMethodTimeoutLocation

func ServiceMethodTimeoutLocation(fileName, svcName, methodName string) *Location

ServiceMethodTimeoutLocation creates location for timeout of grpc.federation.method option.

func ServiceOptionLocation

func ServiceOptionLocation(fileName, svcName string) *Location

ServiceOptionLocation creates location for grpc.federation.service option.

type Message

type Message struct {
	Name   string
	Option *MessageOption
	Field  *Field
	Enum   *Enum
	Oneof  *Oneof
}

Message represents message location.

type MessageDependencyOption

type MessageDependencyOption struct {
	Idx     int
	Name    bool
	Message bool
	Args    *ArgumentOption
}

MessageDependencyOption represents messages location of grpc.federation.message option.

type MessageOption

type MessageOption struct {
	Resolver *ResolverOption
	Messages *MessageDependencyOption
	Alias    bool
}

MessageOption represents grpc.federation.message option location.

type Method

type Method struct {
	Name     string
	Request  bool
	Response bool
	Option   *MethodOption
}

Method represents service's method location.

type MethodOption

type MethodOption struct {
	Timeout bool
}

MethodOption represents grpc.federation.method option location.

type Oneof

type Oneof struct {
	Name   string
	Option *OneofOption
}

type OneofOption

type OneofOption struct {
}

type Position

type Position struct {
	Line int
	Col  int
}

Position represents source position in proto file.

type RequestOption

type RequestOption struct {
	Idx   int
	Field bool
	By    bool
}

RequestOption represents resolver.request location of grpc.federation.message option.

type ResolverOption

type ResolverOption struct {
	Method   bool
	Request  *RequestOption
	Response *ResponseOption
	Timeout  bool
	Retry    *RetryOption
}

ResolverOption represents resolver location of grpc.federation.message option.

type ResponseOption

type ResponseOption struct {
	Idx      int
	Name     bool
	Field    bool
	AutoBind bool
}

ResponseOption represents resolver.response location of grpc.federation.message option.

type RetryConstantOption

type RetryConstantOption struct {
	Interval   bool
	MaxRetries bool
}

RetryConstantOption represents resolver.retry.constant location of grpc.federation.message option.

type RetryExponentialOption

type RetryExponentialOption struct {
	InitialInterval     bool
	RandomizationFactor bool
	Multiplier          bool
	MaxInterval         bool
	MaxRetries          bool
}

RetryExponentialOption represents resolver.retry.exponential location of grpc.federation.message option.

type RetryOption

type RetryOption struct {
	Constant    *RetryConstantOption
	Exponential *RetryExponentialOption
}

RetryOption represents resolver.retry location of grpc.federation.message option.

type Service

type Service struct {
	Name   string
	Method *Method
	Option *ServiceOption
}

Service represents service location.

type ServiceDependencyOption

type ServiceDependencyOption struct {
	Idx     int
	Name    bool
	Service bool
}

ServiceDependencyOption represents dependencies option of service option.

type ServiceOption

type ServiceOption struct {
	Dependencies *ServiceDependencyOption
}

ServiceOption represents grpc.federation.service option location.

Jump to

Keyboard shortcuts

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