Documentation
¶
Overview ¶
Package catalog is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterCatalogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterCatalogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CatalogServiceClient) error
- func RegisterCatalogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterCatalogServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CatalogServiceServer) error
- func RegisterCatalogServiceServer(s grpc.ServiceRegistrar, srv CatalogServiceServer)
- type CatalogServiceClient
- type CatalogServiceServer
- type Course
- func (*Course) Descriptor() ([]byte, []int)deprecated
- func (x *Course) GetCounty() string
- func (x *Course) GetFeatures() *Features
- func (x *Course) GetFullDesc() string
- func (x *Course) GetId() int64
- func (x *Course) GetLive() bool
- func (x *Course) GetName() string
- func (x *Course) GetPostcode() string
- func (x *Course) GetShortDesc() string
- func (x *Course) GetTown() string
- func (*Course) ProtoMessage()
- func (x *Course) ProtoReflect() protoreflect.Message
- func (x *Course) Reset()
- func (x *Course) String() string
- type CourseExistsRequest
- func (*CourseExistsRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CourseExistsRequest) GetCourseId() int64
- func (*CourseExistsRequest) ProtoMessage()
- func (x *CourseExistsRequest) ProtoReflect() protoreflect.Message
- func (x *CourseExistsRequest) Reset()
- func (x *CourseExistsRequest) String() string
- type CourseExistsResponse
- func (*CourseExistsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CourseExistsResponse) GetExists() bool
- func (*CourseExistsResponse) ProtoMessage()
- func (x *CourseExistsResponse) ProtoReflect() protoreflect.Message
- func (x *CourseExistsResponse) Reset()
- func (x *CourseExistsResponse) String() string
- type CreateCourseRequest
- func (*CreateCourseRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateCourseRequest) GetCounty() string
- func (x *CreateCourseRequest) GetFeatures() *Features
- func (x *CreateCourseRequest) GetFullDesc() string
- func (x *CreateCourseRequest) GetName() string
- func (x *CreateCourseRequest) GetPostcode() string
- func (x *CreateCourseRequest) GetShortDesc() string
- func (x *CreateCourseRequest) GetTown() string
- func (*CreateCourseRequest) ProtoMessage()
- func (x *CreateCourseRequest) ProtoReflect() protoreflect.Message
- func (x *CreateCourseRequest) Reset()
- func (x *CreateCourseRequest) String() string
- type Features
- func (*Features) Descriptor() ([]byte, []int)deprecated
- func (x *Features) GetChangingRooms() bool
- func (x *Features) GetGolfCarts() bool
- func (x *Features) GetShower() bool
- func (*Features) ProtoMessage()
- func (x *Features) ProtoReflect() protoreflect.Message
- func (x *Features) Reset()
- func (x *Features) String() string
- type GetCourseRequest
- type GetCoursesRequest
- func (*GetCoursesRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetCoursesRequest) GetLimit() int64
- func (x *GetCoursesRequest) GetOffset() int64
- func (*GetCoursesRequest) ProtoMessage()
- func (x *GetCoursesRequest) ProtoReflect() protoreflect.Message
- func (x *GetCoursesRequest) Reset()
- func (x *GetCoursesRequest) String() string
- type GetCoursesResponse
- func (*GetCoursesResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetCoursesResponse) GetCourses() []*Course
- func (x *GetCoursesResponse) GetLimit() int64
- func (x *GetCoursesResponse) GetOffset() int64
- func (*GetCoursesResponse) ProtoMessage()
- func (x *GetCoursesResponse) ProtoReflect() protoreflect.Message
- func (x *GetCoursesResponse) Reset()
- func (x *GetCoursesResponse) String() string
- type UnimplementedCatalogServiceServer
- func (UnimplementedCatalogServiceServer) CourseExists(context.Context, *CourseExistsRequest) (*CourseExistsResponse, error)
- func (UnimplementedCatalogServiceServer) CreateCourse(context.Context, *CreateCourseRequest) (*Course, error)
- func (UnimplementedCatalogServiceServer) GetCourse(context.Context, *GetCourseRequest) (*Course, error)
- func (UnimplementedCatalogServiceServer) GetCourses(context.Context, *GetCoursesRequest) (*GetCoursesResponse, error)
- type UnsafeCatalogServiceServer
Constants ¶
const ( CatalogService_CourseExists_FullMethodName = "/catalog.CatalogService/CourseExists" CatalogService_GetCourses_FullMethodName = "/catalog.CatalogService/GetCourses" CatalogService_GetCourse_FullMethodName = "/catalog.CatalogService/GetCourse" CatalogService_CreateCourse_FullMethodName = "/catalog.CatalogService/CreateCourse" )
Variables ¶
var CatalogService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "catalog.CatalogService", HandlerType: (*CatalogServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CourseExists", Handler: _CatalogService_CourseExists_Handler, }, { MethodName: "GetCourses", Handler: _CatalogService_GetCourses_Handler, }, { MethodName: "GetCourse", Handler: _CatalogService_GetCourse_Handler, }, { MethodName: "CreateCourse", Handler: _CatalogService_CreateCourse_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "protobufs/catalog/catalog.proto", }
CatalogService_ServiceDesc is the grpc.ServiceDesc for CatalogService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_protobufs_catalog_catalog_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCatalogServiceHandler ¶
func RegisterCatalogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterCatalogServiceHandler registers the http handlers for service CatalogService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterCatalogServiceHandlerClient ¶
func RegisterCatalogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CatalogServiceClient) error
RegisterCatalogServiceHandlerClient registers the http handlers for service CatalogService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CatalogServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CatalogServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "CatalogServiceClient" to call the correct interceptors.
func RegisterCatalogServiceHandlerFromEndpoint ¶
func RegisterCatalogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterCatalogServiceHandlerFromEndpoint is same as RegisterCatalogServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterCatalogServiceHandlerServer ¶
func RegisterCatalogServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CatalogServiceServer) error
RegisterCatalogServiceHandlerServer registers the http handlers for service CatalogService to "mux". UnaryRPC :call CatalogServiceServer 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 RegisterCatalogServiceHandlerFromEndpoint instead.
func RegisterCatalogServiceServer ¶
func RegisterCatalogServiceServer(s grpc.ServiceRegistrar, srv CatalogServiceServer)
Types ¶
type CatalogServiceClient ¶
type CatalogServiceClient interface { CourseExists(ctx context.Context, in *CourseExistsRequest, opts ...grpc.CallOption) (*CourseExistsResponse, error) GetCourses(ctx context.Context, in *GetCoursesRequest, opts ...grpc.CallOption) (*GetCoursesResponse, error) GetCourse(ctx context.Context, in *GetCourseRequest, opts ...grpc.CallOption) (*Course, error) CreateCourse(ctx context.Context, in *CreateCourseRequest, opts ...grpc.CallOption) (*Course, error) }
CatalogServiceClient is the client API for CatalogService 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.
func NewCatalogServiceClient ¶
func NewCatalogServiceClient(cc grpc.ClientConnInterface) CatalogServiceClient
type CatalogServiceServer ¶
type CatalogServiceServer interface { CourseExists(context.Context, *CourseExistsRequest) (*CourseExistsResponse, error) GetCourses(context.Context, *GetCoursesRequest) (*GetCoursesResponse, error) GetCourse(context.Context, *GetCourseRequest) (*Course, error) CreateCourse(context.Context, *CreateCourseRequest) (*Course, error) // contains filtered or unexported methods }
CatalogServiceServer is the server API for CatalogService service. All implementations must embed UnimplementedCatalogServiceServer for forward compatibility
type Course ¶
type Course struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` Features *Features `protobuf:"bytes,7,opt,name=features,proto3" json:"features,omitempty"` Town string `protobuf:"bytes,8,opt,name=town,proto3" json:"town,omitempty"` County string `protobuf:"bytes,9,opt,name=county,proto3" json:"county,omitempty"` Postcode string `protobuf:"bytes,10,opt,name=postcode,proto3" json:"postcode,omitempty"` ShortDesc string `protobuf:"bytes,11,opt,name=short_desc,json=shortDesc,proto3" json:"short_desc,omitempty"` FullDesc string `protobuf:"bytes,12,opt,name=full_desc,json=fullDesc,proto3" json:"full_desc,omitempty"` Live bool `protobuf:"varint,13,opt,name=live,proto3" json:"live,omitempty"` // contains filtered or unexported fields }
func (*Course) Descriptor
deprecated
func (*Course) GetFeatures ¶
func (*Course) GetFullDesc ¶
func (*Course) GetPostcode ¶
func (*Course) GetShortDesc ¶
func (*Course) ProtoMessage ¶
func (*Course) ProtoMessage()
func (*Course) ProtoReflect ¶
func (x *Course) ProtoReflect() protoreflect.Message
type CourseExistsRequest ¶
type CourseExistsRequest struct { CourseId int64 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"` // contains filtered or unexported fields }
func (*CourseExistsRequest) Descriptor
deprecated
func (*CourseExistsRequest) Descriptor() ([]byte, []int)
Deprecated: Use CourseExistsRequest.ProtoReflect.Descriptor instead.
func (*CourseExistsRequest) GetCourseId ¶
func (x *CourseExistsRequest) GetCourseId() int64
func (*CourseExistsRequest) ProtoMessage ¶
func (*CourseExistsRequest) ProtoMessage()
func (*CourseExistsRequest) ProtoReflect ¶
func (x *CourseExistsRequest) ProtoReflect() protoreflect.Message
func (*CourseExistsRequest) Reset ¶
func (x *CourseExistsRequest) Reset()
func (*CourseExistsRequest) String ¶
func (x *CourseExistsRequest) String() string
type CourseExistsResponse ¶
type CourseExistsResponse struct { Exists bool `protobuf:"varint,1,opt,name=exists,proto3" json:"exists,omitempty"` // contains filtered or unexported fields }
func (*CourseExistsResponse) Descriptor
deprecated
func (*CourseExistsResponse) Descriptor() ([]byte, []int)
Deprecated: Use CourseExistsResponse.ProtoReflect.Descriptor instead.
func (*CourseExistsResponse) GetExists ¶
func (x *CourseExistsResponse) GetExists() bool
func (*CourseExistsResponse) ProtoMessage ¶
func (*CourseExistsResponse) ProtoMessage()
func (*CourseExistsResponse) ProtoReflect ¶
func (x *CourseExistsResponse) ProtoReflect() protoreflect.Message
func (*CourseExistsResponse) Reset ¶
func (x *CourseExistsResponse) Reset()
func (*CourseExistsResponse) String ¶
func (x *CourseExistsResponse) String() string
type CreateCourseRequest ¶
type CreateCourseRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Features *Features `protobuf:"bytes,2,opt,name=features,proto3" json:"features,omitempty"` Town string `protobuf:"bytes,3,opt,name=town,proto3" json:"town,omitempty"` County string `protobuf:"bytes,4,opt,name=county,proto3" json:"county,omitempty"` Postcode string `protobuf:"bytes,5,opt,name=postcode,proto3" json:"postcode,omitempty"` ShortDesc string `protobuf:"bytes,6,opt,name=short_desc,json=shortDesc,proto3" json:"short_desc,omitempty"` FullDesc string `protobuf:"bytes,7,opt,name=full_desc,json=fullDesc,proto3" json:"full_desc,omitempty"` // contains filtered or unexported fields }
func (*CreateCourseRequest) Descriptor
deprecated
func (*CreateCourseRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateCourseRequest.ProtoReflect.Descriptor instead.
func (*CreateCourseRequest) GetCounty ¶
func (x *CreateCourseRequest) GetCounty() string
func (*CreateCourseRequest) GetFeatures ¶
func (x *CreateCourseRequest) GetFeatures() *Features
func (*CreateCourseRequest) GetFullDesc ¶
func (x *CreateCourseRequest) GetFullDesc() string
func (*CreateCourseRequest) GetName ¶
func (x *CreateCourseRequest) GetName() string
func (*CreateCourseRequest) GetPostcode ¶
func (x *CreateCourseRequest) GetPostcode() string
func (*CreateCourseRequest) GetShortDesc ¶
func (x *CreateCourseRequest) GetShortDesc() string
func (*CreateCourseRequest) GetTown ¶
func (x *CreateCourseRequest) GetTown() string
func (*CreateCourseRequest) ProtoMessage ¶
func (*CreateCourseRequest) ProtoMessage()
func (*CreateCourseRequest) ProtoReflect ¶
func (x *CreateCourseRequest) ProtoReflect() protoreflect.Message
func (*CreateCourseRequest) Reset ¶
func (x *CreateCourseRequest) Reset()
func (*CreateCourseRequest) String ¶
func (x *CreateCourseRequest) String() string
type Features ¶
type Features struct { GolfCarts bool `protobuf:"varint,1,opt,name=golf_carts,json=golfCarts,proto3" json:"golf_carts,omitempty"` ChangingRooms bool `protobuf:"varint,2,opt,name=changing_rooms,json=changingRooms,proto3" json:"changing_rooms,omitempty"` Shower bool `protobuf:"varint,3,opt,name=shower,proto3" json:"shower,omitempty"` // contains filtered or unexported fields }
func (*Features) Descriptor
deprecated
func (*Features) GetChangingRooms ¶
func (*Features) GetGolfCarts ¶
func (*Features) ProtoMessage ¶
func (*Features) ProtoMessage()
func (*Features) ProtoReflect ¶
func (x *Features) ProtoReflect() protoreflect.Message
type GetCourseRequest ¶
type GetCourseRequest struct { CourseId int64 `protobuf:"varint,1,opt,name=course_id,json=courseId,proto3" json:"course_id,omitempty"` // contains filtered or unexported fields }
func (*GetCourseRequest) Descriptor
deprecated
func (*GetCourseRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCourseRequest.ProtoReflect.Descriptor instead.
func (*GetCourseRequest) GetCourseId ¶
func (x *GetCourseRequest) GetCourseId() int64
func (*GetCourseRequest) ProtoMessage ¶
func (*GetCourseRequest) ProtoMessage()
func (*GetCourseRequest) ProtoReflect ¶
func (x *GetCourseRequest) ProtoReflect() protoreflect.Message
func (*GetCourseRequest) Reset ¶
func (x *GetCourseRequest) Reset()
func (*GetCourseRequest) String ¶
func (x *GetCourseRequest) String() string
type GetCoursesRequest ¶
type GetCoursesRequest struct { Limit int64 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*GetCoursesRequest) Descriptor
deprecated
func (*GetCoursesRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetCoursesRequest.ProtoReflect.Descriptor instead.
func (*GetCoursesRequest) GetLimit ¶
func (x *GetCoursesRequest) GetLimit() int64
func (*GetCoursesRequest) GetOffset ¶
func (x *GetCoursesRequest) GetOffset() int64
func (*GetCoursesRequest) ProtoMessage ¶
func (*GetCoursesRequest) ProtoMessage()
func (*GetCoursesRequest) ProtoReflect ¶
func (x *GetCoursesRequest) ProtoReflect() protoreflect.Message
func (*GetCoursesRequest) Reset ¶
func (x *GetCoursesRequest) Reset()
func (*GetCoursesRequest) String ¶
func (x *GetCoursesRequest) String() string
type GetCoursesResponse ¶
type GetCoursesResponse struct { Courses []*Course `protobuf:"bytes,1,rep,name=courses,proto3" json:"courses,omitempty"` Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"` Offset int64 `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"` // contains filtered or unexported fields }
func (*GetCoursesResponse) Descriptor
deprecated
func (*GetCoursesResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetCoursesResponse.ProtoReflect.Descriptor instead.
func (*GetCoursesResponse) GetCourses ¶
func (x *GetCoursesResponse) GetCourses() []*Course
func (*GetCoursesResponse) GetLimit ¶
func (x *GetCoursesResponse) GetLimit() int64
func (*GetCoursesResponse) GetOffset ¶
func (x *GetCoursesResponse) GetOffset() int64
func (*GetCoursesResponse) ProtoMessage ¶
func (*GetCoursesResponse) ProtoMessage()
func (*GetCoursesResponse) ProtoReflect ¶
func (x *GetCoursesResponse) ProtoReflect() protoreflect.Message
func (*GetCoursesResponse) Reset ¶
func (x *GetCoursesResponse) Reset()
func (*GetCoursesResponse) String ¶
func (x *GetCoursesResponse) String() string
type UnimplementedCatalogServiceServer ¶
type UnimplementedCatalogServiceServer struct { }
UnimplementedCatalogServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedCatalogServiceServer) CourseExists ¶
func (UnimplementedCatalogServiceServer) CourseExists(context.Context, *CourseExistsRequest) (*CourseExistsResponse, error)
func (UnimplementedCatalogServiceServer) CreateCourse ¶
func (UnimplementedCatalogServiceServer) CreateCourse(context.Context, *CreateCourseRequest) (*Course, error)
func (UnimplementedCatalogServiceServer) GetCourse ¶
func (UnimplementedCatalogServiceServer) GetCourse(context.Context, *GetCourseRequest) (*Course, error)
func (UnimplementedCatalogServiceServer) GetCourses ¶
func (UnimplementedCatalogServiceServer) GetCourses(context.Context, *GetCoursesRequest) (*GetCoursesResponse, error)
type UnsafeCatalogServiceServer ¶
type UnsafeCatalogServiceServer interface {
// contains filtered or unexported methods
}
UnsafeCatalogServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CatalogServiceServer will result in compilation errors.