api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const APIVersion int32 = 3

Variables

View Source
var Plugin_Goodbye_Helper = struct {
	Args           func() *Plugin_Goodbye_Args
	IsException    func(error) bool
	WrapResponse   func(error) (*Plugin_Goodbye_Result, error)
	UnwrapResponse func(*Plugin_Goodbye_Result) error
}{}
View Source
var Plugin_Handshake_Helper = struct {
	Args           func(request *HandshakeRequest) *Plugin_Handshake_Args
	IsException    func(error) bool
	WrapResponse   func(*HandshakeResponse, error) (*Plugin_Handshake_Result, error)
	UnwrapResponse func(*Plugin_Handshake_Result) (*HandshakeResponse, error)
}{}
View Source
var ServiceGenerator_Generate_Helper = struct {
	Args           func(request *GenerateServiceRequest) *ServiceGenerator_Generate_Args
	IsException    func(error) bool
	WrapResponse   func(*GenerateServiceResponse, error) (*ServiceGenerator_Generate_Result, error)
	UnwrapResponse func(*ServiceGenerator_Generate_Result) (*GenerateServiceResponse, error)
}{}
View Source
var ThriftModule = &thriftreflect.ThriftModule{Name: "api", Package: "go.uber.org/thriftrw/plugin/api", FilePath: "api.thrift", SHA1: "d31dcccbc1fd417d282feaed8f9d07e1d8eb2b8a", Raw: rawIDL}

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name string `json:"name"`
	Type *Type  `json:"type"`
}

func (*Argument) Equals added in v1.2.0

func (v *Argument) Equals(rhs *Argument) bool

func (*Argument) FromWire

func (v *Argument) FromWire(w wire.Value) error

func (*Argument) String

func (v *Argument) String() string

func (*Argument) ToWire

func (v *Argument) ToWire() (wire.Value, error)

type Feature

type Feature int32
const (
	FeatureServiceGenerator Feature = 1
)

func Feature_Values added in v1.3.0

func Feature_Values() []Feature

func (Feature) Equals added in v1.2.0

func (v Feature) Equals(rhs Feature) bool

func (*Feature) FromWire

func (v *Feature) FromWire(w wire.Value) error

func (Feature) MarshalJSON added in v0.5.0

func (v Feature) MarshalJSON() ([]byte, error)

func (Feature) String

func (v Feature) String() string

func (Feature) ToWire

func (v Feature) ToWire() (wire.Value, error)

func (*Feature) UnmarshalJSON added in v0.5.0

func (v *Feature) UnmarshalJSON(text []byte) error

func (*Feature) UnmarshalText added in v1.3.0

func (v *Feature) UnmarshalText(value []byte) error

type Function

type Function struct {
	Name       string      `json:"name"`
	ThriftName string      `json:"thriftName"`
	Arguments  []*Argument `json:"arguments"`
	ReturnType *Type       `json:"returnType,omitempty"`
	Exceptions []*Argument `json:"exceptions"`
	OneWay     *bool       `json:"oneWay,omitempty"`
}

func (*Function) Equals added in v1.2.0

func (v *Function) Equals(rhs *Function) bool

func (*Function) FromWire

func (v *Function) FromWire(w wire.Value) error

func (*Function) String

func (v *Function) String() string

func (*Function) ToWire

func (v *Function) ToWire() (wire.Value, error)

type GenerateServiceRequest

type GenerateServiceRequest struct {
	RootServices []ServiceID            `json:"rootServices"`
	Services     map[ServiceID]*Service `json:"services"`
	Modules      map[ModuleID]*Module   `json:"modules"`
}

func (*GenerateServiceRequest) Equals added in v1.2.0

func (*GenerateServiceRequest) FromWire

func (v *GenerateServiceRequest) FromWire(w wire.Value) error

func (*GenerateServiceRequest) String

func (v *GenerateServiceRequest) String() string

func (*GenerateServiceRequest) ToWire

func (v *GenerateServiceRequest) ToWire() (wire.Value, error)

type GenerateServiceResponse

type GenerateServiceResponse struct {
	Files map[string][]byte `json:"files"`
}

func (*GenerateServiceResponse) Equals added in v1.2.0

func (*GenerateServiceResponse) FromWire

func (v *GenerateServiceResponse) FromWire(w wire.Value) error

func (*GenerateServiceResponse) String

func (v *GenerateServiceResponse) String() string

func (*GenerateServiceResponse) ToWire

func (v *GenerateServiceResponse) ToWire() (wire.Value, error)

type HandshakeRequest

type HandshakeRequest struct{}

func (*HandshakeRequest) Equals added in v1.2.0

func (v *HandshakeRequest) Equals(rhs *HandshakeRequest) bool

func (*HandshakeRequest) FromWire

func (v *HandshakeRequest) FromWire(w wire.Value) error

func (*HandshakeRequest) String

func (v *HandshakeRequest) String() string

func (*HandshakeRequest) ToWire

func (v *HandshakeRequest) ToWire() (wire.Value, error)

type HandshakeResponse

type HandshakeResponse struct {
	Name           string    `json:"name"`
	APIVersion     int32     `json:"apiVersion"`
	Features       []Feature `json:"features"`
	LibraryVersion *string   `json:"libraryVersion,omitempty"`
}

func (*HandshakeResponse) Equals added in v1.2.0

func (v *HandshakeResponse) Equals(rhs *HandshakeResponse) bool

func (*HandshakeResponse) FromWire

func (v *HandshakeResponse) FromWire(w wire.Value) error

func (*HandshakeResponse) String

func (v *HandshakeResponse) String() string

func (*HandshakeResponse) ToWire

func (v *HandshakeResponse) ToWire() (wire.Value, error)

type Module

type Module struct {
	ImportPath string `json:"importPath"`
	Directory  string `json:"directory"`
}

func (*Module) Equals added in v1.2.0

func (v *Module) Equals(rhs *Module) bool

func (*Module) FromWire

func (v *Module) FromWire(w wire.Value) error

func (*Module) String

func (v *Module) String() string

func (*Module) ToWire

func (v *Module) ToWire() (wire.Value, error)

type ModuleID

type ModuleID int32

func (ModuleID) Equals added in v1.2.0

func (lhs ModuleID) Equals(rhs ModuleID) bool

func (*ModuleID) FromWire

func (v *ModuleID) FromWire(w wire.Value) error

func (ModuleID) String

func (v ModuleID) String() string

func (ModuleID) ToWire

func (v ModuleID) ToWire() (wire.Value, error)

type Plugin

type Plugin interface {
	Goodbye() error

	Handshake(
		Request *HandshakeRequest,
	) (*HandshakeResponse, error)
}

func NewPluginClient added in v0.5.0

func NewPluginClient(c envelope.Client) Plugin

NewPluginClient builds a new Plugin client.

type PluginHandler added in v0.5.0

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

PluginHandler serves an implementation of the Plugin service.

func NewPluginHandler added in v0.5.0

func NewPluginHandler(service Plugin) PluginHandler

NewPluginHandler builds a new Plugin handler.

func (PluginHandler) Handle added in v0.5.0

func (h PluginHandler) Handle(name string, reqValue wire.Value) (wire.Value, error)

Handle receives and handles a request for the Plugin service.

type Plugin_Goodbye_Args added in v0.5.0

type Plugin_Goodbye_Args struct{}

func (*Plugin_Goodbye_Args) EnvelopeType added in v0.5.0

func (v *Plugin_Goodbye_Args) EnvelopeType() wire.EnvelopeType

func (*Plugin_Goodbye_Args) Equals added in v1.2.0

func (*Plugin_Goodbye_Args) FromWire added in v0.5.0

func (v *Plugin_Goodbye_Args) FromWire(w wire.Value) error

func (*Plugin_Goodbye_Args) MethodName added in v0.5.0

func (v *Plugin_Goodbye_Args) MethodName() string

func (*Plugin_Goodbye_Args) String added in v0.5.0

func (v *Plugin_Goodbye_Args) String() string

func (*Plugin_Goodbye_Args) ToWire added in v0.5.0

func (v *Plugin_Goodbye_Args) ToWire() (wire.Value, error)

type Plugin_Goodbye_Result added in v0.5.0

type Plugin_Goodbye_Result struct{}

func (*Plugin_Goodbye_Result) EnvelopeType added in v0.5.0

func (v *Plugin_Goodbye_Result) EnvelopeType() wire.EnvelopeType

func (*Plugin_Goodbye_Result) Equals added in v1.2.0

func (*Plugin_Goodbye_Result) FromWire added in v0.5.0

func (v *Plugin_Goodbye_Result) FromWire(w wire.Value) error

func (*Plugin_Goodbye_Result) MethodName added in v0.5.0

func (v *Plugin_Goodbye_Result) MethodName() string

func (*Plugin_Goodbye_Result) String added in v0.5.0

func (v *Plugin_Goodbye_Result) String() string

func (*Plugin_Goodbye_Result) ToWire added in v0.5.0

func (v *Plugin_Goodbye_Result) ToWire() (wire.Value, error)

type Plugin_Handshake_Args added in v0.5.0

type Plugin_Handshake_Args struct {
	Request *HandshakeRequest `json:"request,omitempty"`
}

func (*Plugin_Handshake_Args) EnvelopeType added in v0.5.0

func (v *Plugin_Handshake_Args) EnvelopeType() wire.EnvelopeType

func (*Plugin_Handshake_Args) Equals added in v1.2.0

func (*Plugin_Handshake_Args) FromWire added in v0.5.0

func (v *Plugin_Handshake_Args) FromWire(w wire.Value) error

func (*Plugin_Handshake_Args) MethodName added in v0.5.0

func (v *Plugin_Handshake_Args) MethodName() string

func (*Plugin_Handshake_Args) String added in v0.5.0

func (v *Plugin_Handshake_Args) String() string

func (*Plugin_Handshake_Args) ToWire added in v0.5.0

func (v *Plugin_Handshake_Args) ToWire() (wire.Value, error)

type Plugin_Handshake_Result added in v0.5.0

type Plugin_Handshake_Result struct {
	Success *HandshakeResponse `json:"success,omitempty"`
}

func (*Plugin_Handshake_Result) EnvelopeType added in v0.5.0

func (v *Plugin_Handshake_Result) EnvelopeType() wire.EnvelopeType

func (*Plugin_Handshake_Result) Equals added in v1.2.0

func (*Plugin_Handshake_Result) FromWire added in v0.5.0

func (v *Plugin_Handshake_Result) FromWire(w wire.Value) error

func (*Plugin_Handshake_Result) MethodName added in v0.5.0

func (v *Plugin_Handshake_Result) MethodName() string

func (*Plugin_Handshake_Result) String added in v0.5.0

func (v *Plugin_Handshake_Result) String() string

func (*Plugin_Handshake_Result) ToWire added in v0.5.0

func (v *Plugin_Handshake_Result) ToWire() (wire.Value, error)

type Service

type Service struct {
	Name       string      `json:"name"`
	ThriftName string      `json:"thriftName"`
	ParentID   *ServiceID  `json:"parentID,omitempty"`
	Functions  []*Function `json:"functions"`
	ModuleID   ModuleID    `json:"moduleID"`
}

func (*Service) Equals added in v1.2.0

func (v *Service) Equals(rhs *Service) bool

func (*Service) FromWire

func (v *Service) FromWire(w wire.Value) error

func (*Service) String

func (v *Service) String() string

func (*Service) ToWire

func (v *Service) ToWire() (wire.Value, error)

type ServiceGenerator

type ServiceGenerator interface {
	Generate(
		Request *GenerateServiceRequest,
	) (*GenerateServiceResponse, error)
}

func NewServiceGeneratorClient added in v0.5.0

func NewServiceGeneratorClient(c envelope.Client) ServiceGenerator

NewServiceGeneratorClient builds a new ServiceGenerator client.

type ServiceGeneratorHandler added in v0.5.0

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

ServiceGeneratorHandler serves an implementation of the ServiceGenerator service.

func NewServiceGeneratorHandler added in v0.5.0

func NewServiceGeneratorHandler(service ServiceGenerator) ServiceGeneratorHandler

NewServiceGeneratorHandler builds a new ServiceGenerator handler.

func (ServiceGeneratorHandler) Handle added in v0.5.0

func (h ServiceGeneratorHandler) Handle(name string, reqValue wire.Value) (wire.Value, error)

Handle receives and handles a request for the ServiceGenerator service.

type ServiceGenerator_Generate_Args added in v0.5.0

type ServiceGenerator_Generate_Args struct {
	Request *GenerateServiceRequest `json:"request,omitempty"`
}

func (*ServiceGenerator_Generate_Args) EnvelopeType added in v0.5.0

func (*ServiceGenerator_Generate_Args) Equals added in v1.2.0

func (*ServiceGenerator_Generate_Args) FromWire added in v0.5.0

func (*ServiceGenerator_Generate_Args) MethodName added in v0.5.0

func (v *ServiceGenerator_Generate_Args) MethodName() string

func (*ServiceGenerator_Generate_Args) String added in v0.5.0

func (*ServiceGenerator_Generate_Args) ToWire added in v0.5.0

type ServiceGenerator_Generate_Result added in v0.5.0

type ServiceGenerator_Generate_Result struct {
	Success *GenerateServiceResponse `json:"success,omitempty"`
}

func (*ServiceGenerator_Generate_Result) EnvelopeType added in v0.5.0

func (*ServiceGenerator_Generate_Result) Equals added in v1.2.0

func (*ServiceGenerator_Generate_Result) FromWire added in v0.5.0

func (*ServiceGenerator_Generate_Result) MethodName added in v0.5.0

func (v *ServiceGenerator_Generate_Result) MethodName() string

func (*ServiceGenerator_Generate_Result) String added in v0.5.0

func (*ServiceGenerator_Generate_Result) ToWire added in v0.5.0

type ServiceID

type ServiceID int32

func (ServiceID) Equals added in v1.2.0

func (lhs ServiceID) Equals(rhs ServiceID) bool

func (*ServiceID) FromWire

func (v *ServiceID) FromWire(w wire.Value) error

func (ServiceID) String

func (v ServiceID) String() string

func (ServiceID) ToWire

func (v ServiceID) ToWire() (wire.Value, error)

type SimpleType

type SimpleType int32
const (
	SimpleTypeBool        SimpleType = 1
	SimpleTypeByte        SimpleType = 2
	SimpleTypeInt8        SimpleType = 3
	SimpleTypeInt16       SimpleType = 4
	SimpleTypeInt32       SimpleType = 5
	SimpleTypeInt64       SimpleType = 6
	SimpleTypeFloat64     SimpleType = 7
	SimpleTypeString      SimpleType = 8
	SimpleTypeStructEmpty SimpleType = 9
)

func SimpleType_Values added in v1.3.0

func SimpleType_Values() []SimpleType

func (SimpleType) Equals added in v1.2.0

func (v SimpleType) Equals(rhs SimpleType) bool

func (*SimpleType) FromWire

func (v *SimpleType) FromWire(w wire.Value) error

func (SimpleType) MarshalJSON added in v0.5.0

func (v SimpleType) MarshalJSON() ([]byte, error)

func (SimpleType) String

func (v SimpleType) String() string

func (SimpleType) ToWire

func (v SimpleType) ToWire() (wire.Value, error)

func (*SimpleType) UnmarshalJSON added in v0.5.0

func (v *SimpleType) UnmarshalJSON(text []byte) error

func (*SimpleType) UnmarshalText added in v1.3.0

func (v *SimpleType) UnmarshalText(value []byte) error

type Type

type Type struct {
	SimpleType        *SimpleType    `json:"simpleType,omitempty"`
	SliceType         *Type          `json:"sliceType,omitempty"`
	KeyValueSliceType *TypePair      `json:"keyValueSliceType,omitempty"`
	MapType           *TypePair      `json:"mapType,omitempty"`
	ReferenceType     *TypeReference `json:"referenceType,omitempty"`
	PointerType       *Type          `json:"pointerType,omitempty"`
}

func (*Type) Equals added in v1.2.0

func (v *Type) Equals(rhs *Type) bool

func (*Type) FromWire

func (v *Type) FromWire(w wire.Value) error

func (*Type) String

func (v *Type) String() string

func (*Type) ToWire

func (v *Type) ToWire() (wire.Value, error)

type TypePair

type TypePair struct {
	Left  *Type `json:"left"`
	Right *Type `json:"right"`
}

func (*TypePair) Equals added in v1.2.0

func (v *TypePair) Equals(rhs *TypePair) bool

func (*TypePair) FromWire

func (v *TypePair) FromWire(w wire.Value) error

func (*TypePair) String

func (v *TypePair) String() string

func (*TypePair) ToWire

func (v *TypePair) ToWire() (wire.Value, error)

type TypeReference

type TypeReference struct {
	Name       string `json:"name"`
	ImportPath string `json:"importPath"`
}

func (*TypeReference) Equals added in v1.2.0

func (v *TypeReference) Equals(rhs *TypeReference) bool

func (*TypeReference) FromWire

func (v *TypeReference) FromWire(w wire.Value) error

func (*TypeReference) String

func (v *TypeReference) String() string

func (*TypeReference) ToWire

func (v *TypeReference) ToWire() (wire.Value, error)

Jump to

Keyboard shortcuts

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