api

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2016 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

View Source
const Version int32 = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

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

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) FromWire

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

func (Feature) String

func (v Feature) String() string

func (Feature) ToWire

func (v Feature) ToWire() (wire.Value, 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"`
}

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) 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) 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) 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"`
}

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) 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) 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)
}

type Service

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

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)
}

type ServiceID

type ServiceID int32

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) FromWire

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

func (SimpleType) String

func (v SimpleType) String() string

func (SimpleType) ToWire

func (v SimpleType) ToWire() (wire.Value, 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) 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) 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) 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)

Directories

Path Synopsis
service

Jump to

Keyboard shortcuts

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