todos

package
Version: v0.0.0-...-4d4bbb7 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package todos is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

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

func (*Todo) GetCreateTime

func (m *Todo) GetCreateTime() *timestamp.Timestamp

func (*Todo) GetDescription

func (m *Todo) GetDescription() string

func (*Todo) GetFinished

func (m *Todo) GetFinished() bool

func (*Todo) GetName

func (m *Todo) GetName() string

func (*Todo) GetTitle

func (m *Todo) GetTitle() string

func (*Todo) GetUpdateTime

func (m *Todo) GetUpdateTime() *timestamp.Timestamp

func (*Todo) ProtoMessage

func (*Todo) ProtoMessage()

func (*Todo) Reset

func (m *Todo) Reset()

func (*Todo) String

func (m *Todo) String() string

func (*Todo) XXX_DiscardUnknown

func (m *Todo) XXX_DiscardUnknown()

func (*Todo) XXX_Marshal

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

func (*Todo) XXX_Merge

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

func (*Todo) XXX_Size

func (m *Todo) XXX_Size() int

func (*Todo) XXX_Unmarshal

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

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

func (*TodoList) GetNextPageToken

func (m *TodoList) GetNextPageToken() string

func (*TodoList) GetTodos

func (m *TodoList) GetTodos() []*Todo

func (*TodoList) ProtoMessage

func (*TodoList) ProtoMessage()

func (*TodoList) Reset

func (m *TodoList) Reset()

func (*TodoList) String

func (m *TodoList) String() string

func (*TodoList) XXX_DiscardUnknown

func (m *TodoList) XXX_DiscardUnknown()

func (*TodoList) XXX_Marshal

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

func (*TodoList) XXX_Merge

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

func (*TodoList) XXX_Size

func (m *TodoList) XXX_Size() int

func (*TodoList) XXX_Unmarshal

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

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

func (*UnimplementedTodoServiceServer) GetTodo

func (*UnimplementedTodoServiceServer) ListTodo

func (*UnimplementedTodoServiceServer) UpdateTodo

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

Jump to

Keyboard shortcuts

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