gol

package
v0.0.0-...-f4bcfb3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package gol is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var Methods_name = map[int32]string{
	0: "post",
	1: "get",
	2: "put",
	3: "patch",
}
View Source
var Methods_value = map[string]int32{
	"post":  0,
	"get":   1,
	"put":   2,
	"patch": 3,
}
View Source
var SequenceType_name = map[int32]string{
	0: "parallel",
	1: "sync",
}
View Source
var SequenceType_value = map[string]int32{
	"parallel": 0,
	"sync":     1,
}

Functions

func RegisterGolHandler

func RegisterGolHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterGolHandler registers the http handlers for service Gol to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterGolHandlerClient

func RegisterGolHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GolClient) error

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

func RegisterGolHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GolServer) error

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

func RegisterGolServer(s *grpc.Server, srv GolServer)

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) Descriptor() ([]byte, []int)

func (*Job) GetBody

func (m *Job) GetBody() map[string]*any.Any

func (*Job) GetHeader

func (m *Job) GetHeader() map[string]*any.Any

func (*Job) GetId

func (m *Job) GetId() string

func (*Job) GetMethod

func (m *Job) GetMethod() Methods

func (*Job) GetUnmarshalBody

func (m *Job) GetUnmarshalBody() (map[string]interface{}, error)

func (*Job) GetUnmarshalHeader

func (m *Job) GetUnmarshalHeader() (map[string]string, error)

func (*Job) GetUrl

func (m *Job) GetUrl() string

func (*Job) GetVar

func (m *Job) GetVar() []*Var

func (*Job) ProtoMessage

func (*Job) ProtoMessage()

func (*Job) Reset

func (m *Job) Reset()

func (*Job) String

func (m *Job) String() string

func (*Job) XXX_DiscardUnknown

func (m *Job) XXX_DiscardUnknown()

func (*Job) XXX_Marshal

func (m *Job) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Job) XXX_Merge

func (m *Job) XXX_Merge(src proto.Message)

func (*Job) XXX_Size

func (m *Job) XXX_Size() int

func (*Job) XXX_Unmarshal

func (m *Job) XXX_Unmarshal(b []byte) error

type Methods

type Methods int32
const (
	Methods_post  Methods = 0
	Methods_get   Methods = 1
	Methods_put   Methods = 2
	Methods_patch Methods = 3
)

func (Methods) EnumDescriptor

func (Methods) EnumDescriptor() ([]byte, []int)

func (Methods) String

func (x Methods) String() string

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) Descriptor() ([]byte, []int)

func (*Sequence) GetJobs

func (m *Sequence) GetJobs() []*Job

func (*Sequence) GetType

func (m *Sequence) GetType() SequenceType

func (*Sequence) ProtoMessage

func (*Sequence) ProtoMessage()

func (*Sequence) Reset

func (m *Sequence) Reset()

func (*Sequence) String

func (m *Sequence) String() string

func (*Sequence) XXX_DiscardUnknown

func (m *Sequence) XXX_DiscardUnknown()

func (*Sequence) XXX_Marshal

func (m *Sequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Sequence) XXX_Merge

func (m *Sequence) XXX_Merge(src proto.Message)

func (*Sequence) XXX_Size

func (m *Sequence) XXX_Size() int

func (*Sequence) XXX_Unmarshal

func (m *Sequence) XXX_Unmarshal(b []byte) error

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

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) Descriptor() ([]byte, []int)

func (*Var) GetJPath

func (m *Var) GetJPath() string

func (*Var) GetName

func (m *Var) GetName() string

func (*Var) GetType

func (m *Var) GetType() string

func (*Var) ProtoMessage

func (*Var) ProtoMessage()

func (*Var) Reset

func (m *Var) Reset()

func (*Var) String

func (m *Var) String() string

func (*Var) XXX_DiscardUnknown

func (m *Var) XXX_DiscardUnknown()

func (*Var) XXX_Marshal

func (m *Var) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Var) XXX_Merge

func (m *Var) XXX_Merge(src proto.Message)

func (*Var) XXX_Size

func (m *Var) XXX_Size() int

func (*Var) XXX_Unmarshal

func (m *Var) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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