notesv1

package
v0.0.0-...-e854597 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package notesv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	NotesService_ListNotes_FullMethodName = "/notes.v1.NotesService/ListNotes"
	NotesService_AddNote_FullMethodName   = "/notes.v1.NotesService/AddNote"
	NotesService_EditNote_FullMethodName  = "/notes.v1.NotesService/EditNote"
)

Variables

View Source
var File_notes_v1_notes_proto protoreflect.FileDescriptor
View Source
var NotesService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "notes.v1.NotesService",
	HandlerType: (*NotesServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddNote",
			Handler:    _NotesService_AddNote_Handler,
		},
		{
			MethodName: "EditNote",
			Handler:    _NotesService_EditNote_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListNotes",
			Handler:       _NotesService_ListNotes_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "notes/v1/notes.proto",
}

NotesService_ServiceDesc is the grpc.ServiceDesc for NotesService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterNotesServiceHandler

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

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

func RegisterNotesServiceHandlerClient

func RegisterNotesServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotesServiceClient) error

RegisterNotesServiceHandlerClient registers the http handlers for service NotesService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotesServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotesServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotesServiceClient" to call the correct interceptors.

func RegisterNotesServiceHandlerFromEndpoint

func RegisterNotesServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterNotesServiceHandlerFromEndpoint is same as RegisterNotesServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterNotesServiceHandlerServer

func RegisterNotesServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotesServiceServer) error

RegisterNotesServiceHandlerServer registers the http handlers for service NotesService to "mux". UnaryRPC :call NotesServiceServer 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 RegisterNotesServiceHandlerFromEndpoint instead.

func RegisterNotesServiceServer

func RegisterNotesServiceServer(s grpc.ServiceRegistrar, srv NotesServiceServer)

Types

type AddNoteRequest

type AddNoteRequest struct {
	Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*AddNoteRequest) Descriptor deprecated

func (*AddNoteRequest) Descriptor() ([]byte, []int)

Deprecated: Use AddNoteRequest.ProtoReflect.Descriptor instead.

func (*AddNoteRequest) GetTitle

func (x *AddNoteRequest) GetTitle() string

func (*AddNoteRequest) ProtoMessage

func (*AddNoteRequest) ProtoMessage()

func (*AddNoteRequest) ProtoReflect

func (x *AddNoteRequest) ProtoReflect() protoreflect.Message

func (*AddNoteRequest) Reset

func (x *AddNoteRequest) Reset()

func (*AddNoteRequest) String

func (x *AddNoteRequest) String() string

type AddNoteResponse

type AddNoteResponse struct {
	Note *Note `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"`
	// contains filtered or unexported fields
}

func (*AddNoteResponse) Descriptor deprecated

func (*AddNoteResponse) Descriptor() ([]byte, []int)

Deprecated: Use AddNoteResponse.ProtoReflect.Descriptor instead.

func (*AddNoteResponse) GetNote

func (x *AddNoteResponse) GetNote() *Note

func (*AddNoteResponse) ProtoMessage

func (*AddNoteResponse) ProtoMessage()

func (*AddNoteResponse) ProtoReflect

func (x *AddNoteResponse) ProtoReflect() protoreflect.Message

func (*AddNoteResponse) Reset

func (x *AddNoteResponse) Reset()

func (*AddNoteResponse) String

func (x *AddNoteResponse) String() string

type EditNoteRequest

type EditNoteRequest struct {
	Note *Note `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"`
	// contains filtered or unexported fields
}

func (*EditNoteRequest) Descriptor deprecated

func (*EditNoteRequest) Descriptor() ([]byte, []int)

Deprecated: Use EditNoteRequest.ProtoReflect.Descriptor instead.

func (*EditNoteRequest) GetNote

func (x *EditNoteRequest) GetNote() *Note

func (*EditNoteRequest) ProtoMessage

func (*EditNoteRequest) ProtoMessage()

func (*EditNoteRequest) ProtoReflect

func (x *EditNoteRequest) ProtoReflect() protoreflect.Message

func (*EditNoteRequest) Reset

func (x *EditNoteRequest) Reset()

func (*EditNoteRequest) String

func (x *EditNoteRequest) String() string

type EditNoteResponse

type EditNoteResponse struct {
	Note *Note `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"`
	// contains filtered or unexported fields
}

func (*EditNoteResponse) Descriptor deprecated

func (*EditNoteResponse) Descriptor() ([]byte, []int)

Deprecated: Use EditNoteResponse.ProtoReflect.Descriptor instead.

func (*EditNoteResponse) GetNote

func (x *EditNoteResponse) GetNote() *Note

func (*EditNoteResponse) ProtoMessage

func (*EditNoteResponse) ProtoMessage()

func (*EditNoteResponse) ProtoReflect

func (x *EditNoteResponse) ProtoReflect() protoreflect.Message

func (*EditNoteResponse) Reset

func (x *EditNoteResponse) Reset()

func (*EditNoteResponse) String

func (x *EditNoteResponse) String() string

type ListNotesRequest

type ListNotesRequest struct {
	// contains filtered or unexported fields
}

func (*ListNotesRequest) Descriptor deprecated

func (*ListNotesRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListNotesRequest.ProtoReflect.Descriptor instead.

func (*ListNotesRequest) ProtoMessage

func (*ListNotesRequest) ProtoMessage()

func (*ListNotesRequest) ProtoReflect

func (x *ListNotesRequest) ProtoReflect() protoreflect.Message

func (*ListNotesRequest) Reset

func (x *ListNotesRequest) Reset()

func (*ListNotesRequest) String

func (x *ListNotesRequest) String() string

type ListNotesResponse

type ListNotesResponse struct {
	Note *Note `protobuf:"bytes,1,opt,name=note,proto3" json:"note,omitempty"`
	// contains filtered or unexported fields
}

func (*ListNotesResponse) Descriptor deprecated

func (*ListNotesResponse) Descriptor() ([]byte, []int)

Deprecated: Use ListNotesResponse.ProtoReflect.Descriptor instead.

func (*ListNotesResponse) GetNote

func (x *ListNotesResponse) GetNote() *Note

func (*ListNotesResponse) ProtoMessage

func (*ListNotesResponse) ProtoMessage()

func (*ListNotesResponse) ProtoReflect

func (x *ListNotesResponse) ProtoReflect() protoreflect.Message

func (*ListNotesResponse) Reset

func (x *ListNotesResponse) Reset()

func (*ListNotesResponse) String

func (x *ListNotesResponse) String() string

type Note

type Note struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Title    string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
	Archived bool   `protobuf:"varint,3,opt,name=archived,proto3" json:"archived,omitempty"`
	// contains filtered or unexported fields
}

func (*Note) Descriptor deprecated

func (*Note) Descriptor() ([]byte, []int)

Deprecated: Use Note.ProtoReflect.Descriptor instead.

func (*Note) GetArchived

func (x *Note) GetArchived() bool

func (*Note) GetId

func (x *Note) GetId() string

func (*Note) GetTitle

func (x *Note) GetTitle() string

func (*Note) ProtoMessage

func (*Note) ProtoMessage()

func (*Note) ProtoReflect

func (x *Note) ProtoReflect() protoreflect.Message

func (*Note) Reset

func (x *Note) Reset()

func (*Note) String

func (x *Note) String() string

type NotesServiceClient

type NotesServiceClient interface {
	ListNotes(ctx context.Context, in *ListNotesRequest, opts ...grpc.CallOption) (NotesService_ListNotesClient, error)
	AddNote(ctx context.Context, in *AddNoteRequest, opts ...grpc.CallOption) (*AddNoteResponse, error)
	EditNote(ctx context.Context, in *EditNoteRequest, opts ...grpc.CallOption) (*EditNoteResponse, error)
}

NotesServiceClient is the client API for NotesService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type NotesServiceServer

NotesServiceServer is the server API for NotesService service. All implementations should embed UnimplementedNotesServiceServer for forward compatibility

type NotesService_ListNotesClient

type NotesService_ListNotesClient interface {
	Recv() (*ListNotesResponse, error)
	grpc.ClientStream
}

type NotesService_ListNotesServer

type NotesService_ListNotesServer interface {
	Send(*ListNotesResponse) error
	grpc.ServerStream
}

type UnimplementedNotesServiceServer

type UnimplementedNotesServiceServer struct {
}

UnimplementedNotesServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedNotesServiceServer) AddNote

func (UnimplementedNotesServiceServer) EditNote

func (UnimplementedNotesServiceServer) ListNotes

type UnsafeNotesServiceServer

type UnsafeNotesServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeNotesServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to NotesServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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