Documentation ¶
Overview ¶
Package todos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterTodoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTodoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TodoServiceClient) error
- func RegisterTodoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTodoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TodoServiceServer) error
- func RegisterTodoServiceServer(s *grpc.Server, srv TodoServiceServer)
- type CreateTodoRequest
- func (*CreateTodoRequest) Descriptor() ([]byte, []int)
- func (m *CreateTodoRequest) GetTodo() *Todo
- func (*CreateTodoRequest) ProtoMessage()
- func (m *CreateTodoRequest) Reset()
- func (m *CreateTodoRequest) String() string
- func (m *CreateTodoRequest) XXX_DiscardUnknown()
- func (m *CreateTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateTodoRequest) XXX_Merge(src proto.Message)
- func (m *CreateTodoRequest) XXX_Size() int
- func (m *CreateTodoRequest) XXX_Unmarshal(b []byte) error
- type DeleteTodoRequest
- func (*DeleteTodoRequest) Descriptor() ([]byte, []int)
- func (m *DeleteTodoRequest) GetName() string
- func (*DeleteTodoRequest) ProtoMessage()
- func (m *DeleteTodoRequest) Reset()
- func (m *DeleteTodoRequest) String() string
- func (m *DeleteTodoRequest) XXX_DiscardUnknown()
- func (m *DeleteTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DeleteTodoRequest) XXX_Merge(src proto.Message)
- func (m *DeleteTodoRequest) XXX_Size() int
- func (m *DeleteTodoRequest) XXX_Unmarshal(b []byte) error
- type GetTodoRequest
- func (*GetTodoRequest) Descriptor() ([]byte, []int)
- func (m *GetTodoRequest) GetName() string
- func (*GetTodoRequest) ProtoMessage()
- func (m *GetTodoRequest) Reset()
- func (m *GetTodoRequest) String() string
- func (m *GetTodoRequest) XXX_DiscardUnknown()
- func (m *GetTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetTodoRequest) XXX_Merge(src proto.Message)
- func (m *GetTodoRequest) XXX_Size() int
- func (m *GetTodoRequest) XXX_Unmarshal(b []byte) error
- type ListTodoRequest
- func (*ListTodoRequest) Descriptor() ([]byte, []int)
- func (m *ListTodoRequest) GetPageSize() int32
- func (m *ListTodoRequest) GetPageToken() string
- func (m *ListTodoRequest) GetPublished() bool
- func (*ListTodoRequest) ProtoMessage()
- func (m *ListTodoRequest) Reset()
- func (m *ListTodoRequest) String() string
- func (m *ListTodoRequest) XXX_DiscardUnknown()
- func (m *ListTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListTodoRequest) XXX_Merge(src proto.Message)
- func (m *ListTodoRequest) XXX_Size() int
- func (m *ListTodoRequest) XXX_Unmarshal(b []byte) error
- type Todo
- func (*Todo) Descriptor() ([]byte, []int)
- func (m *Todo) GetCreateTime() *timestamp.Timestamp
- func (m *Todo) GetDescription() string
- func (m *Todo) GetFinished() bool
- func (m *Todo) GetName() string
- func (m *Todo) GetTitle() string
- func (m *Todo) GetUpdateTime() *timestamp.Timestamp
- func (*Todo) ProtoMessage()
- func (m *Todo) Reset()
- func (m *Todo) String() string
- func (m *Todo) XXX_DiscardUnknown()
- func (m *Todo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Todo) XXX_Merge(src proto.Message)
- func (m *Todo) XXX_Size() int
- func (m *Todo) XXX_Unmarshal(b []byte) error
- type TodoList
- func (*TodoList) Descriptor() ([]byte, []int)
- func (m *TodoList) GetNextPageToken() string
- func (m *TodoList) GetTodos() []*Todo
- func (*TodoList) ProtoMessage()
- func (m *TodoList) Reset()
- func (m *TodoList) String() string
- func (m *TodoList) XXX_DiscardUnknown()
- func (m *TodoList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TodoList) XXX_Merge(src proto.Message)
- func (m *TodoList) XXX_Size() int
- func (m *TodoList) XXX_Unmarshal(b []byte) error
- type TodoServiceClient
- type TodoServiceServer
- type UnimplementedTodoServiceServer
- func (*UnimplementedTodoServiceServer) CreateTodo(ctx context.Context, req *CreateTodoRequest) (*Todo, error)
- func (*UnimplementedTodoServiceServer) DeleteTodo(ctx context.Context, req *DeleteTodoRequest) (*empty.Empty, error)
- func (*UnimplementedTodoServiceServer) GetTodo(ctx context.Context, req *GetTodoRequest) (*Todo, error)
- func (*UnimplementedTodoServiceServer) ListTodo(ctx context.Context, req *ListTodoRequest) (*TodoList, error)
- func (*UnimplementedTodoServiceServer) UpdateTodo(ctx context.Context, req *UpdateTodoRequest) (*Todo, error)
- type UpdateTodoRequest
- func (*UpdateTodoRequest) Descriptor() ([]byte, []int)
- func (m *UpdateTodoRequest) GetName() string
- func (m *UpdateTodoRequest) GetTodo() *Todo
- func (*UpdateTodoRequest) ProtoMessage()
- func (m *UpdateTodoRequest) Reset()
- func (m *UpdateTodoRequest) String() string
- func (m *UpdateTodoRequest) XXX_DiscardUnknown()
- func (m *UpdateTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UpdateTodoRequest) XXX_Merge(src proto.Message)
- func (m *UpdateTodoRequest) XXX_Size() int
- func (m *UpdateTodoRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTodoServiceHandler ¶
func RegisterTodoServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTodoServiceHandler registers the http handlers for service TodoService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTodoServiceHandlerClient ¶
func RegisterTodoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TodoServiceClient) error
RegisterTodoServiceHandlerClient registers the http handlers for service TodoService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TodoServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TodoServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TodoServiceClient" to call the correct interceptors.
func RegisterTodoServiceHandlerFromEndpoint ¶
func RegisterTodoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTodoServiceHandlerFromEndpoint is same as RegisterTodoServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTodoServiceHandlerServer ¶
func RegisterTodoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TodoServiceServer) error
RegisterTodoServiceHandlerServer registers the http handlers for service TodoService to "mux". UnaryRPC :call TodoServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterTodoServiceServer ¶
func RegisterTodoServiceServer(s *grpc.Server, srv TodoServiceServer)
Types ¶
type CreateTodoRequest ¶
type CreateTodoRequest struct { Todo *Todo `protobuf:"bytes,1,opt,name=todo,proto3" json:"todo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateTodoRequest) Descriptor ¶
func (*CreateTodoRequest) Descriptor() ([]byte, []int)
func (*CreateTodoRequest) GetTodo ¶
func (m *CreateTodoRequest) GetTodo() *Todo
func (*CreateTodoRequest) ProtoMessage ¶
func (*CreateTodoRequest) ProtoMessage()
func (*CreateTodoRequest) Reset ¶
func (m *CreateTodoRequest) Reset()
func (*CreateTodoRequest) String ¶
func (m *CreateTodoRequest) String() string
func (*CreateTodoRequest) XXX_DiscardUnknown ¶
func (m *CreateTodoRequest) XXX_DiscardUnknown()
func (*CreateTodoRequest) XXX_Marshal ¶
func (m *CreateTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateTodoRequest) XXX_Merge ¶
func (m *CreateTodoRequest) XXX_Merge(src proto.Message)
func (*CreateTodoRequest) XXX_Size ¶
func (m *CreateTodoRequest) XXX_Size() int
func (*CreateTodoRequest) XXX_Unmarshal ¶
func (m *CreateTodoRequest) XXX_Unmarshal(b []byte) error
type DeleteTodoRequest ¶
type DeleteTodoRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteTodoRequest) Descriptor ¶
func (*DeleteTodoRequest) Descriptor() ([]byte, []int)
func (*DeleteTodoRequest) GetName ¶
func (m *DeleteTodoRequest) GetName() string
func (*DeleteTodoRequest) ProtoMessage ¶
func (*DeleteTodoRequest) ProtoMessage()
func (*DeleteTodoRequest) Reset ¶
func (m *DeleteTodoRequest) Reset()
func (*DeleteTodoRequest) String ¶
func (m *DeleteTodoRequest) String() string
func (*DeleteTodoRequest) XXX_DiscardUnknown ¶
func (m *DeleteTodoRequest) XXX_DiscardUnknown()
func (*DeleteTodoRequest) XXX_Marshal ¶
func (m *DeleteTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeleteTodoRequest) XXX_Merge ¶
func (m *DeleteTodoRequest) XXX_Merge(src proto.Message)
func (*DeleteTodoRequest) XXX_Size ¶
func (m *DeleteTodoRequest) XXX_Size() int
func (*DeleteTodoRequest) XXX_Unmarshal ¶
func (m *DeleteTodoRequest) XXX_Unmarshal(b []byte) error
type GetTodoRequest ¶
type GetTodoRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetTodoRequest) Descriptor ¶
func (*GetTodoRequest) Descriptor() ([]byte, []int)
func (*GetTodoRequest) GetName ¶
func (m *GetTodoRequest) GetName() string
func (*GetTodoRequest) ProtoMessage ¶
func (*GetTodoRequest) ProtoMessage()
func (*GetTodoRequest) Reset ¶
func (m *GetTodoRequest) Reset()
func (*GetTodoRequest) String ¶
func (m *GetTodoRequest) String() string
func (*GetTodoRequest) XXX_DiscardUnknown ¶
func (m *GetTodoRequest) XXX_DiscardUnknown()
func (*GetTodoRequest) XXX_Marshal ¶
func (m *GetTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetTodoRequest) XXX_Merge ¶
func (m *GetTodoRequest) XXX_Merge(src proto.Message)
func (*GetTodoRequest) XXX_Size ¶
func (m *GetTodoRequest) XXX_Size() int
func (*GetTodoRequest) XXX_Unmarshal ¶
func (m *GetTodoRequest) XXX_Unmarshal(b []byte) error
type ListTodoRequest ¶
type ListTodoRequest struct { Published bool `protobuf:"varint,1,opt,name=published,proto3" json:"published,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*ListTodoRequest) Descriptor ¶
func (*ListTodoRequest) Descriptor() ([]byte, []int)
func (*ListTodoRequest) GetPageSize ¶
func (m *ListTodoRequest) GetPageSize() int32
func (*ListTodoRequest) GetPageToken ¶
func (m *ListTodoRequest) GetPageToken() string
func (*ListTodoRequest) GetPublished ¶
func (m *ListTodoRequest) GetPublished() bool
func (*ListTodoRequest) ProtoMessage ¶
func (*ListTodoRequest) ProtoMessage()
func (*ListTodoRequest) Reset ¶
func (m *ListTodoRequest) Reset()
func (*ListTodoRequest) String ¶
func (m *ListTodoRequest) String() string
func (*ListTodoRequest) XXX_DiscardUnknown ¶
func (m *ListTodoRequest) XXX_DiscardUnknown()
func (*ListTodoRequest) XXX_Marshal ¶
func (m *ListTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListTodoRequest) XXX_Merge ¶
func (m *ListTodoRequest) XXX_Merge(src proto.Message)
func (*ListTodoRequest) XXX_Size ¶
func (m *ListTodoRequest) XXX_Size() int
func (*ListTodoRequest) XXX_Unmarshal ¶
func (m *ListTodoRequest) XXX_Unmarshal(b []byte) error
type Todo ¶
type Todo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` Finished bool `protobuf:"varint,4,opt,name=finished,proto3" json:"finished,omitempty"` CreateTime *timestamp.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` UpdateTime *timestamp.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Todo) Descriptor ¶
func (*Todo) GetCreateTime ¶
func (*Todo) GetDescription ¶
func (*Todo) GetFinished ¶
func (*Todo) GetUpdateTime ¶
func (*Todo) ProtoMessage ¶
func (*Todo) ProtoMessage()
func (*Todo) XXX_DiscardUnknown ¶
func (m *Todo) XXX_DiscardUnknown()
func (*Todo) XXX_Unmarshal ¶
type TodoList ¶
type TodoList struct { Todos []*Todo `protobuf:"bytes,1,rep,name=todos,proto3" json:"todos,omitempty"` NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*TodoList) Descriptor ¶
func (*TodoList) GetNextPageToken ¶
func (*TodoList) ProtoMessage ¶
func (*TodoList) ProtoMessage()
func (*TodoList) XXX_DiscardUnknown ¶
func (m *TodoList) XXX_DiscardUnknown()
func (*TodoList) XXX_Marshal ¶
func (*TodoList) XXX_Unmarshal ¶
type TodoServiceClient ¶
type TodoServiceClient interface { ListTodo(ctx context.Context, in *ListTodoRequest, opts ...grpc.CallOption) (*TodoList, error) CreateTodo(ctx context.Context, in *CreateTodoRequest, opts ...grpc.CallOption) (*Todo, error) GetTodo(ctx context.Context, in *GetTodoRequest, opts ...grpc.CallOption) (*Todo, error) UpdateTodo(ctx context.Context, in *UpdateTodoRequest, opts ...grpc.CallOption) (*Todo, error) DeleteTodo(ctx context.Context, in *DeleteTodoRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
TodoServiceClient is the client API for TodoService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewTodoServiceClient ¶
func NewTodoServiceClient(cc *grpc.ClientConn) TodoServiceClient
type TodoServiceServer ¶
type TodoServiceServer interface { ListTodo(context.Context, *ListTodoRequest) (*TodoList, error) CreateTodo(context.Context, *CreateTodoRequest) (*Todo, error) GetTodo(context.Context, *GetTodoRequest) (*Todo, error) UpdateTodo(context.Context, *UpdateTodoRequest) (*Todo, error) DeleteTodo(context.Context, *DeleteTodoRequest) (*empty.Empty, error) }
TodoServiceServer is the server API for TodoService service.
type UnimplementedTodoServiceServer ¶
type UnimplementedTodoServiceServer struct { }
UnimplementedTodoServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedTodoServiceServer) CreateTodo ¶
func (*UnimplementedTodoServiceServer) CreateTodo(ctx context.Context, req *CreateTodoRequest) (*Todo, error)
func (*UnimplementedTodoServiceServer) DeleteTodo ¶
func (*UnimplementedTodoServiceServer) DeleteTodo(ctx context.Context, req *DeleteTodoRequest) (*empty.Empty, error)
func (*UnimplementedTodoServiceServer) GetTodo ¶
func (*UnimplementedTodoServiceServer) GetTodo(ctx context.Context, req *GetTodoRequest) (*Todo, error)
func (*UnimplementedTodoServiceServer) ListTodo ¶
func (*UnimplementedTodoServiceServer) ListTodo(ctx context.Context, req *ListTodoRequest) (*TodoList, error)
func (*UnimplementedTodoServiceServer) UpdateTodo ¶
func (*UnimplementedTodoServiceServer) UpdateTodo(ctx context.Context, req *UpdateTodoRequest) (*Todo, error)
type UpdateTodoRequest ¶
type UpdateTodoRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Todo *Todo `protobuf:"bytes,2,opt,name=todo,proto3" json:"todo,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UpdateTodoRequest) Descriptor ¶
func (*UpdateTodoRequest) Descriptor() ([]byte, []int)
func (*UpdateTodoRequest) GetName ¶
func (m *UpdateTodoRequest) GetName() string
func (*UpdateTodoRequest) GetTodo ¶
func (m *UpdateTodoRequest) GetTodo() *Todo
func (*UpdateTodoRequest) ProtoMessage ¶
func (*UpdateTodoRequest) ProtoMessage()
func (*UpdateTodoRequest) Reset ¶
func (m *UpdateTodoRequest) Reset()
func (*UpdateTodoRequest) String ¶
func (m *UpdateTodoRequest) String() string
func (*UpdateTodoRequest) XXX_DiscardUnknown ¶
func (m *UpdateTodoRequest) XXX_DiscardUnknown()
func (*UpdateTodoRequest) XXX_Marshal ¶
func (m *UpdateTodoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UpdateTodoRequest) XXX_Merge ¶
func (m *UpdateTodoRequest) XXX_Merge(src proto.Message)
func (*UpdateTodoRequest) XXX_Size ¶
func (m *UpdateTodoRequest) XXX_Size() int
func (*UpdateTodoRequest) XXX_Unmarshal ¶
func (m *UpdateTodoRequest) XXX_Unmarshal(b []byte) error