Documentation ¶
Overview ¶
Package proto is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterAlertServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAlertServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertServiceClient) error
- func RegisterAlertServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAlertServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertServiceServer) error
- func RegisterAlertServiceServer(s *grpc.Server, srv AlertServiceServer)
- type Alert
- func (*Alert) Descriptor() ([]byte, []int)deprecated
- func (x *Alert) GetAffectedSystem() string
- func (x *Alert) GetMessage() string
- func (x *Alert) GetMetadata() map[string]string
- func (x *Alert) GetOwner() string
- func (x *Alert) GetSeverity() Alert_AlertSeverity
- func (x *Alert) GetSourceSystem() string
- func (x *Alert) GetState() string
- func (x *Alert) GetTrigger() string
- func (*Alert) ProtoMessage()
- func (x *Alert) ProtoReflect() protoreflect.Message
- func (x *Alert) Reset()
- func (x *Alert) String() string
- type AlertServiceClient
- type AlertServiceServer
- type Alert_AlertSeverity
- func (Alert_AlertSeverity) Descriptor() protoreflect.EnumDescriptor
- func (x Alert_AlertSeverity) Enum() *Alert_AlertSeverity
- func (Alert_AlertSeverity) EnumDescriptor() ([]byte, []int)deprecated
- func (x Alert_AlertSeverity) Number() protoreflect.EnumNumber
- func (x Alert_AlertSeverity) String() string
- func (Alert_AlertSeverity) Type() protoreflect.EnumType
- type Alerts
- type Empty
- type ID
- type UnimplementedAlertServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Alert_AlertSeverity_name = map[int32]string{ 0: "UNSPECIFIED", 1: "LOW", 2: "MEDIUM", 3: "HIGH", 4: "CRITICAL", } Alert_AlertSeverity_value = map[string]int32{ "UNSPECIFIED": 0, "LOW": 1, "MEDIUM": 2, "HIGH": 3, "CRITICAL": 4, } )
Enum value maps for Alert_AlertSeverity.
var File_input_api_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAlertServiceHandler ¶
func RegisterAlertServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterAlertServiceHandler registers the http handlers for service AlertService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterAlertServiceHandlerClient ¶
func RegisterAlertServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AlertServiceClient) error
RegisterAlertServiceHandlerClient registers the http handlers for service AlertService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AlertServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AlertServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AlertServiceClient" to call the correct interceptors.
func RegisterAlertServiceHandlerFromEndpoint ¶
func RegisterAlertServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterAlertServiceHandlerFromEndpoint is same as RegisterAlertServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAlertServiceHandlerServer ¶
func RegisterAlertServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AlertServiceServer) error
RegisterAlertServiceHandlerServer registers the http handlers for service AlertService to "mux". UnaryRPC :call AlertServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterAlertServiceHandlerFromEndpoint instead.
func RegisterAlertServiceServer ¶
func RegisterAlertServiceServer(s *grpc.Server, srv AlertServiceServer)
Types ¶
type Alert ¶
type Alert struct { AffectedSystem string `protobuf:"bytes,1,opt,name=affectedSystem,proto3" json:"affectedSystem,omitempty"` SourceSystem string `protobuf:"bytes,2,opt,name=sourceSystem,proto3" json:"sourceSystem,omitempty"` Severity Alert_AlertSeverity `protobuf:"varint,3,opt,name=severity,proto3,enum=proto.Alert_AlertSeverity" json:"severity,omitempty"` Message string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` State string `protobuf:"bytes,5,opt,name=state,proto3" json:"state,omitempty"` Trigger string `protobuf:"bytes,6,opt,name=trigger,proto3" json:"trigger,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Owner string `protobuf:"bytes,8,opt,name=owner,proto3" json:"owner,omitempty"` // contains filtered or unexported fields }
func (*Alert) Descriptor
deprecated
func (*Alert) GetAffectedSystem ¶
func (*Alert) GetMessage ¶
func (*Alert) GetMetadata ¶ added in v1.0.2
func (*Alert) GetSeverity ¶
func (x *Alert) GetSeverity() Alert_AlertSeverity
func (*Alert) GetSourceSystem ¶
func (*Alert) GetTrigger ¶
func (*Alert) ProtoMessage ¶
func (*Alert) ProtoMessage()
func (*Alert) ProtoReflect ¶
func (x *Alert) ProtoReflect() protoreflect.Message
type AlertServiceClient ¶
type AlertServiceClient interface { // SendAlert to API SendAlert(ctx context.Context, in *Alert, opts ...grpc.CallOption) (*Alert, error) }
AlertServiceClient is the client API for AlertService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewAlertServiceClient ¶
func NewAlertServiceClient(cc grpc.ClientConnInterface) AlertServiceClient
type AlertServiceServer ¶
type AlertServiceServer interface { // SendAlert to API SendAlert(context.Context, *Alert) (*Alert, error) }
AlertServiceServer is the server API for AlertService service.
type Alert_AlertSeverity ¶
type Alert_AlertSeverity int32
const ( Alert_UNSPECIFIED Alert_AlertSeverity = 0 Alert_LOW Alert_AlertSeverity = 1 Alert_MEDIUM Alert_AlertSeverity = 2 Alert_HIGH Alert_AlertSeverity = 3 Alert_CRITICAL Alert_AlertSeverity = 4 )
func (Alert_AlertSeverity) Descriptor ¶
func (Alert_AlertSeverity) Descriptor() protoreflect.EnumDescriptor
func (Alert_AlertSeverity) Enum ¶
func (x Alert_AlertSeverity) Enum() *Alert_AlertSeverity
func (Alert_AlertSeverity) EnumDescriptor
deprecated
func (Alert_AlertSeverity) EnumDescriptor() ([]byte, []int)
Deprecated: Use Alert_AlertSeverity.Descriptor instead.
func (Alert_AlertSeverity) Number ¶
func (x Alert_AlertSeverity) Number() protoreflect.EnumNumber
func (Alert_AlertSeverity) String ¶
func (x Alert_AlertSeverity) String() string
func (Alert_AlertSeverity) Type ¶
func (Alert_AlertSeverity) Type() protoreflect.EnumType
type Alerts ¶
type Alerts struct { Alert []*Alert `protobuf:"bytes,1,rep,name=alert,proto3" json:"alert,omitempty"` // contains filtered or unexported fields }
func (*Alerts) Descriptor
deprecated
func (*Alerts) ProtoMessage ¶
func (*Alerts) ProtoMessage()
func (*Alerts) ProtoReflect ¶
func (x *Alerts) ProtoReflect() protoreflect.Message
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type ID ¶
type ID struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*ID) Descriptor
deprecated
func (*ID) ProtoMessage ¶
func (*ID) ProtoMessage()
func (*ID) ProtoReflect ¶
func (x *ID) ProtoReflect() protoreflect.Message
type UnimplementedAlertServiceServer ¶
type UnimplementedAlertServiceServer struct { }
UnimplementedAlertServiceServer can be embedded to have forward compatible implementations.
Directories ¶
Path | Synopsis |
---|---|
genswagger
Package genswagger provides a code generator for swagger.
|
Package genswagger provides a code generator for swagger. |