context

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildContextOptions

type BuildContextOptions struct {
	PluginName string
	Settings   *settings.Settings
	Plugin     *protogen.Plugin
	Addons     []*addon.Addon
}

type Context

type Context struct {
	PluginName string
	ModuleName string
	Enums      []*Enum
	Methods    []*Method
	Package    *protobuf.Protobuf
	// contains filtered or unexported fields
}

func BuildContext

func BuildContext(opt BuildContextOptions) (*Context, error)

func (*Context) AddonContext

func (c *Context) AddonContext(addonName string) interface{}

func (*Context) AddonIntoOutboundExtensionContent

func (c *Context) AddonIntoOutboundExtensionContent(msg *Message, receiver string) string

func (*Context) CustomApiExtensions added in v0.2.0

func (c *Context) CustomApiExtensions() []*Message

func (*Context) DomainMessages

func (c *Context) DomainMessages() []*Message

func (*Context) Extension

func (c *Context) Extension() string

func (*Context) GetAddonTemplateImports

func (c *Context) GetAddonTemplateImports(addonName, tplName string) []*templateImport

func (*Context) GetTemplateImports

func (c *Context) GetTemplateImports(name string) []*templateImport

func (*Context) GetTemplateValidator

func (c *Context) GetTemplateValidator(name template.Name, _ interface{}) (template.ValidateForExecution, bool)

func (*Context) HasAddonImportFor

func (c *Context) HasAddonImportFor(addonName, tplName string) bool

func (*Context) HasAddonIntoOutboundExtensionContent

func (c *Context) HasAddonIntoOutboundExtensionContent(msg *Message) bool

func (*Context) HasImportFor

func (c *Context) HasImportFor(name string) bool

func (*Context) HasRequiredBody

func (c *Context) HasRequiredBody() bool

func (*Context) HasValidatableMessage

func (c *Context) HasValidatableMessage() bool

func (*Context) IsHTTPService

func (c *Context) IsHTTPService() bool

func (*Context) OutboundHasBitflagField

func (c *Context) OutboundHasBitflagField() bool

func (*Context) OutboundMessages

func (c *Context) OutboundMessages() []*Message

func (*Context) ServiceName

func (c *Context) ServiceName() string

func (*Context) UseCommonConverters

func (c *Context) UseCommonConverters() bool

func (*Context) ValidatableMessages

func (c *Context) ValidatableMessages() []*Message

func (*Context) WireInputMessages

func (c *Context) WireInputMessages() []*Message

type CustomCode

type CustomCode struct {
	Signature string
	Body      string
}

type Endpoint

type Endpoint struct {
	Body           string
	Path           string
	Method         string
	Parameters     []string
	HttpExtensions *extensions.HttpMethodExtensions
}

type Enum

type Enum struct {
	IsBitflagKind bool
	IsErrorCode   bool
	Name          string
	Prefix        string
	Entries       []*EnumEntry
	ProtoEnum     *protobuf.Enum
}

func (*Enum) HasEntryDefinition

func (e *Enum) HasEntryDefinition() bool

type EnumEntry

type EnumEntry struct {
	HasEntryDefinition bool
	ProtoName          string
	Name               string
}

type Field

type Field struct {
	IsMessage                bool
	IsMap                    bool
	IsArray                  bool
	IsProtoOptional          bool
	Type                     descriptor.FieldDescriptorProto_Type
	GoType                   string
	GoName                   string
	JsonName                 string
	ProtoName                string
	DomainName               string
	DomainTag                string
	InboundTag               string
	OutboundName             string
	OutboundTag              string
	OutboundJsonTagFieldName string
	MessageReceiver          string
	Location                 FieldLocation
	ProtoField               *protobuf.Field
	// contains filtered or unexported fields
}

func (*Field) ConvertDomainTypeToArrayWireInputType

func (f *Field) ConvertDomainTypeToArrayWireInputType(receiver string) string

func (*Field) ConvertDomainTypeToArrayWireType

func (f *Field) ConvertDomainTypeToArrayWireType(receiver string) string

func (*Field) ConvertDomainTypeToMapWireInputType

func (f *Field) ConvertDomainTypeToMapWireInputType(receiver string) string

func (*Field) ConvertDomainTypeToMapWireType

func (f *Field) ConvertDomainTypeToMapWireType(receiver string) string

func (*Field) ConvertDomainTypeToWireInputType

func (f *Field) ConvertDomainTypeToWireInputType() string

func (*Field) ConvertDomainTypeToWireType

func (f *Field) ConvertDomainTypeToWireType() string

func (*Field) ConvertWireOutputToArrayOutbound

func (f *Field) ConvertWireOutputToArrayOutbound(receiver string) string

func (*Field) ConvertWireOutputToMapOutbound

func (f *Field) ConvertWireOutputToMapOutbound(receiver string) string

func (*Field) ConvertWireOutputToOutbound

func (f *Field) ConvertWireOutputToOutbound(receiver string) string

func (*Field) DomainType

func (f *Field) DomainType() string

func (*Field) IsBindable

func (f *Field) IsBindable() bool

func (*Field) IsOutboundBitflag

func (f *Field) IsOutboundBitflag() bool

func (*Field) IsPointer

func (f *Field) IsPointer() bool

func (*Field) IsProtobufValue

func (f *Field) IsProtobufValue() bool

func (*Field) IsScalar

func (f *Field) IsScalar() bool

func (*Field) IsValidatable

func (f *Field) IsValidatable() bool

func (*Field) OutboundHide

func (f *Field) OutboundHide() bool

func (*Field) OutboundType

func (f *Field) OutboundType() string

func (*Field) TestingValueBinding

func (f *Field) TestingValueBinding() string

func (*Field) TestingValueCall

func (f *Field) TestingValueCall() string

func (*Field) Validate

func (f *Field) Validate() error

func (*Field) ValidationCall

func (f *Field) ValidationCall() string

func (*Field) ValidationName

func (f *Field) ValidationName(receiver string) string

func (*Field) WireType

func (f *Field) WireType() string

type FieldLocation

type FieldLocation int32
const (
	FieldLocation_Unknown FieldLocation = iota
	FieldLocation_Body
	FieldLocation_Query
	FieldLocation_Path
	FieldLocation_Header
)

func (FieldLocation) String

func (l FieldLocation) String() string

type HttpRule

type HttpRule struct {
	Method   string
	Endpoint string
}

type LoadFieldOptions

type LoadFieldOptions struct {
	IsHTTPService    bool
	ModuleName       string
	Receiver         string
	Field            *protobuf.Field
	Message          *protobuf.Message
	Endpoint         *Endpoint
	MessageConverter *converters.Message
	Settings         *settings.Settings
}

type LoadMessagesOptions

type LoadMessagesOptions struct {
	Settings *settings.Settings
}

type Message

type Message struct {
	Name         string
	DomainName   string
	WireName     string
	OutboundName string
	Type         converters.MessageKind
	Fields       []*Field
	ProtoMessage *protobuf.Message
	// contains filtered or unexported fields
}

func (*Message) ArrayFields

func (m *Message) ArrayFields() []*Field

func (*Message) BindableFields

func (m *Message) BindableFields(templateName string) []*Field

func (*Message) CustomApiCode added in v0.2.0

func (m *Message) CustomApiCode() []*CustomCode

func (*Message) DomainExport

func (m *Message) DomainExport() bool

func (*Message) GetFields

func (m *Message) GetFields(templateName string) []*Field

func (*Message) GetReceiverName

func (m *Message) GetReceiverName() string

func (*Message) HasArrayField

func (m *Message) HasArrayField() bool

func (*Message) HasBitflagField

func (m *Message) HasBitflagField() bool

func (*Message) HasCustomApiCodeExtension added in v0.2.0

func (m *Message) HasCustomApiCodeExtension() bool

func (*Message) HasMapField

func (m *Message) HasMapField() bool

func (*Message) HasValidatableField

func (m *Message) HasValidatableField() bool

func (*Message) IsWireInputKind

func (m *Message) IsWireInputKind() bool

func (*Message) MapFields

func (m *Message) MapFields() []*Field

func (*Message) OutboundExport

func (m *Message) OutboundExport() bool

func (*Message) ValidatableFields

func (m *Message) ValidatableFields() []*Field

func (*Message) ValidationNeedsCustomRuleOptions

func (m *Message) ValidationNeedsCustomRuleOptions() bool

type Method

type Method struct {
	Name                  string
	AdditionalHTTPMethods []HttpRule
	Request               *Message
	PathArguments         []*MethodField
	QueryArguments        []*MethodField
	HeaderArguments       []*MethodField
	// contains filtered or unexported fields
}

func (*Method) AuthModeKey

func (m *Method) AuthModeKey() string

func (*Method) AuthModeValue

func (m *Method) AuthModeValue() string

func (*Method) Endpoint

func (m *Method) Endpoint() string

func (*Method) HTTPMethod

func (m *Method) HTTPMethod() string

func (*Method) HasAuth

func (m *Method) HasAuth() bool

func (*Method) HasHeaderArguments

func (m *Method) HasHeaderArguments() bool

func (*Method) HasQueryArguments

func (m *Method) HasQueryArguments() bool

func (*Method) HasRequiredBody

func (m *Method) HasRequiredBody() bool

func (*Method) Validate

func (m *Method) Validate() error

type MethodField

type MethodField struct {
	GoName    string
	ProtoName string
	CastType  string
}

Jump to

Keyboard shortcuts

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