Documentation
¶
Overview ¶
Package gol is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterGolHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterGolHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GolClient) error
- func RegisterGolHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterGolHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GolServer) error
- func RegisterGolServer(s *grpc.Server, srv GolServer)
- type ExecuteRequest
- func (*ExecuteRequest) Descriptor() ([]byte, []int)
- func (m *ExecuteRequest) GetSequence() []*Sequence
- func (*ExecuteRequest) ProtoMessage()
- func (m *ExecuteRequest) Reset()
- func (m *ExecuteRequest) String() string
- func (m *ExecuteRequest) XXX_DiscardUnknown()
- func (m *ExecuteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExecuteRequest) XXX_Merge(src proto.Message)
- func (m *ExecuteRequest) XXX_Size() int
- func (m *ExecuteRequest) XXX_Unmarshal(b []byte) error
- type ExecuteResponse
- func (*ExecuteResponse) Descriptor() ([]byte, []int)
- func (m *ExecuteResponse) GetJobs() map[string]string
- func (*ExecuteResponse) ProtoMessage()
- func (m *ExecuteResponse) Reset()
- func (m *ExecuteResponse) String() string
- func (m *ExecuteResponse) XXX_DiscardUnknown()
- func (m *ExecuteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExecuteResponse) XXX_Merge(src proto.Message)
- func (m *ExecuteResponse) XXX_Size() int
- func (m *ExecuteResponse) XXX_Unmarshal(b []byte) error
- type GolClient
- type GolServer
- type Job
- func (*Job) Descriptor() ([]byte, []int)
- func (m *Job) GetBody() map[string]*any.Any
- func (m *Job) GetHeader() map[string]*any.Any
- func (m *Job) GetId() string
- func (m *Job) GetMethod() Methods
- func (m *Job) GetUnmarshalBody() (map[string]interface{}, error)
- func (m *Job) GetUnmarshalHeader() (map[string]string, error)
- func (m *Job) GetUrl() string
- func (m *Job) GetVar() []*Var
- func (*Job) ProtoMessage()
- func (m *Job) Reset()
- func (m *Job) String() string
- func (m *Job) XXX_DiscardUnknown()
- func (m *Job) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Job) XXX_Merge(src proto.Message)
- func (m *Job) XXX_Size() int
- func (m *Job) XXX_Unmarshal(b []byte) error
- type Methods
- type Sequence
- func (*Sequence) Descriptor() ([]byte, []int)
- func (m *Sequence) GetJobs() []*Job
- func (m *Sequence) GetType() SequenceType
- func (*Sequence) ProtoMessage()
- func (m *Sequence) Reset()
- func (m *Sequence) String() string
- func (m *Sequence) XXX_DiscardUnknown()
- func (m *Sequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Sequence) XXX_Merge(src proto.Message)
- func (m *Sequence) XXX_Size() int
- func (m *Sequence) XXX_Unmarshal(b []byte) error
- type SequenceType
- type UnimplementedGolServer
- type Var
- func (*Var) Descriptor() ([]byte, []int)
- func (m *Var) GetJPath() string
- func (m *Var) GetName() string
- func (m *Var) GetType() string
- func (*Var) ProtoMessage()
- func (m *Var) Reset()
- func (m *Var) String() string
- func (m *Var) XXX_DiscardUnknown()
- func (m *Var) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Var) XXX_Merge(src proto.Message)
- func (m *Var) XXX_Size() int
- func (m *Var) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var Methods_name = map[int32]string{
0: "post",
1: "get",
2: "put",
3: "patch",
}
var Methods_value = map[string]int32{
"post": 0,
"get": 1,
"put": 2,
"patch": 3,
}
var SequenceType_name = map[int32]string{
0: "parallel",
1: "sync",
}
var SequenceType_value = map[string]int32{
"parallel": 0,
"sync": 1,
}
Functions ¶
func RegisterGolHandler ¶
RegisterGolHandler registers the http handlers for service Gol to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterGolHandlerClient ¶
RegisterGolHandlerClient registers the http handlers for service Gol to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GolClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GolClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GolClient" to call the correct interceptors.
func RegisterGolHandlerFromEndpoint ¶
func RegisterGolHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterGolHandlerFromEndpoint is same as RegisterGolHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterGolHandlerServer ¶
RegisterGolHandlerServer registers the http handlers for service Gol to "mux". UnaryRPC :call GolServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterGolServer ¶
Types ¶
type ExecuteRequest ¶
type ExecuteRequest struct { Sequence []*Sequence `protobuf:"bytes,1,rep,name=sequence,proto3" json:"sequence,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ExecuteRequest) Descriptor ¶
func (*ExecuteRequest) Descriptor() ([]byte, []int)
func (*ExecuteRequest) GetSequence ¶
func (m *ExecuteRequest) GetSequence() []*Sequence
func (*ExecuteRequest) ProtoMessage ¶
func (*ExecuteRequest) ProtoMessage()
func (*ExecuteRequest) Reset ¶
func (m *ExecuteRequest) Reset()
func (*ExecuteRequest) String ¶
func (m *ExecuteRequest) String() string
func (*ExecuteRequest) XXX_DiscardUnknown ¶
func (m *ExecuteRequest) XXX_DiscardUnknown()
func (*ExecuteRequest) XXX_Marshal ¶
func (m *ExecuteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExecuteRequest) XXX_Merge ¶
func (m *ExecuteRequest) XXX_Merge(src proto.Message)
func (*ExecuteRequest) XXX_Size ¶
func (m *ExecuteRequest) XXX_Size() int
func (*ExecuteRequest) XXX_Unmarshal ¶
func (m *ExecuteRequest) XXX_Unmarshal(b []byte) error
type ExecuteResponse ¶
type ExecuteResponse struct { Jobs map[string]string `` /* 149-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ExecuteResponse) Descriptor ¶
func (*ExecuteResponse) Descriptor() ([]byte, []int)
func (*ExecuteResponse) GetJobs ¶
func (m *ExecuteResponse) GetJobs() map[string]string
func (*ExecuteResponse) ProtoMessage ¶
func (*ExecuteResponse) ProtoMessage()
func (*ExecuteResponse) Reset ¶
func (m *ExecuteResponse) Reset()
func (*ExecuteResponse) String ¶
func (m *ExecuteResponse) String() string
func (*ExecuteResponse) XXX_DiscardUnknown ¶
func (m *ExecuteResponse) XXX_DiscardUnknown()
func (*ExecuteResponse) XXX_Marshal ¶
func (m *ExecuteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExecuteResponse) XXX_Merge ¶
func (m *ExecuteResponse) XXX_Merge(src proto.Message)
func (*ExecuteResponse) XXX_Size ¶
func (m *ExecuteResponse) XXX_Size() int
func (*ExecuteResponse) XXX_Unmarshal ¶
func (m *ExecuteResponse) XXX_Unmarshal(b []byte) error
type GolClient ¶
type GolClient interface {
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
}
GolClient is the client API for Gol service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewGolClient ¶
func NewGolClient(cc grpc.ClientConnInterface) GolClient
type GolServer ¶
type GolServer interface {
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
}
GolServer is the server API for Gol service.
type Job ¶
type Job struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` Method Methods `protobuf:"varint,3,opt,name=method,proto3,enum=gol.Methods" json:"method,omitempty"` Body map[string]*any.Any `` /* 149-byte string literal not displayed */ Header map[string]*any.Any `` /* 153-byte string literal not displayed */ Var []*Var `protobuf:"bytes,6,rep,name=var,proto3" json:"var,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Job) Descriptor ¶
func (*Job) GetUnmarshalBody ¶
func (*Job) ProtoMessage ¶
func (*Job) ProtoMessage()
func (*Job) XXX_DiscardUnknown ¶
func (m *Job) XXX_DiscardUnknown()
func (*Job) XXX_Unmarshal ¶
type Sequence ¶
type Sequence struct { Type SequenceType `protobuf:"varint,1,opt,name=type,proto3,enum=gol.SequenceType" json:"type,omitempty"` Jobs []*Job `protobuf:"bytes,2,rep,name=jobs,proto3" json:"jobs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Sequence) Descriptor ¶
func (*Sequence) GetType ¶
func (m *Sequence) GetType() SequenceType
func (*Sequence) ProtoMessage ¶
func (*Sequence) ProtoMessage()
func (*Sequence) XXX_DiscardUnknown ¶
func (m *Sequence) XXX_DiscardUnknown()
func (*Sequence) XXX_Marshal ¶
func (*Sequence) XXX_Unmarshal ¶
type SequenceType ¶
type SequenceType int32
const ( SequenceType_parallel SequenceType = 0 SequenceType_sync SequenceType = 1 )
func (SequenceType) EnumDescriptor ¶
func (SequenceType) EnumDescriptor() ([]byte, []int)
func (SequenceType) String ¶
func (x SequenceType) String() string
type UnimplementedGolServer ¶
type UnimplementedGolServer struct { }
UnimplementedGolServer can be embedded to have forward compatible implementations.
func (*UnimplementedGolServer) Execute ¶
func (*UnimplementedGolServer) Execute(ctx context.Context, req *ExecuteRequest) (*ExecuteResponse, error)
type Var ¶
type Var struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` JPath string `protobuf:"bytes,3,opt,name=jPath,proto3" json:"jPath,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Var) Descriptor ¶
func (*Var) ProtoMessage ¶
func (*Var) ProtoMessage()
func (*Var) XXX_DiscardUnknown ¶
func (m *Var) XXX_DiscardUnknown()