pb

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Status_Version_FullMethodName = "/pb.Status/Version"
	Status_Server_FullMethodName  = "/pb.Status/Server"
)

Variables

View Source
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{},
}
View Source
var EnumNameTypes = map[string]reflect.Type{}
View Source
var File_status_proto protoreflect.FileDescriptor
View Source
var JsonMarshalOptions = protojson.MarshalOptions{
	UseEnumNumbers:  true,
	EmitUnpopulated: false,
	UseProtoNames:   true,
	AllowPartial:    true,
}
View Source
var JsonUnmarshalOptions = protojson.UnmarshalOptions{
	AllowPartial:   true,
	DiscardUnknown: true,
}
View Source
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",
		},
	},
}
View Source
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,
		},
	},
}
View Source
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.`,
		},
	},
}
View Source
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.`,
		},
	},
}
View Source
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 CreateMessage(fullname string) any

func GetMessageDescription

func GetMessageDescription(fullname string) *api.MessageDescription

func GetMessageDescriptions

func GetMessageDescriptions() map[string]*api.MessageDescription

func GetMethodAliases

func GetMethodAliases() map[string]string

GetMethodAliases returns map of method CLI commands to method names

func GetMethodsInfo

func GetMethodsInfo() map[string]*MethodInfo

GetMethodsInfo returns map of methods

func MarshalJSON

func MarshalJSON(v any) ([]byte, error)

MarshalJSON implements json.Marshaler

func RegisterPrintOnce

func RegisterPrintOnce()

func RegisterStatusServer

func RegisterStatusServer(s grpc.ServiceRegistrar, srv StatusServer)

Types

type CheckAccessFunc

type CheckAccessFunc func(ctx context.Context, req any, action string) error

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 GetMethodInfo

func GetMethodInfo(method string) *MethodInfo

GetMethodInfo returns MethodInfo

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) Version

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL