Documentation
¶
Overview ¶
Package widgets is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterWidgetsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterWidgetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WidgetsClient) error
- func RegisterWidgetsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterWidgetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WidgetsServer) error
- func RegisterWidgetsServer(s grpc.ServiceRegistrar, srv WidgetsServer)
- type DescribeWidgetRequest
- func (*DescribeWidgetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeWidgetRequest) GetName() string
- func (*DescribeWidgetRequest) ProtoMessage()
- func (x *DescribeWidgetRequest) ProtoReflect() protoreflect.Message
- func (x *DescribeWidgetRequest) Reset()
- func (x *DescribeWidgetRequest) String() string
- type DescribeWidgetResponse
- func (*DescribeWidgetResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DescribeWidgetResponse) GetWidget() *Widget
- func (*DescribeWidgetResponse) ProtoMessage()
- func (x *DescribeWidgetResponse) ProtoReflect() protoreflect.Message
- func (x *DescribeWidgetResponse) Reset()
- func (x *DescribeWidgetResponse) String() string
- type ListWidgetsRequest
- type ListWidgetsResponse
- func (*ListWidgetsResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListWidgetsResponse) GetWidgets() []*Widget
- func (*ListWidgetsResponse) ProtoMessage()
- func (x *ListWidgetsResponse) ProtoReflect() protoreflect.Message
- func (x *ListWidgetsResponse) Reset()
- func (x *ListWidgetsResponse) String() string
- type UnimplementedWidgetsServer
- type UnsafeWidgetsServer
- type Widget
- func (*Widget) Descriptor() ([]byte, []int)deprecated
- func (x *Widget) GetColor() string
- func (x *Widget) GetConfiguration() []*configuration.Field
- func (x *Widget) GetDescription() string
- func (x *Widget) GetIcon() string
- func (x *Widget) GetLabel() string
- func (x *Widget) GetName() string
- func (*Widget) ProtoMessage()
- func (x *Widget) ProtoReflect() protoreflect.Message
- func (x *Widget) Reset()
- func (x *Widget) String() string
- type WidgetsClient
- type WidgetsServer
Constants ¶
const ( Widgets_ListWidgets_FullMethodName = "/Superplane.Widgets.Widgets/ListWidgets" Widgets_DescribeWidget_FullMethodName = "/Superplane.Widgets.Widgets/DescribeWidget" )
Variables ¶
var File_widgets_proto protoreflect.FileDescriptor
var Widgets_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Superplane.Widgets.Widgets", HandlerType: (*WidgetsServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ListWidgets", Handler: _Widgets_ListWidgets_Handler, }, { MethodName: "DescribeWidget", Handler: _Widgets_DescribeWidget_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "widgets.proto", }
Widgets_ServiceDesc is the grpc.ServiceDesc for Widgets service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWidgetsHandler ¶
func RegisterWidgetsHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterWidgetsHandler registers the http handlers for service Widgets to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterWidgetsHandlerClient ¶
func RegisterWidgetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WidgetsClient) error
RegisterWidgetsHandlerClient registers the http handlers for service Widgets to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WidgetsClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WidgetsClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "WidgetsClient" to call the correct interceptors. This client ignores the HTTP middlewares.
func RegisterWidgetsHandlerFromEndpoint ¶
func RegisterWidgetsHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterWidgetsHandlerFromEndpoint is same as RegisterWidgetsHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWidgetsHandlerServer ¶
func RegisterWidgetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WidgetsServer) error
RegisterWidgetsHandlerServer registers the http handlers for service Widgets to "mux". UnaryRPC :call WidgetsServer 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 RegisterWidgetsHandlerFromEndpoint 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 RegisterWidgetsServer ¶
func RegisterWidgetsServer(s grpc.ServiceRegistrar, srv WidgetsServer)
Types ¶
type DescribeWidgetRequest ¶
type DescribeWidgetRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// contains filtered or unexported fields
}
func (*DescribeWidgetRequest) Descriptor
deprecated
func (*DescribeWidgetRequest) Descriptor() ([]byte, []int)
Deprecated: Use DescribeWidgetRequest.ProtoReflect.Descriptor instead.
func (*DescribeWidgetRequest) GetName ¶
func (x *DescribeWidgetRequest) GetName() string
func (*DescribeWidgetRequest) ProtoMessage ¶
func (*DescribeWidgetRequest) ProtoMessage()
func (*DescribeWidgetRequest) ProtoReflect ¶
func (x *DescribeWidgetRequest) ProtoReflect() protoreflect.Message
func (*DescribeWidgetRequest) Reset ¶
func (x *DescribeWidgetRequest) Reset()
func (*DescribeWidgetRequest) String ¶
func (x *DescribeWidgetRequest) String() string
type DescribeWidgetResponse ¶
type DescribeWidgetResponse struct {
Widget *Widget `protobuf:"bytes,1,opt,name=widget,proto3" json:"widget,omitempty"`
// contains filtered or unexported fields
}
func (*DescribeWidgetResponse) Descriptor
deprecated
func (*DescribeWidgetResponse) Descriptor() ([]byte, []int)
Deprecated: Use DescribeWidgetResponse.ProtoReflect.Descriptor instead.
func (*DescribeWidgetResponse) GetWidget ¶
func (x *DescribeWidgetResponse) GetWidget() *Widget
func (*DescribeWidgetResponse) ProtoMessage ¶
func (*DescribeWidgetResponse) ProtoMessage()
func (*DescribeWidgetResponse) ProtoReflect ¶
func (x *DescribeWidgetResponse) ProtoReflect() protoreflect.Message
func (*DescribeWidgetResponse) Reset ¶
func (x *DescribeWidgetResponse) Reset()
func (*DescribeWidgetResponse) String ¶
func (x *DescribeWidgetResponse) String() string
type ListWidgetsRequest ¶
type ListWidgetsRequest struct {
// contains filtered or unexported fields
}
func (*ListWidgetsRequest) Descriptor
deprecated
func (*ListWidgetsRequest) Descriptor() ([]byte, []int)
Deprecated: Use ListWidgetsRequest.ProtoReflect.Descriptor instead.
func (*ListWidgetsRequest) ProtoMessage ¶
func (*ListWidgetsRequest) ProtoMessage()
func (*ListWidgetsRequest) ProtoReflect ¶
func (x *ListWidgetsRequest) ProtoReflect() protoreflect.Message
func (*ListWidgetsRequest) Reset ¶
func (x *ListWidgetsRequest) Reset()
func (*ListWidgetsRequest) String ¶
func (x *ListWidgetsRequest) String() string
type ListWidgetsResponse ¶
type ListWidgetsResponse struct {
Widgets []*Widget `protobuf:"bytes,1,rep,name=widgets,proto3" json:"widgets,omitempty"`
// contains filtered or unexported fields
}
func (*ListWidgetsResponse) Descriptor
deprecated
func (*ListWidgetsResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListWidgetsResponse.ProtoReflect.Descriptor instead.
func (*ListWidgetsResponse) GetWidgets ¶
func (x *ListWidgetsResponse) GetWidgets() []*Widget
func (*ListWidgetsResponse) ProtoMessage ¶
func (*ListWidgetsResponse) ProtoMessage()
func (*ListWidgetsResponse) ProtoReflect ¶
func (x *ListWidgetsResponse) ProtoReflect() protoreflect.Message
func (*ListWidgetsResponse) Reset ¶
func (x *ListWidgetsResponse) Reset()
func (*ListWidgetsResponse) String ¶
func (x *ListWidgetsResponse) String() string
type UnimplementedWidgetsServer ¶
type UnimplementedWidgetsServer struct{}
UnimplementedWidgetsServer should 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 (UnimplementedWidgetsServer) DescribeWidget ¶
func (UnimplementedWidgetsServer) DescribeWidget(context.Context, *DescribeWidgetRequest) (*DescribeWidgetResponse, error)
func (UnimplementedWidgetsServer) ListWidgets ¶
func (UnimplementedWidgetsServer) ListWidgets(context.Context, *ListWidgetsRequest) (*ListWidgetsResponse, error)
type UnsafeWidgetsServer ¶
type UnsafeWidgetsServer interface {
// contains filtered or unexported methods
}
UnsafeWidgetsServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WidgetsServer will result in compilation errors.
type Widget ¶
type Widget struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"`
Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"`
Configuration []*configuration.Field `protobuf:"bytes,6,rep,name=configuration,proto3" json:"configuration,omitempty"`
// contains filtered or unexported fields
}
func (*Widget) Descriptor
deprecated
func (*Widget) GetConfiguration ¶
func (x *Widget) GetConfiguration() []*configuration.Field
func (*Widget) GetDescription ¶
func (*Widget) ProtoMessage ¶
func (*Widget) ProtoMessage()
func (*Widget) ProtoReflect ¶
func (x *Widget) ProtoReflect() protoreflect.Message
type WidgetsClient ¶
type WidgetsClient interface {
ListWidgets(ctx context.Context, in *ListWidgetsRequest, opts ...grpc.CallOption) (*ListWidgetsResponse, error)
DescribeWidget(ctx context.Context, in *DescribeWidgetRequest, opts ...grpc.CallOption) (*DescribeWidgetResponse, error)
}
WidgetsClient is the client API for Widgets 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 NewWidgetsClient ¶
func NewWidgetsClient(cc grpc.ClientConnInterface) WidgetsClient
type WidgetsServer ¶
type WidgetsServer interface {
ListWidgets(context.Context, *ListWidgetsRequest) (*ListWidgetsResponse, error)
DescribeWidget(context.Context, *DescribeWidgetRequest) (*DescribeWidgetResponse, error)
}
WidgetsServer is the server API for Widgets service. All implementations should embed UnimplementedWidgetsServer for forward compatibility.