Documentation ¶
Overview ¶
Package notes is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- func RegisterNotesHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNotesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotesClient) error
- func RegisterNotesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNotesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotesServer) error
- func RegisterNotesServer(s *grpc.Server, srv NotesServer)
- type CreateRequest
- func (*CreateRequest) Descriptor() ([]byte, []int)
- func (m *CreateRequest) GetDirectory() string
- func (m *CreateRequest) GetId() string
- func (*CreateRequest) ProtoMessage()
- func (m *CreateRequest) Reset()
- func (m *CreateRequest) String() string
- func (m *CreateRequest) XXX_DiscardUnknown()
- func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CreateRequest) XXX_Merge(src proto.Message)
- func (m *CreateRequest) XXX_Size() int
- func (m *CreateRequest) XXX_Unmarshal(b []byte) error
- type DeleteRequest
- func (*DeleteRequest) Descriptor() ([]byte, []int)
- func (m *DeleteRequest) GetDirectory() string
- func (m *DeleteRequest) GetId() string
- func (*DeleteRequest) ProtoMessage()
- func (m *DeleteRequest) Reset()
- func (m *DeleteRequest) String() string
- func (m *DeleteRequest) XXX_DiscardUnknown()
- func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DeleteRequest) XXX_Merge(src proto.Message)
- func (m *DeleteRequest) XXX_Size() int
- func (m *DeleteRequest) XXX_Unmarshal(b []byte) error
- type FileNote
- func (*FileNote) Descriptor() ([]byte, []int)
- func (m *FileNote) GetContent() string
- func (m *FileNote) GetLabels() []string
- func (*FileNote) ProtoMessage()
- func (m *FileNote) Reset()
- func (m *FileNote) String() string
- func (m *FileNote) XXX_DiscardUnknown()
- func (m *FileNote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *FileNote) XXX_Merge(src proto.Message)
- func (m *FileNote) XXX_Size() int
- func (m *FileNote) XXX_Unmarshal(b []byte) error
- type GetDirectoryNotesRequest
- func (*GetDirectoryNotesRequest) Descriptor() ([]byte, []int)
- func (m *GetDirectoryNotesRequest) GetDirectory() string
- func (*GetDirectoryNotesRequest) ProtoMessage()
- func (m *GetDirectoryNotesRequest) Reset()
- func (m *GetDirectoryNotesRequest) String() string
- func (m *GetDirectoryNotesRequest) XXX_DiscardUnknown()
- func (m *GetDirectoryNotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetDirectoryNotesRequest) XXX_Merge(src proto.Message)
- func (m *GetDirectoryNotesRequest) XXX_Size() int
- func (m *GetDirectoryNotesRequest) XXX_Unmarshal(b []byte) error
- type GetDirectoryNotesResponse
- func (*GetDirectoryNotesResponse) Descriptor() ([]byte, []int)
- func (m *GetDirectoryNotesResponse) GetNotes() []string
- func (*GetDirectoryNotesResponse) ProtoMessage()
- func (m *GetDirectoryNotesResponse) Reset()
- func (m *GetDirectoryNotesResponse) String() string
- func (m *GetDirectoryNotesResponse) XXX_DiscardUnknown()
- func (m *GetDirectoryNotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetDirectoryNotesResponse) XXX_Merge(src proto.Message)
- func (m *GetDirectoryNotesResponse) XXX_Size() int
- func (m *GetDirectoryNotesResponse) XXX_Unmarshal(b []byte) error
- type GetNoteRequest
- func (*GetNoteRequest) Descriptor() ([]byte, []int)
- func (m *GetNoteRequest) GetDirectory() string
- func (m *GetNoteRequest) GetId() string
- func (*GetNoteRequest) ProtoMessage()
- func (m *GetNoteRequest) Reset()
- func (m *GetNoteRequest) String() string
- func (m *GetNoteRequest) XXX_DiscardUnknown()
- func (m *GetNoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GetNoteRequest) XXX_Merge(src proto.Message)
- func (m *GetNoteRequest) XXX_Size() int
- func (m *GetNoteRequest) XXX_Unmarshal(b []byte) error
- type Note
- func (*Note) Descriptor() ([]byte, []int)
- func (m *Note) GetContent() string
- func (m *Note) GetDirectory() string
- func (m *Note) GetId() string
- func (m *Note) GetLabels() []string
- func (m *Note) GetOwnerId() string
- func (*Note) ProtoMessage()
- func (m *Note) Reset()
- func (m *Note) String() string
- func (m *Note) XXX_DiscardUnknown()
- func (m *Note) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Note) XXX_Merge(src proto.Message)
- func (m *Note) XXX_Size() int
- func (m *Note) XXX_Unmarshal(b []byte) error
- type NotesClient
- type NotesServer
- type UnimplementedNotesServer
- func (*UnimplementedNotesServer) CreateNote(ctx context.Context, req *CreateRequest) (*empty.Empty, error)
- func (*UnimplementedNotesServer) DeleteNote(ctx context.Context, req *DeleteRequest) (*empty.Empty, error)
- func (*UnimplementedNotesServer) GetDirectoryNotes(ctx context.Context, req *GetDirectoryNotesRequest) (*GetDirectoryNotesResponse, error)
- func (*UnimplementedNotesServer) GetNote(ctx context.Context, req *GetNoteRequest) (*Note, error)
- func (*UnimplementedNotesServer) UpdateNote(ctx context.Context, req *UpdateRequest) (*Note, error)
- type UpdateRequest
- func (*UpdateRequest) Descriptor() ([]byte, []int)
- func (m *UpdateRequest) GetContent() string
- func (m *UpdateRequest) GetDirectory() string
- func (m *UpdateRequest) GetId() string
- func (m *UpdateRequest) GetLabels() []string
- func (*UpdateRequest) ProtoMessage()
- func (m *UpdateRequest) Reset()
- func (m *UpdateRequest) String() string
- func (m *UpdateRequest) XXX_DiscardUnknown()
- func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UpdateRequest) XXX_Merge(src proto.Message)
- func (m *UpdateRequest) XXX_Size() int
- func (m *UpdateRequest) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterNotesHandler ¶
RegisterNotesHandler registers the http handlers for service Notes to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNotesHandlerClient ¶
func RegisterNotesHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotesClient) error
RegisterNotesHandlerClient registers the http handlers for service Notes to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotesClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotesClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotesClient" to call the correct interceptors.
func RegisterNotesHandlerFromEndpoint ¶
func RegisterNotesHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNotesHandlerFromEndpoint is same as RegisterNotesHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNotesHandlerServer ¶
func RegisterNotesHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotesServer) error
RegisterNotesHandlerServer registers the http handlers for service Notes to "mux". UnaryRPC :call NotesServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterNotesServer ¶
func RegisterNotesServer(s *grpc.Server, srv NotesServer)
Types ¶
type CreateRequest ¶
type CreateRequest struct { Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*CreateRequest) Descriptor ¶
func (*CreateRequest) Descriptor() ([]byte, []int)
func (*CreateRequest) GetDirectory ¶
func (m *CreateRequest) GetDirectory() string
func (*CreateRequest) GetId ¶
func (m *CreateRequest) GetId() string
func (*CreateRequest) ProtoMessage ¶
func (*CreateRequest) ProtoMessage()
func (*CreateRequest) Reset ¶
func (m *CreateRequest) Reset()
func (*CreateRequest) String ¶
func (m *CreateRequest) String() string
func (*CreateRequest) XXX_DiscardUnknown ¶
func (m *CreateRequest) XXX_DiscardUnknown()
func (*CreateRequest) XXX_Marshal ¶
func (m *CreateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CreateRequest) XXX_Merge ¶
func (m *CreateRequest) XXX_Merge(src proto.Message)
func (*CreateRequest) XXX_Size ¶
func (m *CreateRequest) XXX_Size() int
func (*CreateRequest) XXX_Unmarshal ¶
func (m *CreateRequest) XXX_Unmarshal(b []byte) error
type DeleteRequest ¶
type DeleteRequest struct { Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*DeleteRequest) Descriptor ¶
func (*DeleteRequest) Descriptor() ([]byte, []int)
func (*DeleteRequest) GetDirectory ¶
func (m *DeleteRequest) GetDirectory() string
func (*DeleteRequest) GetId ¶
func (m *DeleteRequest) GetId() string
func (*DeleteRequest) ProtoMessage ¶
func (*DeleteRequest) ProtoMessage()
func (*DeleteRequest) Reset ¶
func (m *DeleteRequest) Reset()
func (*DeleteRequest) String ¶
func (m *DeleteRequest) String() string
func (*DeleteRequest) XXX_DiscardUnknown ¶
func (m *DeleteRequest) XXX_DiscardUnknown()
func (*DeleteRequest) XXX_Marshal ¶
func (m *DeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DeleteRequest) XXX_Merge ¶
func (m *DeleteRequest) XXX_Merge(src proto.Message)
func (*DeleteRequest) XXX_Size ¶
func (m *DeleteRequest) XXX_Size() int
func (*DeleteRequest) XXX_Unmarshal ¶
func (m *DeleteRequest) XXX_Unmarshal(b []byte) error
type FileNote ¶
type FileNote struct { Labels []string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*FileNote) Descriptor ¶
func (*FileNote) GetContent ¶
func (*FileNote) ProtoMessage ¶
func (*FileNote) ProtoMessage()
func (*FileNote) XXX_DiscardUnknown ¶
func (m *FileNote) XXX_DiscardUnknown()
func (*FileNote) XXX_Marshal ¶
func (*FileNote) XXX_Unmarshal ¶
type GetDirectoryNotesRequest ¶
type GetDirectoryNotesRequest struct { Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetDirectoryNotesRequest) Descriptor ¶
func (*GetDirectoryNotesRequest) Descriptor() ([]byte, []int)
func (*GetDirectoryNotesRequest) GetDirectory ¶
func (m *GetDirectoryNotesRequest) GetDirectory() string
func (*GetDirectoryNotesRequest) ProtoMessage ¶
func (*GetDirectoryNotesRequest) ProtoMessage()
func (*GetDirectoryNotesRequest) Reset ¶
func (m *GetDirectoryNotesRequest) Reset()
func (*GetDirectoryNotesRequest) String ¶
func (m *GetDirectoryNotesRequest) String() string
func (*GetDirectoryNotesRequest) XXX_DiscardUnknown ¶
func (m *GetDirectoryNotesRequest) XXX_DiscardUnknown()
func (*GetDirectoryNotesRequest) XXX_Marshal ¶
func (m *GetDirectoryNotesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetDirectoryNotesRequest) XXX_Merge ¶
func (m *GetDirectoryNotesRequest) XXX_Merge(src proto.Message)
func (*GetDirectoryNotesRequest) XXX_Size ¶
func (m *GetDirectoryNotesRequest) XXX_Size() int
func (*GetDirectoryNotesRequest) XXX_Unmarshal ¶
func (m *GetDirectoryNotesRequest) XXX_Unmarshal(b []byte) error
type GetDirectoryNotesResponse ¶
type GetDirectoryNotesResponse struct { Notes []string `protobuf:"bytes,1,rep,name=notes,proto3" json:"notes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetDirectoryNotesResponse) Descriptor ¶
func (*GetDirectoryNotesResponse) Descriptor() ([]byte, []int)
func (*GetDirectoryNotesResponse) GetNotes ¶
func (m *GetDirectoryNotesResponse) GetNotes() []string
func (*GetDirectoryNotesResponse) ProtoMessage ¶
func (*GetDirectoryNotesResponse) ProtoMessage()
func (*GetDirectoryNotesResponse) Reset ¶
func (m *GetDirectoryNotesResponse) Reset()
func (*GetDirectoryNotesResponse) String ¶
func (m *GetDirectoryNotesResponse) String() string
func (*GetDirectoryNotesResponse) XXX_DiscardUnknown ¶
func (m *GetDirectoryNotesResponse) XXX_DiscardUnknown()
func (*GetDirectoryNotesResponse) XXX_Marshal ¶
func (m *GetDirectoryNotesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetDirectoryNotesResponse) XXX_Merge ¶
func (m *GetDirectoryNotesResponse) XXX_Merge(src proto.Message)
func (*GetDirectoryNotesResponse) XXX_Size ¶
func (m *GetDirectoryNotesResponse) XXX_Size() int
func (*GetDirectoryNotesResponse) XXX_Unmarshal ¶
func (m *GetDirectoryNotesResponse) XXX_Unmarshal(b []byte) error
type GetNoteRequest ¶
type GetNoteRequest struct { Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*GetNoteRequest) Descriptor ¶
func (*GetNoteRequest) Descriptor() ([]byte, []int)
func (*GetNoteRequest) GetDirectory ¶
func (m *GetNoteRequest) GetDirectory() string
func (*GetNoteRequest) GetId ¶
func (m *GetNoteRequest) GetId() string
func (*GetNoteRequest) ProtoMessage ¶
func (*GetNoteRequest) ProtoMessage()
func (*GetNoteRequest) Reset ¶
func (m *GetNoteRequest) Reset()
func (*GetNoteRequest) String ¶
func (m *GetNoteRequest) String() string
func (*GetNoteRequest) XXX_DiscardUnknown ¶
func (m *GetNoteRequest) XXX_DiscardUnknown()
func (*GetNoteRequest) XXX_Marshal ¶
func (m *GetNoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GetNoteRequest) XXX_Merge ¶
func (m *GetNoteRequest) XXX_Merge(src proto.Message)
func (*GetNoteRequest) XXX_Size ¶
func (m *GetNoteRequest) XXX_Size() int
func (*GetNoteRequest) XXX_Unmarshal ¶
func (m *GetNoteRequest) XXX_Unmarshal(b []byte) error
type Note ¶
type Note struct { OwnerId string `protobuf:"bytes,1,opt,name=owner_id,json=ownerId,proto3" json:"owner_id,omitempty"` Directory string `protobuf:"bytes,2,opt,name=directory,proto3" json:"directory,omitempty"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` Labels []string `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Note) Descriptor ¶
func (*Note) GetContent ¶
func (*Note) GetDirectory ¶
func (*Note) GetOwnerId ¶
func (*Note) ProtoMessage ¶
func (*Note) ProtoMessage()
func (*Note) XXX_DiscardUnknown ¶
func (m *Note) XXX_DiscardUnknown()
func (*Note) XXX_Unmarshal ¶
type NotesClient ¶
type NotesClient interface { // Get list of notes in directory // // Returns a list of a user's notes for a specific directory. GetDirectoryNotes(ctx context.Context, in *GetDirectoryNotesRequest, opts ...grpc.CallOption) (*GetDirectoryNotesResponse, error) // Get a single note // // Returns a single note in a particular directory. GetNote(ctx context.Context, in *GetNoteRequest, opts ...grpc.CallOption) (*Note, error) // Create a note // // Creates a note in a particular directory with a specified ID. CreateNote(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*empty.Empty, error) // Update a note's contents // // Updates a note and returns the updated entry. UpdateNote(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*Note, error) // Delete a note // // Deletes a particular note by directory and ID. DeleteNote(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*empty.Empty, error) }
NotesClient is the client API for Notes service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewNotesClient ¶
func NewNotesClient(cc grpc.ClientConnInterface) NotesClient
type NotesServer ¶
type NotesServer interface { // Get list of notes in directory // // Returns a list of a user's notes for a specific directory. GetDirectoryNotes(context.Context, *GetDirectoryNotesRequest) (*GetDirectoryNotesResponse, error) // Get a single note // // Returns a single note in a particular directory. GetNote(context.Context, *GetNoteRequest) (*Note, error) // Create a note // // Creates a note in a particular directory with a specified ID. CreateNote(context.Context, *CreateRequest) (*empty.Empty, error) // Update a note's contents // // Updates a note and returns the updated entry. UpdateNote(context.Context, *UpdateRequest) (*Note, error) // Delete a note // // Deletes a particular note by directory and ID. DeleteNote(context.Context, *DeleteRequest) (*empty.Empty, error) }
NotesServer is the server API for Notes service.
type UnimplementedNotesServer ¶
type UnimplementedNotesServer struct { }
UnimplementedNotesServer can be embedded to have forward compatible implementations.
func (*UnimplementedNotesServer) CreateNote ¶
func (*UnimplementedNotesServer) CreateNote(ctx context.Context, req *CreateRequest) (*empty.Empty, error)
func (*UnimplementedNotesServer) DeleteNote ¶
func (*UnimplementedNotesServer) DeleteNote(ctx context.Context, req *DeleteRequest) (*empty.Empty, error)
func (*UnimplementedNotesServer) GetDirectoryNotes ¶
func (*UnimplementedNotesServer) GetDirectoryNotes(ctx context.Context, req *GetDirectoryNotesRequest) (*GetDirectoryNotesResponse, error)
func (*UnimplementedNotesServer) GetNote ¶
func (*UnimplementedNotesServer) GetNote(ctx context.Context, req *GetNoteRequest) (*Note, error)
func (*UnimplementedNotesServer) UpdateNote ¶
func (*UnimplementedNotesServer) UpdateNote(ctx context.Context, req *UpdateRequest) (*Note, error)
type UpdateRequest ¶
type UpdateRequest struct { Directory string `protobuf:"bytes,1,opt,name=directory,proto3" json:"directory,omitempty"` Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` Labels []string `protobuf:"bytes,4,rep,name=labels,proto3" json:"labels,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*UpdateRequest) Descriptor ¶
func (*UpdateRequest) Descriptor() ([]byte, []int)
func (*UpdateRequest) GetContent ¶
func (m *UpdateRequest) GetContent() string
func (*UpdateRequest) GetDirectory ¶
func (m *UpdateRequest) GetDirectory() string
func (*UpdateRequest) GetId ¶
func (m *UpdateRequest) GetId() string
func (*UpdateRequest) GetLabels ¶
func (m *UpdateRequest) GetLabels() []string
func (*UpdateRequest) ProtoMessage ¶
func (*UpdateRequest) ProtoMessage()
func (*UpdateRequest) Reset ¶
func (m *UpdateRequest) Reset()
func (*UpdateRequest) String ¶
func (m *UpdateRequest) String() string
func (*UpdateRequest) XXX_DiscardUnknown ¶
func (m *UpdateRequest) XXX_DiscardUnknown()
func (*UpdateRequest) XXX_Marshal ¶
func (m *UpdateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UpdateRequest) XXX_Merge ¶
func (m *UpdateRequest) XXX_Merge(src proto.Message)
func (*UpdateRequest) XXX_Size ¶
func (m *UpdateRequest) XXX_Size() int
func (*UpdateRequest) XXX_Unmarshal ¶
func (m *UpdateRequest) XXX_Unmarshal(b []byte) error