Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterFooServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterFooServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FooServiceClient) error
- func RegisterFooServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterFooServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FooServiceServer) error
- func RegisterFooServiceServer(s *grpc.Server, srv FooServiceServer)
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateRequest) GetApiVersion() string
- func (x *CreateRequest) GetFoo() *Foo
- func (*CreateRequest) ProtoMessage()
- func (x *CreateRequest) ProtoReflect() protoreflect.Message
- func (x *CreateRequest) Reset()
- func (x *CreateRequest) String() string
- type CreateResponse
- func (*CreateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CreateResponse) GetApiVersion() string
- func (x *CreateResponse) GetId() int64
- func (*CreateResponse) ProtoMessage()
- func (x *CreateResponse) ProtoReflect() protoreflect.Message
- func (x *CreateResponse) Reset()
- func (x *CreateResponse) String() string
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteRequest) GetApiVersion() string
- func (x *DeleteRequest) GetId() int64
- func (*DeleteRequest) ProtoMessage()
- func (x *DeleteRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteRequest) Reset()
- func (x *DeleteRequest) String() string
- type DeleteResponse
- func (*DeleteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteResponse) GetApiVersion() string
- func (x *DeleteResponse) GetCount() int64
- func (*DeleteResponse) ProtoMessage()
- func (x *DeleteResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteResponse) Reset()
- func (x *DeleteResponse) String() string
- type Foo
- func (*Foo) Descriptor() ([]byte, []int)deprecated
- func (x *Foo) GetDesc() string
- func (x *Foo) GetId() int64
- func (x *Foo) GetSysFields() *SystemFields
- func (x *Foo) GetTitle() string
- func (*Foo) ProtoMessage()
- func (x *Foo) ProtoReflect() protoreflect.Message
- func (x *Foo) Reset()
- func (x *Foo) String() string
- type FooServiceClient
- type FooServiceServer
- type ReadAllRequest
- type ReadAllResponse
- func (*ReadAllResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReadAllResponse) GetApiVersion() string
- func (x *ReadAllResponse) GetFoos() []*Foo
- func (*ReadAllResponse) ProtoMessage()
- func (x *ReadAllResponse) ProtoReflect() protoreflect.Message
- func (x *ReadAllResponse) Reset()
- func (x *ReadAllResponse) String() string
- type ReadRequest
- func (*ReadRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ReadRequest) GetApiVersion() string
- func (x *ReadRequest) GetId() int64
- func (*ReadRequest) ProtoMessage()
- func (x *ReadRequest) ProtoReflect() protoreflect.Message
- func (x *ReadRequest) Reset()
- func (x *ReadRequest) String() string
- type ReadResponse
- func (*ReadResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ReadResponse) GetApiVersion() string
- func (x *ReadResponse) GetFoo() *Foo
- func (*ReadResponse) ProtoMessage()
- func (x *ReadResponse) ProtoReflect() protoreflect.Message
- func (x *ReadResponse) Reset()
- func (x *ReadResponse) String() string
- type SystemFields
- func (*SystemFields) Descriptor() ([]byte, []int)deprecated
- func (x *SystemFields) GetCreatedAt() *timestamp.Timestamp
- func (x *SystemFields) GetCreatedBy() string
- func (x *SystemFields) GetUpdatedAt() *timestamp.Timestamp
- func (x *SystemFields) GetUpdatedBy() string
- func (*SystemFields) ProtoMessage()
- func (x *SystemFields) ProtoReflect() protoreflect.Message
- func (x *SystemFields) Reset()
- func (x *SystemFields) String() string
- type UnimplementedFooServiceServer
- func (*UnimplementedFooServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error)
- func (*UnimplementedFooServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
- func (*UnimplementedFooServiceServer) Read(context.Context, *ReadRequest) (*ReadResponse, error)
- func (*UnimplementedFooServiceServer) ReadAll(context.Context, *ReadAllRequest) (*ReadAllResponse, error)
- func (*UnimplementedFooServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateRequest) GetApiVersion() string
- func (x *UpdateRequest) GetFoo() *Foo
- func (*UpdateRequest) ProtoMessage()
- func (x *UpdateRequest) ProtoReflect() protoreflect.Message
- func (x *UpdateRequest) Reset()
- func (x *UpdateRequest) String() string
- type UpdateResponse
- func (*UpdateResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateResponse) GetApiVersion() string
- func (x *UpdateResponse) GetCount() int64
- func (*UpdateResponse) ProtoMessage()
- func (x *UpdateResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateResponse) Reset()
- func (x *UpdateResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var File_foo_service_proto protoreflect.FileDescriptor
Functions ¶
func RegisterFooServiceHandler ¶
func RegisterFooServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterFooServiceHandler registers the http handlers for service FooService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterFooServiceHandlerClient ¶
func RegisterFooServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client FooServiceClient) error
RegisterFooServiceHandlerClient registers the http handlers for service FooService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "FooServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "FooServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "FooServiceClient" to call the correct interceptors.
func RegisterFooServiceHandlerFromEndpoint ¶
func RegisterFooServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterFooServiceHandlerFromEndpoint is same as RegisterFooServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterFooServiceHandlerServer ¶
func RegisterFooServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server FooServiceServer) error
RegisterFooServiceHandlerServer registers the http handlers for service FooService to "mux". UnaryRPC :call FooServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterFooServiceHandlerFromEndpoint instead.
func RegisterFooServiceServer ¶
func RegisterFooServiceServer(s *grpc.Server, srv FooServiceServer)
Types ¶
type CreateRequest ¶
type CreateRequest struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Foo *Foo `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` // contains filtered or unexported fields }
func (*CreateRequest) Descriptor
deprecated
func (*CreateRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.
func (*CreateRequest) GetApiVersion ¶
func (x *CreateRequest) GetApiVersion() string
func (*CreateRequest) GetFoo ¶
func (x *CreateRequest) GetFoo() *Foo
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) ProtoReflect ¶
func (x *CreateRequest) ProtoReflect() protoreflect.Message
func (*CreateRequest) Reset ¶
func (x *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (x *CreateRequest) String() string
type CreateResponse ¶
type CreateResponse struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateResponse) Descriptor
deprecated
func (*CreateResponse) Descriptor() ([]byte, []int)
Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.
func (*CreateResponse) GetApiVersion ¶
func (x *CreateResponse) GetApiVersion() string
func (*CreateResponse) GetId ¶
func (x *CreateResponse) GetId() int64
func (*CreateResponse) ProtoMessage ¶
func (*CreateResponse) ProtoMessage()
func (*CreateResponse) ProtoReflect ¶
func (x *CreateResponse) ProtoReflect() protoreflect.Message
func (*CreateResponse) Reset ¶
func (x *CreateResponse) Reset()
func (*CreateResponse) String ¶
func (x *CreateResponse) String() string
type DeleteRequest ¶
type DeleteRequest struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*DeleteRequest) Descriptor
deprecated
func (*DeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.
func (*DeleteRequest) GetApiVersion ¶
func (x *DeleteRequest) GetApiVersion() string
func (*DeleteRequest) GetId ¶
func (x *DeleteRequest) GetId() int64
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) ProtoReflect ¶
func (x *DeleteRequest) ProtoReflect() protoreflect.Message
func (*DeleteRequest) Reset ¶
func (x *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (x *DeleteRequest) String() string
type DeleteResponse ¶
type DeleteResponse struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*DeleteResponse) Descriptor
deprecated
func (*DeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.
func (*DeleteResponse) GetApiVersion ¶
func (x *DeleteResponse) GetApiVersion() string
func (*DeleteResponse) GetCount ¶
func (x *DeleteResponse) GetCount() int64
func (*DeleteResponse) ProtoMessage ¶
func (*DeleteResponse) ProtoMessage()
func (*DeleteResponse) ProtoReflect ¶
func (x *DeleteResponse) ProtoReflect() protoreflect.Message
func (*DeleteResponse) Reset ¶
func (x *DeleteResponse) Reset()
func (*DeleteResponse) String ¶
func (x *DeleteResponse) String() string
type Foo ¶
type Foo struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` SysFields *SystemFields `protobuf:"bytes,4,opt,name=sys_fields,json=sysFields,proto3" json:"sys_fields,omitempty"` // contains filtered or unexported fields }
func (*Foo) Descriptor
deprecated
func (*Foo) GetSysFields ¶
func (x *Foo) GetSysFields() *SystemFields
func (*Foo) ProtoMessage ¶
func (*Foo) ProtoMessage()
func (*Foo) ProtoReflect ¶
func (x *Foo) ProtoReflect() protoreflect.Message
type FooServiceClient ¶
type FooServiceClient interface { Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) ReadAll(ctx context.Context, in *ReadAllRequest, opts ...grpc.CallOption) (*ReadAllResponse, error) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) }
FooServiceClient is the client API for FooService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewFooServiceClient ¶
func NewFooServiceClient(cc grpc.ClientConnInterface) FooServiceClient
type FooServiceServer ¶
type FooServiceServer interface { Create(context.Context, *CreateRequest) (*CreateResponse, error) Read(context.Context, *ReadRequest) (*ReadResponse, error) ReadAll(context.Context, *ReadAllRequest) (*ReadAllResponse, error) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) }
FooServiceServer is the server API for FooService service.
type ReadAllRequest ¶
type ReadAllRequest struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` // contains filtered or unexported fields }
func (*ReadAllRequest) Descriptor
deprecated
func (*ReadAllRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadAllRequest.ProtoReflect.Descriptor instead.
func (*ReadAllRequest) GetApiVersion ¶
func (x *ReadAllRequest) GetApiVersion() string
func (*ReadAllRequest) ProtoMessage ¶
func (*ReadAllRequest) ProtoMessage()
func (*ReadAllRequest) ProtoReflect ¶
func (x *ReadAllRequest) ProtoReflect() protoreflect.Message
func (*ReadAllRequest) Reset ¶
func (x *ReadAllRequest) Reset()
func (*ReadAllRequest) String ¶
func (x *ReadAllRequest) String() string
type ReadAllResponse ¶
type ReadAllResponse struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Foos []*Foo `protobuf:"bytes,2,rep,name=foos,proto3" json:"foos,omitempty"` // contains filtered or unexported fields }
func (*ReadAllResponse) Descriptor
deprecated
func (*ReadAllResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadAllResponse.ProtoReflect.Descriptor instead.
func (*ReadAllResponse) GetApiVersion ¶
func (x *ReadAllResponse) GetApiVersion() string
func (*ReadAllResponse) GetFoos ¶
func (x *ReadAllResponse) GetFoos() []*Foo
func (*ReadAllResponse) ProtoMessage ¶
func (*ReadAllResponse) ProtoMessage()
func (*ReadAllResponse) ProtoReflect ¶
func (x *ReadAllResponse) ProtoReflect() protoreflect.Message
func (*ReadAllResponse) Reset ¶
func (x *ReadAllResponse) Reset()
func (*ReadAllResponse) String ¶
func (x *ReadAllResponse) String() string
type ReadRequest ¶
type ReadRequest struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ReadRequest) Descriptor
deprecated
func (*ReadRequest) Descriptor() ([]byte, []int)
Deprecated: Use ReadRequest.ProtoReflect.Descriptor instead.
func (*ReadRequest) GetApiVersion ¶
func (x *ReadRequest) GetApiVersion() string
func (*ReadRequest) GetId ¶
func (x *ReadRequest) GetId() int64
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) ProtoReflect ¶
func (x *ReadRequest) ProtoReflect() protoreflect.Message
func (*ReadRequest) Reset ¶
func (x *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (x *ReadRequest) String() string
type ReadResponse ¶
type ReadResponse struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Foo *Foo `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` // contains filtered or unexported fields }
func (*ReadResponse) Descriptor
deprecated
func (*ReadResponse) Descriptor() ([]byte, []int)
Deprecated: Use ReadResponse.ProtoReflect.Descriptor instead.
func (*ReadResponse) GetApiVersion ¶
func (x *ReadResponse) GetApiVersion() string
func (*ReadResponse) GetFoo ¶
func (x *ReadResponse) GetFoo() *Foo
func (*ReadResponse) ProtoMessage ¶
func (*ReadResponse) ProtoMessage()
func (*ReadResponse) ProtoReflect ¶
func (x *ReadResponse) ProtoReflect() protoreflect.Message
func (*ReadResponse) Reset ¶
func (x *ReadResponse) Reset()
func (*ReadResponse) String ¶
func (x *ReadResponse) String() string
type SystemFields ¶
type SystemFields struct { CreatedBy string `protobuf:"bytes,1,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` UpdatedBy string `protobuf:"bytes,2,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` CreatedAt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` UpdatedAt *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // contains filtered or unexported fields }
func (*SystemFields) Descriptor
deprecated
func (*SystemFields) Descriptor() ([]byte, []int)
Deprecated: Use SystemFields.ProtoReflect.Descriptor instead.
func (*SystemFields) GetCreatedAt ¶
func (x *SystemFields) GetCreatedAt() *timestamp.Timestamp
func (*SystemFields) GetCreatedBy ¶
func (x *SystemFields) GetCreatedBy() string
func (*SystemFields) GetUpdatedAt ¶
func (x *SystemFields) GetUpdatedAt() *timestamp.Timestamp
func (*SystemFields) GetUpdatedBy ¶
func (x *SystemFields) GetUpdatedBy() string
func (*SystemFields) ProtoMessage ¶
func (*SystemFields) ProtoMessage()
func (*SystemFields) ProtoReflect ¶
func (x *SystemFields) ProtoReflect() protoreflect.Message
func (*SystemFields) Reset ¶
func (x *SystemFields) Reset()
func (*SystemFields) String ¶
func (x *SystemFields) String() string
type UnimplementedFooServiceServer ¶
type UnimplementedFooServiceServer struct { }
UnimplementedFooServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedFooServiceServer) Create ¶
func (*UnimplementedFooServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error)
func (*UnimplementedFooServiceServer) Delete ¶
func (*UnimplementedFooServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
func (*UnimplementedFooServiceServer) Read ¶
func (*UnimplementedFooServiceServer) Read(context.Context, *ReadRequest) (*ReadResponse, error)
func (*UnimplementedFooServiceServer) ReadAll ¶
func (*UnimplementedFooServiceServer) ReadAll(context.Context, *ReadAllRequest) (*ReadAllResponse, error)
func (*UnimplementedFooServiceServer) Update ¶
func (*UnimplementedFooServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
type UpdateRequest ¶
type UpdateRequest struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Foo *Foo `protobuf:"bytes,2,opt,name=foo,proto3" json:"foo,omitempty"` // contains filtered or unexported fields }
func (*UpdateRequest) Descriptor
deprecated
func (*UpdateRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateRequest.ProtoReflect.Descriptor instead.
func (*UpdateRequest) GetApiVersion ¶
func (x *UpdateRequest) GetApiVersion() string
func (*UpdateRequest) GetFoo ¶
func (x *UpdateRequest) GetFoo() *Foo
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) ProtoReflect ¶
func (x *UpdateRequest) ProtoReflect() protoreflect.Message
func (*UpdateRequest) Reset ¶
func (x *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (x *UpdateRequest) String() string
type UpdateResponse ¶
type UpdateResponse struct { ApiVersion string `protobuf:"bytes,1,opt,name=api_version,json=apiVersion,proto3" json:"api_version,omitempty"` Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` // contains filtered or unexported fields }
func (*UpdateResponse) Descriptor
deprecated
func (*UpdateResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateResponse.ProtoReflect.Descriptor instead.
func (*UpdateResponse) GetApiVersion ¶
func (x *UpdateResponse) GetApiVersion() string
func (*UpdateResponse) GetCount ¶
func (x *UpdateResponse) GetCount() int64
func (*UpdateResponse) ProtoMessage ¶
func (*UpdateResponse) ProtoMessage()
func (*UpdateResponse) ProtoReflect ¶
func (x *UpdateResponse) ProtoReflect() protoreflect.Message
func (*UpdateResponse) Reset ¶
func (x *UpdateResponse) Reset()
func (*UpdateResponse) String ¶
func (x *UpdateResponse) String() string