Documentation
¶
Overview ¶
Package item 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 GetRequest
- type GetResponse
- func (*GetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *GetResponse) GetAssetBundle() map[string]*structpb.Value
- func (x *GetResponse) GetItem() *Item
- func (x *GetResponse) GetParameters() map[string]*structpb.Value
- func (*GetResponse) ProtoMessage()
- func (x *GetResponse) ProtoReflect() protoreflect.Message
- func (x *GetResponse) Reset()
- func (x *GetResponse) String() string
- type Item
- func (*Item) Descriptor() ([]byte, []int)deprecated
- func (x *Item) GetAvailabilitySchedule() []*common.TimeRange
- func (x *Item) GetFlags() uint64
- func (x *Item) GetId() string
- func (x *Item) GetLabels() []string
- func (x *Item) GetName() string
- func (x *Item) GetVersion() uint64
- func (*Item) ProtoMessage()
- func (x *Item) ProtoReflect() protoreflect.Message
- func (x *Item) Reset()
- func (x *Item) String() string
- type ListAvailableRequest
- func (*ListAvailableRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListAvailableRequest) GetPage() *common.Pagination
- func (x *ListAvailableRequest) GetRequestTimestamp() *timestamppb.Timestamp
- func (*ListAvailableRequest) ProtoMessage()
- func (x *ListAvailableRequest) ProtoReflect() protoreflect.Message
- func (x *ListAvailableRequest) Reset()
- func (x *ListAvailableRequest) String() string
- type ListAvailableResponse
- func (*ListAvailableResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListAvailableResponse) GetItems() []*Item
- func (*ListAvailableResponse) ProtoMessage()
- func (x *ListAvailableResponse) ProtoReflect() protoreflect.Message
- func (x *ListAvailableResponse) Reset()
- func (x *ListAvailableResponse) String() string
- type ListRequest
- type ListResponse
- type UnimplementedCatalogServiceServer
- func (UnimplementedCatalogServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
- func (UnimplementedCatalogServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
- func (UnimplementedCatalogServiceServer) ListAvailable(context.Context, *ListAvailableRequest) (*ListAvailableResponse, error)
- func (UnimplementedCatalogServiceServer) UpdateItem(context.Context, *UpdateItemRequest) (*UpdateItemResponse, error)
- type UnsafeCatalogServiceServer
- type UpdateItemRequest
- type UpdateItemResponse
- func (*UpdateItemResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UpdateItemResponse) GetVersion() uint64
- func (*UpdateItemResponse) ProtoMessage()
- func (x *UpdateItemResponse) ProtoReflect() protoreflect.Message
- func (x *UpdateItemResponse) Reset()
- func (x *UpdateItemResponse) String() string
Constants ¶
const ( CatalogService_Get_FullMethodName = "/bricks.v1.item.CatalogService/Get" CatalogService_List_FullMethodName = "/bricks.v1.item.CatalogService/List" CatalogService_ListAvailable_FullMethodName = "/bricks.v1.item.CatalogService/ListAvailable" CatalogService_UpdateItem_FullMethodName = "/bricks.v1.item.CatalogService/UpdateItem" )
Variables ¶
var CatalogService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "bricks.v1.item.CatalogService", HandlerType: (*CatalogServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Get", Handler: _CatalogService_Get_Handler, }, { MethodName: "List", Handler: _CatalogService_List_Handler, }, { MethodName: "ListAvailable", Handler: _CatalogService_ListAvailable_Handler, }, { MethodName: "UpdateItem", Handler: _CatalogService_UpdateItem_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "bricks/v1/item/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_bricks_v1_item_catalog_proto protoreflect.FileDescriptor
Functions ¶
func RegisterCatalogServiceHandler ¶ added in v0.20.0
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 ¶ added in v0.20.0
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. This client ignores the HTTP middlewares.
func RegisterCatalogServiceHandlerFromEndpoint ¶ added in v0.20.0
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 ¶ added in v0.20.0
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. GRPC interceptors will not work for this type of registration. To use interceptors, you must use the "runtime.WithMiddlewares" option in the "runtime.NewServeMux" call.
func RegisterCatalogServiceServer ¶
func RegisterCatalogServiceServer(s grpc.ServiceRegistrar, srv CatalogServiceServer)
Types ¶
type CatalogServiceClient ¶
type CatalogServiceClient interface {
// Get obtains the currently version of a stored Item, including asset bundles and parameters
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
// List obtains all items in the catalog, whether they're available or not.
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
// ListAvailable obtains all items in the store that are available as of the date of the request (or the overridden
// value if the user is permitted to override)
ListAvailable(ctx context.Context, in *ListAvailableRequest, opts ...grpc.CallOption) (*ListAvailableResponse, error)
// UpdateItem attempts to amend the item contents
UpdateItem(ctx context.Context, in *UpdateItemRequest, opts ...grpc.CallOption) (*UpdateItemResponse, 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 {
// Get obtains the currently version of a stored Item, including asset bundles and parameters
Get(context.Context, *GetRequest) (*GetResponse, error)
// List obtains all items in the catalog, whether they're available or not.
List(context.Context, *ListRequest) (*ListResponse, error)
// ListAvailable obtains all items in the store that are available as of the date of the request (or the overridden
// value if the user is permitted to override)
ListAvailable(context.Context, *ListAvailableRequest) (*ListAvailableResponse, error)
// UpdateItem attempts to amend the item contents
UpdateItem(context.Context, *UpdateItemRequest) (*UpdateItemResponse, error)
// contains filtered or unexported methods
}
CatalogServiceServer is the server API for CatalogService service. All implementations must embed UnimplementedCatalogServiceServer for forward compatibility.
type GetRequest ¶
type GetRequest struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// contains filtered or unexported fields
}
func (*GetRequest) Descriptor
deprecated
func (*GetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.
func (*GetRequest) GetId ¶
func (x *GetRequest) GetId() string
func (*GetRequest) ProtoMessage ¶
func (*GetRequest) ProtoMessage()
func (*GetRequest) ProtoReflect ¶
func (x *GetRequest) ProtoReflect() protoreflect.Message
func (*GetRequest) Reset ¶
func (x *GetRequest) Reset()
func (*GetRequest) String ¶
func (x *GetRequest) String() string
type GetResponse ¶
type GetResponse struct {
Item *Item `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
AssetBundle map[string]*structpb.Value `` /* 168-byte string literal not displayed */
Parameters map[string]*structpb.Value `` /* 147-byte string literal not displayed */
// contains filtered or unexported fields
}
func (*GetResponse) Descriptor
deprecated
func (*GetResponse) Descriptor() ([]byte, []int)
Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.
func (*GetResponse) GetAssetBundle ¶
func (x *GetResponse) GetAssetBundle() map[string]*structpb.Value
func (*GetResponse) GetItem ¶
func (x *GetResponse) GetItem() *Item
func (*GetResponse) GetParameters ¶
func (x *GetResponse) GetParameters() map[string]*structpb.Value
func (*GetResponse) ProtoMessage ¶
func (*GetResponse) ProtoMessage()
func (*GetResponse) ProtoReflect ¶
func (x *GetResponse) ProtoReflect() protoreflect.Message
func (*GetResponse) Reset ¶
func (x *GetResponse) Reset()
func (*GetResponse) String ¶
func (x *GetResponse) String() string
type Item ¶
type Item struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Labels []string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty"`
Flags uint64 `protobuf:"fixed64,4,opt,name=flags,proto3" json:"flags,omitempty"`
AvailabilitySchedule []*common.TimeRange `protobuf:"bytes,5,rep,name=availability_schedule,json=availabilitySchedule,proto3" json:"availability_schedule,omitempty"`
Version uint64 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"`
// contains filtered or unexported fields
}
func (*Item) Descriptor
deprecated
func (*Item) GetAvailabilitySchedule ¶
func (*Item) GetVersion ¶
func (*Item) ProtoMessage ¶
func (*Item) ProtoMessage()
func (*Item) ProtoReflect ¶
func (x *Item) ProtoReflect() protoreflect.Message
type ListAvailableRequest ¶
type ListAvailableRequest struct {
// request_timestamp should only be permitted to be sent by certain classes of user (for example, a QA team or
// playtesters). It is intended to allow testing of unreleased items, as it will be used to override the current
// timestamp that would otherwise be used.
RequestTimestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=request_timestamp,json=requestTimestamp,proto3,oneof" json:"request_timestamp,omitempty"`
Page *common.Pagination `protobuf:"bytes,2,opt,name=page,proto3,oneof" json:"page,omitempty"`
// contains filtered or unexported fields
}
func (*ListAvailableRequest) Descriptor
deprecated
func (*ListAvailableRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListAvailableRequest.ProtoReflect.Descriptor instead.
func (*ListAvailableRequest) GetPage ¶
func (x *ListAvailableRequest) GetPage() *common.Pagination
func (*ListAvailableRequest) GetRequestTimestamp ¶
func (x *ListAvailableRequest) GetRequestTimestamp() *timestamppb.Timestamp
func (*ListAvailableRequest) ProtoMessage ¶
func (*ListAvailableRequest) ProtoMessage()
func (*ListAvailableRequest) ProtoReflect ¶
func (x *ListAvailableRequest) ProtoReflect() protoreflect.Message
func (*ListAvailableRequest) Reset ¶
func (x *ListAvailableRequest) Reset()
func (*ListAvailableRequest) String ¶
func (x *ListAvailableRequest) String() string
type ListAvailableResponse ¶
type ListAvailableResponse struct {
Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
// contains filtered or unexported fields
}
func (*ListAvailableResponse) Descriptor
deprecated
func (*ListAvailableResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListAvailableResponse.ProtoReflect.Descriptor instead.
func (*ListAvailableResponse) GetItems ¶
func (x *ListAvailableResponse) GetItems() []*Item
func (*ListAvailableResponse) ProtoMessage ¶
func (*ListAvailableResponse) ProtoMessage()
func (*ListAvailableResponse) ProtoReflect ¶
func (x *ListAvailableResponse) ProtoReflect() protoreflect.Message
func (*ListAvailableResponse) Reset ¶
func (x *ListAvailableResponse) Reset()
func (*ListAvailableResponse) String ¶
func (x *ListAvailableResponse) String() string
type ListRequest ¶
type ListRequest struct {
Page *common.Pagination `protobuf:"bytes,1,opt,name=page,proto3,oneof" json:"page,omitempty"`
// contains filtered or unexported fields
}
func (*ListRequest) Descriptor
deprecated
func (*ListRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.
func (*ListRequest) GetPage ¶
func (x *ListRequest) GetPage() *common.Pagination
func (*ListRequest) ProtoMessage ¶
func (*ListRequest) ProtoMessage()
func (*ListRequest) ProtoReflect ¶
func (x *ListRequest) ProtoReflect() protoreflect.Message
func (*ListRequest) Reset ¶
func (x *ListRequest) Reset()
func (*ListRequest) String ¶
func (x *ListRequest) String() string
type ListResponse ¶
type ListResponse struct {
Items []*Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
// contains filtered or unexported fields
}
func (*ListResponse) Descriptor
deprecated
func (*ListResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.
func (*ListResponse) GetItems ¶
func (x *ListResponse) GetItems() []*Item
func (*ListResponse) ProtoMessage ¶
func (*ListResponse) ProtoMessage()
func (*ListResponse) ProtoReflect ¶
func (x *ListResponse) ProtoReflect() protoreflect.Message
func (*ListResponse) Reset ¶
func (x *ListResponse) Reset()
func (*ListResponse) String ¶
func (x *ListResponse) String() string
type UnimplementedCatalogServiceServer ¶
type UnimplementedCatalogServiceServer struct{}
UnimplementedCatalogServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedCatalogServiceServer) Get ¶
func (UnimplementedCatalogServiceServer) Get(context.Context, *GetRequest) (*GetResponse, error)
func (UnimplementedCatalogServiceServer) List ¶
func (UnimplementedCatalogServiceServer) List(context.Context, *ListRequest) (*ListResponse, error)
func (UnimplementedCatalogServiceServer) ListAvailable ¶
func (UnimplementedCatalogServiceServer) ListAvailable(context.Context, *ListAvailableRequest) (*ListAvailableResponse, error)
func (UnimplementedCatalogServiceServer) UpdateItem ¶
func (UnimplementedCatalogServiceServer) UpdateItem(context.Context, *UpdateItemRequest) (*UpdateItemResponse, 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.
type UpdateItemRequest ¶
type UpdateItemRequest struct {
Item *Item `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateItemRequest) Descriptor
deprecated
func (*UpdateItemRequest) Descriptor() ([]byte, []int)
Deprecated: Use UpdateItemRequest.ProtoReflect.Descriptor instead.
func (*UpdateItemRequest) GetItem ¶
func (x *UpdateItemRequest) GetItem() *Item
func (*UpdateItemRequest) ProtoMessage ¶
func (*UpdateItemRequest) ProtoMessage()
func (*UpdateItemRequest) ProtoReflect ¶
func (x *UpdateItemRequest) ProtoReflect() protoreflect.Message
func (*UpdateItemRequest) Reset ¶
func (x *UpdateItemRequest) Reset()
func (*UpdateItemRequest) String ¶
func (x *UpdateItemRequest) String() string
type UpdateItemResponse ¶
type UpdateItemResponse struct {
Version uint64 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
// contains filtered or unexported fields
}
func (*UpdateItemResponse) Descriptor
deprecated
func (*UpdateItemResponse) Descriptor() ([]byte, []int)
Deprecated: Use UpdateItemResponse.ProtoReflect.Descriptor instead.
func (*UpdateItemResponse) GetVersion ¶
func (x *UpdateItemResponse) GetVersion() uint64
func (*UpdateItemResponse) ProtoMessage ¶
func (*UpdateItemResponse) ProtoMessage()
func (*UpdateItemResponse) ProtoReflect ¶
func (x *UpdateItemResponse) ProtoReflect() protoreflect.Message
func (*UpdateItemResponse) Reset ¶
func (x *UpdateItemResponse) Reset()
func (*UpdateItemResponse) String ¶
func (x *UpdateItemResponse) String() string