Documentation
¶
Index ¶
- Constants
- Variables
- func CreateMessage(fullname string) any
- func GetMessageDescription(fullname string) *api.MessageDescription
- func GetMessageDescriptions() map[string]*api.MessageDescription
- func GetMethodAliases() map[string]string
- func GetMethodsInfo() map[string]*MethodInfo
- func MarshalJSON(v any) ([]byte, error)
- func RegisterPrintOnce()
- func RegisterStatusServer(s grpc.ServiceRegistrar, srv StatusServer)
- type CheckAccessFunc
- type MessageAllocator
- type MethodInfo
- type RequestAllocator
- type ServerStatus
- func (*ServerStatus) Descriptor() ([]byte, []int)deprecated
- func (x *ServerStatus) GetHostname() string
- func (x *ServerStatus) GetListenUrls() []string
- func (x *ServerStatus) GetName() string
- func (x *ServerStatus) GetNodename() string
- func (x *ServerStatus) GetStartedAt() string
- func (msg *ServerStatus) MarshalJSON() ([]byte, error)
- func (*ServerStatus) ProtoMessage()
- func (x *ServerStatus) ProtoReflect() protoreflect.Message
- func (x *ServerStatus) Reset()
- func (x *ServerStatus) String() string
- func (msg *ServerStatus) UnmarshalJSON(b []byte) error
- type ServerStatusResponse
- func (*ServerStatusResponse) Descriptor() ([]byte, []int)deprecated
- func (m *ServerStatusResponse) GetMessageDescription() *api.MessageDescription
- func (x *ServerStatusResponse) GetPods() map[string]string
- func (x *ServerStatusResponse) GetStatus() *ServerStatus
- func (x *ServerStatusResponse) GetVersion() *ServerVersion
- func (msg *ServerStatusResponse) MarshalJSON() ([]byte, error)
- func (r *ServerStatusResponse) Print(w io.Writer)
- func (*ServerStatusResponse) ProtoMessage()
- func (x *ServerStatusResponse) ProtoReflect() protoreflect.Message
- func (x *ServerStatusResponse) Reset()
- func (x *ServerStatusResponse) String() string
- func (msg *ServerStatusResponse) UnmarshalJSON(b []byte) error
- type ServerVersion
- func (*ServerVersion) Descriptor() ([]byte, []int)deprecated
- func (x *ServerVersion) GetBuild() string
- func (m *ServerVersion) GetMessageDescription() *api.MessageDescription
- func (x *ServerVersion) GetRuntime() string
- func (msg *ServerVersion) MarshalJSON() ([]byte, error)
- func (r *ServerVersion) Print(w io.Writer)
- func (*ServerVersion) ProtoMessage()
- func (x *ServerVersion) ProtoReflect() protoreflect.Message
- func (x *ServerVersion) Reset()
- func (x *ServerVersion) String() string
- func (msg *ServerVersion) UnmarshalJSON(b []byte) error
- type StatusClient
- type StatusServer
- type UnimplementedStatusServer
- type UnsafeStatusServer
Constants ¶
const ( Status_Version_FullMethodName = "/pb.Status/Version" Status_Server_FullMethodName = "/pb.Status/Server" )
Variables ¶
var Empty_MessageDescription = &api.MessageDescription{ Name: "Empty", FullName: "google.protobuf.Empty", Documentation: `A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }`, Fields: []*api.FieldMeta{}, }
var EnumNameTypes = map[string]reflect.Type{}
var File_status_proto protoreflect.FileDescriptor
var JsonMarshalOptions = protojson.MarshalOptions{ UseEnumNumbers: true, EmitUnpopulated: false, UseProtoNames: true, AllowPartial: true, }
var JsonUnmarshalOptions = protojson.UnmarshalOptions{ AllowPartial: true, DiscardUnknown: true, }
var ServerStatusResponse_MessageDescription = &api.MessageDescription{ Name: "ServerStatusResponse", Display: "Server Status Response", FullName: "pb.ServerStatusResponse", Documentation: `ServerStatusResponse returns status and version`, Fields: []*api.FieldMeta{ { Name: "Status", FullName: "pb.ServerStatusResponse.Status", Type: "struct", StructName: "pb.ServerStatus", SearchType: "flat_object", Documentation: `Status of the server.`, }, { Name: "Version", FullName: "pb.ServerStatusResponse.Version", Type: "struct", StructName: "pb.ServerVersion", SearchType: "flat_object", Documentation: `Version of the server.`, }, { Name: "Pods", FullName: "pb.ServerStatusResponse.Pods", Type: "map", StructName: "pb.ServerStatusResponse.PodsEntry", SearchType: "flat_object", }, }, }
var ServerStatusResponse_PodsEntry_MessageDescription = &api.MessageDescription{ Name: "ServerStatusResponse_PodsEntry", Display: "Pods Entry", FullName: "pb.ServerStatusResponse.PodsEntry", Fields: []*api.FieldMeta{ { Name: "Key", FullName: "pb.ServerStatusResponse.PodsEntry.Key", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Required: true, }, { Name: "Value", FullName: "pb.ServerStatusResponse.PodsEntry.Value", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Required: true, }, }, }
var ServerStatus_MessageDescription = &api.MessageDescription{ Name: "ServerStatus", Display: "Server Status", FullName: "pb.ServerStatus", Documentation: `ServerStatus provides server status information`, Fields: []*api.FieldMeta{ { Name: "Name", FullName: "pb.ServerStatus.Name", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `Name of the server or application.`, }, { Name: "Nodename", FullName: "pb.ServerStatus.Nodename", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `Nodename is the human-readable name of the cluster member, or empty for single host.`, }, { Name: "Hostname", FullName: "pb.ServerStatus.Hostname", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `Hostname is operating system's host name.`, }, { Name: "ListenUrls", FullName: "pb.ServerStatus.ListenUrls", Display: "Listen Urls", Type: "[]string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `ListenURLs is the list of URLs the service is listening on.`, }, { Name: "StartedAt", FullName: "pb.ServerStatus.StartedAt", Display: "Started At", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `StartedAt is the time in RFC3339 format.`, }, }, }
var ServerVersion_MessageDescription = &api.MessageDescription{ Name: "ServerVersion", Display: "Server Version", FullName: "pb.ServerVersion", Documentation: `ServerVersion provides server build and runtime version`, Fields: []*api.FieldMeta{ { Name: "Build", FullName: "pb.ServerVersion.Build", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `Build is the server build version.`, }, { Name: "Runtime", FullName: "pb.ServerVersion.Runtime", Type: "string", SearchType: "keyword", SearchOptions: api.SearchOption_Sortable, Documentation: `Runtime is the runtime version.`, }, }, }
var Status_ServiceDesc = grpc.ServiceDesc{ ServiceName: "pb.Status", HandlerType: (*StatusServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Version", Handler: _Status_Version_Handler, }, { MethodName: "Server", Handler: _Status_Server_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "status.proto", }
Status_ServiceDesc is the grpc.ServiceDesc for Status service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func CreateMessage ¶
func GetMessageDescription ¶
func GetMessageDescription(fullname string) *api.MessageDescription
func GetMessageDescriptions ¶
func GetMessageDescriptions() map[string]*api.MessageDescription
func GetMethodAliases ¶
GetMethodAliases returns map of method CLI commands to method names
func GetMethodsInfo ¶
func GetMethodsInfo() map[string]*MethodInfo
GetMethodsInfo returns map of methods
func RegisterPrintOnce ¶
func RegisterPrintOnce()
func RegisterStatusServer ¶
func RegisterStatusServer(s grpc.ServiceRegistrar, srv StatusServer)
Types ¶
type CheckAccessFunc ¶
CheckAccessFunc defines function to check access rights for the HTTP request
type MessageAllocator ¶
type MessageAllocator func() any
MessageAllocator defines constructor to allocate Protobuf message
type MethodInfo ¶
type MethodInfo struct {
Allocator RequestAllocator
AllowedRoles []string
Scopes []string
CliCmd string
RefreshInterval uint32
}
MethodInfo provides info about RPC method
func UnmarshalRequest ¶
func UnmarshalRequest(w http.ResponseWriter, r *http.Request) (any, *MethodInfo, error)
UnmarshalRequest unmarshals JSON body of HTTP request to protobuf request
type RequestAllocator ¶
type RequestAllocator func() any
RequestAllocator defines constructor to allocate Protobuf request
type ServerStatus ¶
type ServerStatus struct {
// Name of the server or application.
Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"`
// Nodename is the human-readable name of the cluster member,
// or empty for single host.
Nodename string `protobuf:"bytes,2,opt,name=Nodename,proto3" json:"Nodename,omitempty"`
// Hostname is operating system's host name.
Hostname string `protobuf:"bytes,3,opt,name=Hostname,proto3" json:"Hostname,omitempty"`
// ListenURLs is the list of URLs the service is listening on.
ListenUrls []string `protobuf:"bytes,4,rep,name=ListenUrls,proto3" json:"ListenUrls,omitempty"`
// StartedAt is the time in RFC3339 format.
StartedAt string `protobuf:"bytes,5,opt,name=StartedAt,proto3" json:"StartedAt,omitempty"`
// contains filtered or unexported fields
}
ServerStatus provides server status information
func (*ServerStatus) Descriptor
deprecated
func (*ServerStatus) Descriptor() ([]byte, []int)
Deprecated: Use ServerStatus.ProtoReflect.Descriptor instead.
func (*ServerStatus) GetHostname ¶
func (x *ServerStatus) GetHostname() string
func (*ServerStatus) GetListenUrls ¶
func (x *ServerStatus) GetListenUrls() []string
func (*ServerStatus) GetName ¶
func (x *ServerStatus) GetName() string
func (*ServerStatus) GetNodename ¶
func (x *ServerStatus) GetNodename() string
func (*ServerStatus) GetStartedAt ¶
func (x *ServerStatus) GetStartedAt() string
func (*ServerStatus) MarshalJSON ¶
func (msg *ServerStatus) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*ServerStatus) ProtoMessage ¶
func (*ServerStatus) ProtoMessage()
func (*ServerStatus) ProtoReflect ¶
func (x *ServerStatus) ProtoReflect() protoreflect.Message
func (*ServerStatus) Reset ¶
func (x *ServerStatus) Reset()
func (*ServerStatus) String ¶
func (x *ServerStatus) String() string
func (*ServerStatus) UnmarshalJSON ¶
func (msg *ServerStatus) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler
type ServerStatusResponse ¶
type ServerStatusResponse struct {
// Status of the server.
Status *ServerStatus `protobuf:"bytes,1,opt,name=Status,proto3" json:"Status,omitempty"`
// Version of the server.
Version *ServerVersion `protobuf:"bytes,2,opt,name=Version,proto3" json:"Version,omitempty"`
Pods map[string]string `` /* 135-byte string literal not displayed */
// contains filtered or unexported fields
}
ServerStatusResponse returns status and version
func (*ServerStatusResponse) Descriptor
deprecated
func (*ServerStatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use ServerStatusResponse.ProtoReflect.Descriptor instead.
func (*ServerStatusResponse) GetMessageDescription ¶
func (m *ServerStatusResponse) GetMessageDescription() *api.MessageDescription
func (*ServerStatusResponse) GetPods ¶
func (x *ServerStatusResponse) GetPods() map[string]string
func (*ServerStatusResponse) GetStatus ¶
func (x *ServerStatusResponse) GetStatus() *ServerStatus
func (*ServerStatusResponse) GetVersion ¶
func (x *ServerStatusResponse) GetVersion() *ServerVersion
func (*ServerStatusResponse) MarshalJSON ¶
func (msg *ServerStatusResponse) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*ServerStatusResponse) Print ¶
func (r *ServerStatusResponse) Print(w io.Writer)
func (*ServerStatusResponse) ProtoMessage ¶
func (*ServerStatusResponse) ProtoMessage()
func (*ServerStatusResponse) ProtoReflect ¶
func (x *ServerStatusResponse) ProtoReflect() protoreflect.Message
func (*ServerStatusResponse) Reset ¶
func (x *ServerStatusResponse) Reset()
func (*ServerStatusResponse) String ¶
func (x *ServerStatusResponse) String() string
func (*ServerStatusResponse) UnmarshalJSON ¶
func (msg *ServerStatusResponse) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler
type ServerVersion ¶
type ServerVersion struct {
// Build is the server build version.
Build string `protobuf:"bytes,1,opt,name=Build,proto3" json:"Build,omitempty"`
// Runtime is the runtime version.
Runtime string `protobuf:"bytes,2,opt,name=Runtime,proto3" json:"Runtime,omitempty"`
// contains filtered or unexported fields
}
ServerVersion provides server build and runtime version
func (*ServerVersion) Descriptor
deprecated
func (*ServerVersion) Descriptor() ([]byte, []int)
Deprecated: Use ServerVersion.ProtoReflect.Descriptor instead.
func (*ServerVersion) GetBuild ¶
func (x *ServerVersion) GetBuild() string
func (*ServerVersion) GetMessageDescription ¶
func (m *ServerVersion) GetMessageDescription() *api.MessageDescription
func (*ServerVersion) GetRuntime ¶
func (x *ServerVersion) GetRuntime() string
func (*ServerVersion) MarshalJSON ¶
func (msg *ServerVersion) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (*ServerVersion) Print ¶
func (r *ServerVersion) Print(w io.Writer)
func (*ServerVersion) ProtoMessage ¶
func (*ServerVersion) ProtoMessage()
func (*ServerVersion) ProtoReflect ¶
func (x *ServerVersion) ProtoReflect() protoreflect.Message
func (*ServerVersion) Reset ¶
func (x *ServerVersion) Reset()
func (*ServerVersion) String ¶
func (x *ServerVersion) String() string
func (*ServerVersion) UnmarshalJSON ¶
func (msg *ServerVersion) UnmarshalJSON(b []byte) error
UnmarshalJSON implements json.Unmarshaler
type StatusClient ¶
type StatusClient interface {
// Version returns the server version.
Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerVersion, error)
// Server returns the server status.
Server(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ServerStatusResponse, error)
}
StatusClient is the client API for Status 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 NewStatusClient ¶
func NewStatusClient(cc grpc.ClientConnInterface) StatusClient
type StatusServer ¶
type StatusServer interface {
// Version returns the server version.
Version(context.Context, *emptypb.Empty) (*ServerVersion, error)
// Server returns the server status.
Server(context.Context, *emptypb.Empty) (*ServerStatusResponse, error)
}
StatusServer is the server API for Status service. All implementations should embed UnimplementedStatusServer for forward compatibility.
type UnimplementedStatusServer ¶
type UnimplementedStatusServer struct{}
UnimplementedStatusServer 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 (UnimplementedStatusServer) Server ¶
func (UnimplementedStatusServer) Server(context.Context, *emptypb.Empty) (*ServerStatusResponse, error)
func (UnimplementedStatusServer) Version ¶
func (UnimplementedStatusServer) Version(context.Context, *emptypb.Empty) (*ServerVersion, error)
type UnsafeStatusServer ¶
type UnsafeStatusServer interface {
// contains filtered or unexported methods
}
UnsafeStatusServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StatusServer will result in compilation errors.