process

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package process defines the RPC interface for the sansshell Process actions.

Index

Constants

This section is empty.

Variables

View Source
var (
	ProcessState_name = map[int32]string{
		0: "PROCESS_STATE_UNKNOWN",
		1: "PROCESS_STATE_UNINTERRUPTIBLE_SLEEP",
		2: "PROCESS_STATE_RUNNING",
		3: "PROCESS_STATE_INTERRUPTIBLE_SLEEP",
		4: "PROCESS_STATE_STOPPED_JOB_CONTROL",
		5: "PROCESS_STATE_STOPPED_DEBUGGER",
		6: "PROCESS_STATE_ZOMBIE",
	}
	ProcessState_value = map[string]int32{
		"PROCESS_STATE_UNKNOWN":               0,
		"PROCESS_STATE_UNINTERRUPTIBLE_SLEEP": 1,
		"PROCESS_STATE_RUNNING":               2,
		"PROCESS_STATE_INTERRUPTIBLE_SLEEP":   3,
		"PROCESS_STATE_STOPPED_JOB_CONTROL":   4,
		"PROCESS_STATE_STOPPED_DEBUGGER":      5,
		"PROCESS_STATE_ZOMBIE":                6,
	}
)

Enum value maps for ProcessState.

View Source
var (
	ProcessStateCode_name = map[int32]string{
		0: "PROCESS_STATE_CODE_UNKNOWN",
		1: "PROCESS_STATE_CODE_HIGH_PRIORITY",
		2: "PROCESS_STATE_CODE_LOW_PRIORITY",
		3: "PROCESS_STATE_CODE_LOCKED_PAGES",
		4: "PROCESS_STATE_CODE_SESSION_LEADER",
		5: "PROCESS_STATE_CODE_MULTI_THREADED",
		6: "PROCESS_STATE_CODE_FOREGROUND_PGRP",
	}
	ProcessStateCode_value = map[string]int32{
		"PROCESS_STATE_CODE_UNKNOWN":         0,
		"PROCESS_STATE_CODE_HIGH_PRIORITY":   1,
		"PROCESS_STATE_CODE_LOW_PRIORITY":    2,
		"PROCESS_STATE_CODE_LOCKED_PAGES":    3,
		"PROCESS_STATE_CODE_SESSION_LEADER":  4,
		"PROCESS_STATE_CODE_MULTI_THREADED":  5,
		"PROCESS_STATE_CODE_FOREGROUND_PGRP": 6,
	}
)

Enum value maps for ProcessStateCode.

View Source
var (
	SchedulingClass_name = map[int32]string{
		0: "SCHEDULING_CLASS_UNKNOWN",
		1: "SCHEDULING_CLASS_NOT_REPORTED",
		2: "SCHEDULING_CLASS_OTHER",
		3: "SCHEDULING_CLASS_FIFO",
		4: "SCHEDULING_CLASS_RR",
		5: "SCHEDULING_CLASS_BATCH",
		6: "SCHEDULING_CLASS_ISO",
		7: "SCHEDULING_CLASS_IDLE",
		8: "SCHEDULING_CLASS_DEADLINE",
	}
	SchedulingClass_value = map[string]int32{
		"SCHEDULING_CLASS_UNKNOWN":      0,
		"SCHEDULING_CLASS_NOT_REPORTED": 1,
		"SCHEDULING_CLASS_OTHER":        2,
		"SCHEDULING_CLASS_FIFO":         3,
		"SCHEDULING_CLASS_RR":           4,
		"SCHEDULING_CLASS_BATCH":        5,
		"SCHEDULING_CLASS_ISO":          6,
		"SCHEDULING_CLASS_IDLE":         7,
		"SCHEDULING_CLASS_DEADLINE":     8,
	}
)

Enum value maps for SchedulingClass.

View Source
var (
	DumpType_name = map[int32]string{
		0: "DUMP_TYPE_UNKNOWN",
		1: "DUMP_TYPE_GCORE",
		2: "DUMP_TYPE_JMAP",
	}
	DumpType_value = map[string]int32{
		"DUMP_TYPE_UNKNOWN": 0,
		"DUMP_TYPE_GCORE":   1,
		"DUMP_TYPE_JMAP":    2,
	}
)

Enum value maps for DumpType.

View Source
var File_process_proto protoreflect.FileDescriptor
View Source
var Process_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Process.Process",
	HandlerType: (*ProcessServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _Process_List_Handler,
		},
		{
			MethodName: "Kill",
			Handler:    _Process_Kill_Handler,
		},
		{
			MethodName: "GetStacks",
			Handler:    _Process_GetStacks_Handler,
		},
		{
			MethodName: "GetJavaStacks",
			Handler:    _Process_GetJavaStacks_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetMemoryDump",
			Handler:       _Process_GetMemoryDump_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "process.proto",
}

Process_ServiceDesc is the grpc.ServiceDesc for Process service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterProcessServer

func RegisterProcessServer(s grpc.ServiceRegistrar, srv ProcessServer)

Types

type DumpDestinationStream

type DumpDestinationStream struct {
	// contains filtered or unexported fields
}

func (*DumpDestinationStream) Descriptor deprecated

func (*DumpDestinationStream) Descriptor() ([]byte, []int)

Deprecated: Use DumpDestinationStream.ProtoReflect.Descriptor instead.

func (*DumpDestinationStream) ProtoMessage

func (*DumpDestinationStream) ProtoMessage()

func (*DumpDestinationStream) ProtoReflect

func (x *DumpDestinationStream) ProtoReflect() protoreflect.Message

func (*DumpDestinationStream) Reset

func (x *DumpDestinationStream) Reset()

func (*DumpDestinationStream) String

func (x *DumpDestinationStream) String() string

type DumpDestinationUrl

type DumpDestinationUrl struct {
	Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
	// Any additional data the URL destination may need in order
	// to succeed (such as an auth token for a blob service).
	BlobData []byte `protobuf:"bytes,2,opt,name=blob_data,json=blobData,proto3" json:"blob_data,omitempty"`
	// contains filtered or unexported fields
}

func (*DumpDestinationUrl) Descriptor deprecated

func (*DumpDestinationUrl) Descriptor() ([]byte, []int)

Deprecated: Use DumpDestinationUrl.ProtoReflect.Descriptor instead.

func (*DumpDestinationUrl) GetBlobData

func (x *DumpDestinationUrl) GetBlobData() []byte

func (*DumpDestinationUrl) GetUrl

func (x *DumpDestinationUrl) GetUrl() string

func (*DumpDestinationUrl) ProtoMessage

func (*DumpDestinationUrl) ProtoMessage()

func (*DumpDestinationUrl) ProtoReflect

func (x *DumpDestinationUrl) ProtoReflect() protoreflect.Message

func (*DumpDestinationUrl) Reset

func (x *DumpDestinationUrl) Reset()

func (*DumpDestinationUrl) String

func (x *DumpDestinationUrl) String() string

type DumpType

type DumpType int32

DumpType indicates the program to use to generate the dump.

const (
	DumpType_DUMP_TYPE_UNKNOWN DumpType = 0
	DumpType_DUMP_TYPE_GCORE   DumpType = 1
	DumpType_DUMP_TYPE_JMAP    DumpType = 2
)

func (DumpType) Descriptor

func (DumpType) Descriptor() protoreflect.EnumDescriptor

func (DumpType) Enum

func (x DumpType) Enum() *DumpType

func (DumpType) EnumDescriptor deprecated

func (DumpType) EnumDescriptor() ([]byte, []int)

Deprecated: Use DumpType.Descriptor instead.

func (DumpType) Number

func (x DumpType) Number() protoreflect.EnumNumber

func (DumpType) String

func (x DumpType) String() string

func (DumpType) Type

type GetJavaStacksManyResponse

type GetJavaStacksManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *GetJavaStacksReply
	Error error
}

GetJavaStacksManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type GetJavaStacksReply

type GetJavaStacksReply struct {
	Stacks []*JavaThreadStack `protobuf:"bytes,1,rep,name=stacks,proto3" json:"stacks,omitempty"`
	// contains filtered or unexported fields
}

func (*GetJavaStacksReply) Descriptor deprecated

func (*GetJavaStacksReply) Descriptor() ([]byte, []int)

Deprecated: Use GetJavaStacksReply.ProtoReflect.Descriptor instead.

func (*GetJavaStacksReply) GetStacks

func (x *GetJavaStacksReply) GetStacks() []*JavaThreadStack

func (*GetJavaStacksReply) ProtoMessage

func (*GetJavaStacksReply) ProtoMessage()

func (*GetJavaStacksReply) ProtoReflect

func (x *GetJavaStacksReply) ProtoReflect() protoreflect.Message

func (*GetJavaStacksReply) Reset

func (x *GetJavaStacksReply) Reset()

func (*GetJavaStacksReply) String

func (x *GetJavaStacksReply) String() string

type GetJavaStacksRequest

type GetJavaStacksRequest struct {
	Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*GetJavaStacksRequest) Descriptor deprecated

func (*GetJavaStacksRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetJavaStacksRequest.ProtoReflect.Descriptor instead.

func (*GetJavaStacksRequest) GetPid

func (x *GetJavaStacksRequest) GetPid() int64

func (*GetJavaStacksRequest) ProtoMessage

func (*GetJavaStacksRequest) ProtoMessage()

func (*GetJavaStacksRequest) ProtoReflect

func (x *GetJavaStacksRequest) ProtoReflect() protoreflect.Message

func (*GetJavaStacksRequest) Reset

func (x *GetJavaStacksRequest) Reset()

func (*GetJavaStacksRequest) String

func (x *GetJavaStacksRequest) String() string

type GetMemoryDumpManyResponse

type GetMemoryDumpManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *GetMemoryDumpReply
	Error error
}

GetMemoryDumpManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type GetMemoryDumpReply

type GetMemoryDumpReply struct {
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

If the destination is BLOB_DESTINATION_STREAM this will contain the memory dump data. If not the remote write will occur and only the error status on the stream will indicate success/failure.

func (*GetMemoryDumpReply) Descriptor deprecated

func (*GetMemoryDumpReply) Descriptor() ([]byte, []int)

Deprecated: Use GetMemoryDumpReply.ProtoReflect.Descriptor instead.

func (*GetMemoryDumpReply) GetData

func (x *GetMemoryDumpReply) GetData() []byte

func (*GetMemoryDumpReply) ProtoMessage

func (*GetMemoryDumpReply) ProtoMessage()

func (*GetMemoryDumpReply) ProtoReflect

func (x *GetMemoryDumpReply) ProtoReflect() protoreflect.Message

func (*GetMemoryDumpReply) Reset

func (x *GetMemoryDumpReply) Reset()

func (*GetMemoryDumpReply) String

func (x *GetMemoryDumpReply) String() string

type GetMemoryDumpRequest

type GetMemoryDumpRequest struct {
	Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// Determine which program to use for dumping.
	// For URL based destinations the file will be named heapdump
	// instead of core to also indicate the difference.
	DumpType DumpType `protobuf:"varint,2,opt,name=dump_type,json=dumpType,proto3,enum=Process.DumpType" json:"dump_type,omitempty"`
	// Types that are assignable to Destination:
	//	*GetMemoryDumpRequest_Stream
	//	*GetMemoryDumpRequest_Url
	Destination isGetMemoryDumpRequest_Destination `protobuf_oneof:"destination"`
	// contains filtered or unexported fields
}

func (*GetMemoryDumpRequest) Descriptor deprecated

func (*GetMemoryDumpRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetMemoryDumpRequest.ProtoReflect.Descriptor instead.

func (*GetMemoryDumpRequest) GetDestination

func (m *GetMemoryDumpRequest) GetDestination() isGetMemoryDumpRequest_Destination

func (*GetMemoryDumpRequest) GetDumpType

func (x *GetMemoryDumpRequest) GetDumpType() DumpType

func (*GetMemoryDumpRequest) GetPid

func (x *GetMemoryDumpRequest) GetPid() int64

func (*GetMemoryDumpRequest) GetStream

func (*GetMemoryDumpRequest) GetUrl

func (*GetMemoryDumpRequest) ProtoMessage

func (*GetMemoryDumpRequest) ProtoMessage()

func (*GetMemoryDumpRequest) ProtoReflect

func (x *GetMemoryDumpRequest) ProtoReflect() protoreflect.Message

func (*GetMemoryDumpRequest) Reset

func (x *GetMemoryDumpRequest) Reset()

func (*GetMemoryDumpRequest) String

func (x *GetMemoryDumpRequest) String() string

type GetMemoryDumpRequest_Stream

type GetMemoryDumpRequest_Stream struct {
	Stream *DumpDestinationStream `protobuf:"bytes,3,opt,name=stream,proto3,oneof"`
}

type GetMemoryDumpRequest_Url

type GetMemoryDumpRequest_Url struct {
	Url *DumpDestinationUrl `protobuf:"bytes,4,opt,name=url,proto3,oneof"`
}

type GetStacksManyResponse

type GetStacksManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *GetStacksReply
	Error error
}

GetStacksManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type GetStacksReply

type GetStacksReply struct {
	Stacks []*ThreadStack `protobuf:"bytes,1,rep,name=stacks,proto3" json:"stacks,omitempty"`
	// contains filtered or unexported fields
}

func (*GetStacksReply) Descriptor deprecated

func (*GetStacksReply) Descriptor() ([]byte, []int)

Deprecated: Use GetStacksReply.ProtoReflect.Descriptor instead.

func (*GetStacksReply) GetStacks

func (x *GetStacksReply) GetStacks() []*ThreadStack

func (*GetStacksReply) ProtoMessage

func (*GetStacksReply) ProtoMessage()

func (*GetStacksReply) ProtoReflect

func (x *GetStacksReply) ProtoReflect() protoreflect.Message

func (*GetStacksReply) Reset

func (x *GetStacksReply) Reset()

func (*GetStacksReply) String

func (x *GetStacksReply) String() string

type GetStacksRequest

type GetStacksRequest struct {
	Pid int64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*GetStacksRequest) Descriptor deprecated

func (*GetStacksRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetStacksRequest.ProtoReflect.Descriptor instead.

func (*GetStacksRequest) GetPid

func (x *GetStacksRequest) GetPid() int64

func (*GetStacksRequest) ProtoMessage

func (*GetStacksRequest) ProtoMessage()

func (*GetStacksRequest) ProtoReflect

func (x *GetStacksRequest) ProtoReflect() protoreflect.Message

func (*GetStacksRequest) Reset

func (x *GetStacksRequest) Reset()

func (*GetStacksRequest) String

func (x *GetStacksRequest) String() string

type JavaThreadStack

type JavaThreadStack struct {
	Name           string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	ThreadNumber   int64    `protobuf:"varint,2,opt,name=thread_number,json=threadNumber,proto3" json:"thread_number,omitempty"`
	Daemon         bool     `protobuf:"varint,3,opt,name=daemon,proto3" json:"daemon,omitempty"`
	Priority       int32    `protobuf:"varint,4,opt,name=priority,proto3" json:"priority,omitempty"`
	OsPriority     int32    `protobuf:"varint,5,opt,name=os_priority,json=osPriority,proto3" json:"os_priority,omitempty"`
	CpuMs          float32  `protobuf:"fixed32,6,opt,name=cpu_ms,json=cpuMs,proto3" json:"cpu_ms,omitempty"`
	ElapsedSec     float32  `protobuf:"fixed32,7,opt,name=elapsed_sec,json=elapsedSec,proto3" json:"elapsed_sec,omitempty"`
	ThreadId       int64    `protobuf:"varint,8,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	NativeThreadId int64    `protobuf:"varint,9,opt,name=native_thread_id,json=nativeThreadId,proto3" json:"native_thread_id,omitempty"`
	State          string   `protobuf:"bytes,10,opt,name=state,proto3" json:"state,omitempty"`
	Pc             int64    `protobuf:"varint,11,opt,name=pc,proto3" json:"pc,omitempty"`
	ThreadState    string   `protobuf:"bytes,12,opt,name=thread_state,json=threadState,proto3" json:"thread_state,omitempty"`
	Stacks         []string `protobuf:"bytes,13,rep,name=stacks,proto3" json:"stacks,omitempty"`
	// contains filtered or unexported fields
}

func (*JavaThreadStack) Descriptor deprecated

func (*JavaThreadStack) Descriptor() ([]byte, []int)

Deprecated: Use JavaThreadStack.ProtoReflect.Descriptor instead.

func (*JavaThreadStack) GetCpuMs

func (x *JavaThreadStack) GetCpuMs() float32

func (*JavaThreadStack) GetDaemon

func (x *JavaThreadStack) GetDaemon() bool

func (*JavaThreadStack) GetElapsedSec

func (x *JavaThreadStack) GetElapsedSec() float32

func (*JavaThreadStack) GetName

func (x *JavaThreadStack) GetName() string

func (*JavaThreadStack) GetNativeThreadId

func (x *JavaThreadStack) GetNativeThreadId() int64

func (*JavaThreadStack) GetOsPriority

func (x *JavaThreadStack) GetOsPriority() int32

func (*JavaThreadStack) GetPc

func (x *JavaThreadStack) GetPc() int64

func (*JavaThreadStack) GetPriority

func (x *JavaThreadStack) GetPriority() int32

func (*JavaThreadStack) GetStacks

func (x *JavaThreadStack) GetStacks() []string

func (*JavaThreadStack) GetState

func (x *JavaThreadStack) GetState() string

func (*JavaThreadStack) GetThreadId

func (x *JavaThreadStack) GetThreadId() int64

func (*JavaThreadStack) GetThreadNumber

func (x *JavaThreadStack) GetThreadNumber() int64

func (*JavaThreadStack) GetThreadState

func (x *JavaThreadStack) GetThreadState() string

func (*JavaThreadStack) ProtoMessage

func (*JavaThreadStack) ProtoMessage()

func (*JavaThreadStack) ProtoReflect

func (x *JavaThreadStack) ProtoReflect() protoreflect.Message

func (*JavaThreadStack) Reset

func (x *JavaThreadStack) Reset()

func (*JavaThreadStack) String

func (x *JavaThreadStack) String() string

type KillManyResponse added in v1.3.0

type KillManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *emptypb.Empty
	Error error
}

KillManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type KillRequest added in v1.3.0

type KillRequest struct {

	// Pid must be positive and non-zero (we don't support wildcard kill)
	Pid    uint64 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	Signal uint32 `protobuf:"varint,2,opt,name=signal,proto3" json:"signal,omitempty"`
	// contains filtered or unexported fields
}

func (*KillRequest) Descriptor deprecated added in v1.3.0

func (*KillRequest) Descriptor() ([]byte, []int)

Deprecated: Use KillRequest.ProtoReflect.Descriptor instead.

func (*KillRequest) GetPid added in v1.3.0

func (x *KillRequest) GetPid() uint64

func (*KillRequest) GetSignal added in v1.3.0

func (x *KillRequest) GetSignal() uint32

func (*KillRequest) ProtoMessage added in v1.3.0

func (*KillRequest) ProtoMessage()

func (*KillRequest) ProtoReflect added in v1.3.0

func (x *KillRequest) ProtoReflect() protoreflect.Message

func (*KillRequest) Reset added in v1.3.0

func (x *KillRequest) Reset()

func (*KillRequest) String added in v1.3.0

func (x *KillRequest) String() string

type ListManyResponse

type ListManyResponse struct {
	Target string
	// As targets can be duplicated this is the index into the slice passed to proxy.Conn.
	Index int
	Resp  *ListReply
	Error error
}

ListManyResponse encapsulates a proxy data packet. It includes the target, index, response and possible error returned.

type ListReply

type ListReply struct {

	// A list of process details which may be limited to only the pids requested.
	ProcessEntries []*ProcessEntry `protobuf:"bytes,1,rep,name=process_entries,json=processEntries,proto3" json:"process_entries,omitempty"`
	// contains filtered or unexported fields
}

func (*ListReply) Descriptor deprecated

func (*ListReply) Descriptor() ([]byte, []int)

Deprecated: Use ListReply.ProtoReflect.Descriptor instead.

func (*ListReply) GetProcessEntries

func (x *ListReply) GetProcessEntries() []*ProcessEntry

func (*ListReply) ProtoMessage

func (*ListReply) ProtoMessage()

func (*ListReply) ProtoReflect

func (x *ListReply) ProtoReflect() protoreflect.Message

func (*ListReply) Reset

func (x *ListReply) Reset()

func (*ListReply) String

func (x *ListReply) String() string

type ListRequest

type ListRequest struct {

	// If non-empty will only return data on the listed pids.
	// Otherwise all processes are returned.
	Pids []int64 `protobuf:"varint,1,rep,packed,name=pids,proto3" json:"pids,omitempty"`
	// contains filtered or unexported fields
}

func (*ListRequest) Descriptor deprecated

func (*ListRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetPids

func (x *ListRequest) GetPids() []int64

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 ProcessClient

type ProcessClient interface {
	// List returns the output from the ps command.
	// NOTE: Since this contains the command line this can
	// contain sensitive data.
	List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListReply, error)
	// Kill will send a signal to the given process id and return its status via
	// error handling.
	Kill(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	// GetStacks will return the output from pstack which generally has nothing
	// sensitive in it but depending on function names could have internal details
	// so be careful.
	GetStacks(ctx context.Context, in *GetStacksRequest, opts ...grpc.CallOption) (*GetStacksReply, error)
	// GetJavaStacks will return the output from jstack which generally has
	// nothing sensitive in it but depending on function names could have internal
	// details so be careful.
	GetJavaStacks(ctx context.Context, in *GetJavaStacksRequest, opts ...grpc.CallOption) (*GetJavaStacksReply, error)
	// GetMemoryDump will return the output from gcore or jmap which 100% has
	// sensitive data contained within it. Be very careful where this is
	// stored/transferred/etc.
	// NOTE: Enough disk space is required to hold the dump file before streaming
	//       the response.
	GetMemoryDump(ctx context.Context, in *GetMemoryDumpRequest, opts ...grpc.CallOption) (Process_GetMemoryDumpClient, error)
}

ProcessClient is the client API for Process 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 NewProcessClient

func NewProcessClient(cc grpc.ClientConnInterface) ProcessClient

type ProcessClientProxy

type ProcessClientProxy interface {
	ProcessClient
	ListOneMany(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (<-chan *ListManyResponse, error)
	KillOneMany(ctx context.Context, in *KillRequest, opts ...grpc.CallOption) (<-chan *KillManyResponse, error)
	GetStacksOneMany(ctx context.Context, in *GetStacksRequest, opts ...grpc.CallOption) (<-chan *GetStacksManyResponse, error)
	GetJavaStacksOneMany(ctx context.Context, in *GetJavaStacksRequest, opts ...grpc.CallOption) (<-chan *GetJavaStacksManyResponse, error)
	GetMemoryDumpOneMany(ctx context.Context, in *GetMemoryDumpRequest, opts ...grpc.CallOption) (Process_GetMemoryDumpClientProxy, error)
}

ProcessClientProxy is the superset of ProcessClient which additionally includes the OneMany proxy methods

func NewProcessClientProxy

func NewProcessClientProxy(cc *proxy.Conn) ProcessClientProxy

NewProcessClientProxy creates a ProcessClientProxy for use in proxied connections. NOTE: This takes a proxy.Conn instead of a generic ClientConnInterface as the methods here are only valid in proxy.Conn contexts.

type ProcessEntry

type ProcessEntry struct {
	Pid             int64           `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	Ppid            int64           `protobuf:"varint,2,opt,name=ppid,proto3" json:"ppid,omitempty"`
	Command         string          `protobuf:"bytes,3,opt,name=command,proto3" json:"command,omitempty"`
	ThreadId        int64           `protobuf:"varint,4,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	Wchan           string          `protobuf:"bytes,5,opt,name=wchan,proto3" json:"wchan,omitempty"`
	CpuPercent      float32         `protobuf:"fixed32,6,opt,name=cpu_percent,json=cpuPercent,proto3" json:"cpu_percent,omitempty"`
	MemPercent      float32         `protobuf:"fixed32,7,opt,name=mem_percent,json=memPercent,proto3" json:"mem_percent,omitempty"`
	StartedTime     string          `protobuf:"bytes,8,opt,name=started_time,json=startedTime,proto3" json:"started_time,omitempty"`
	ElapsedTime     string          `protobuf:"bytes,9,opt,name=elapsed_time,json=elapsedTime,proto3" json:"elapsed_time,omitempty"`
	Rss             int64           `protobuf:"varint,10,opt,name=rss,proto3" json:"rss,omitempty"`
	Vsize           int64           `protobuf:"varint,11,opt,name=vsize,proto3" json:"vsize,omitempty"`
	Egid            int64           `protobuf:"varint,12,opt,name=egid,proto3" json:"egid,omitempty"`
	Euid            int64           `protobuf:"varint,13,opt,name=euid,proto3" json:"euid,omitempty"`
	Rgid            int64           `protobuf:"varint,14,opt,name=rgid,proto3" json:"rgid,omitempty"`
	Ruid            int64           `protobuf:"varint,15,opt,name=ruid,proto3" json:"ruid,omitempty"`
	Sgid            int64           `protobuf:"varint,16,opt,name=sgid,proto3" json:"sgid,omitempty"`
	Suid            int64           `protobuf:"varint,17,opt,name=suid,proto3" json:"suid,omitempty"`
	Nice            int32           `protobuf:"varint,18,opt,name=nice,proto3" json:"nice,omitempty"`
	Priority        int32           `protobuf:"varint,19,opt,name=priority,proto3" json:"priority,omitempty"`
	SchedulingClass SchedulingClass `` /* 137-byte string literal not displayed */
	// OS dependent on what this means (check man ps).
	Flags           uint64             `protobuf:"varint,21,opt,name=flags,proto3" json:"flags,omitempty"`
	State           ProcessState       `protobuf:"varint,22,opt,name=state,proto3,enum=Process.ProcessState" json:"state,omitempty"`
	StateCode       []ProcessStateCode `` /* 127-byte string literal not displayed */
	Eip             uint64             `protobuf:"varint,24,opt,name=eip,proto3" json:"eip,omitempty"`
	Esp             uint64             `protobuf:"varint,25,opt,name=esp,proto3" json:"esp,omitempty"`
	BlockedSignals  uint64             `protobuf:"varint,26,opt,name=blocked_signals,json=blockedSignals,proto3" json:"blocked_signals,omitempty"`
	CaughtSignals   uint64             `protobuf:"varint,27,opt,name=caught_signals,json=caughtSignals,proto3" json:"caught_signals,omitempty"`
	IgnoredSignals  uint64             `protobuf:"varint,28,opt,name=ignored_signals,json=ignoredSignals,proto3" json:"ignored_signals,omitempty"`
	PendingSignals  uint64             `protobuf:"varint,29,opt,name=pending_signals,json=pendingSignals,proto3" json:"pending_signals,omitempty"`
	NumberOfThreads int64              `protobuf:"varint,30,opt,name=number_of_threads,json=numberOfThreads,proto3" json:"number_of_threads,omitempty"`
	// contains filtered or unexported fields
}

ProcessEntry describes a process based on ps output. It is modeled on the Linux ps command and on other OS may return a subset of these values instead. i.e. strings will be empty and integer values will be -1 in those cases.

func (*ProcessEntry) Descriptor deprecated

func (*ProcessEntry) Descriptor() ([]byte, []int)

Deprecated: Use ProcessEntry.ProtoReflect.Descriptor instead.

func (*ProcessEntry) GetBlockedSignals

func (x *ProcessEntry) GetBlockedSignals() uint64

func (*ProcessEntry) GetCaughtSignals

func (x *ProcessEntry) GetCaughtSignals() uint64

func (*ProcessEntry) GetCommand

func (x *ProcessEntry) GetCommand() string

func (*ProcessEntry) GetCpuPercent

func (x *ProcessEntry) GetCpuPercent() float32

func (*ProcessEntry) GetEgid

func (x *ProcessEntry) GetEgid() int64

func (*ProcessEntry) GetEip

func (x *ProcessEntry) GetEip() uint64

func (*ProcessEntry) GetElapsedTime

func (x *ProcessEntry) GetElapsedTime() string

func (*ProcessEntry) GetEsp

func (x *ProcessEntry) GetEsp() uint64

func (*ProcessEntry) GetEuid

func (x *ProcessEntry) GetEuid() int64

func (*ProcessEntry) GetFlags

func (x *ProcessEntry) GetFlags() uint64

func (*ProcessEntry) GetIgnoredSignals

func (x *ProcessEntry) GetIgnoredSignals() uint64

func (*ProcessEntry) GetMemPercent

func (x *ProcessEntry) GetMemPercent() float32

func (*ProcessEntry) GetNice

func (x *ProcessEntry) GetNice() int32

func (*ProcessEntry) GetNumberOfThreads

func (x *ProcessEntry) GetNumberOfThreads() int64

func (*ProcessEntry) GetPendingSignals

func (x *ProcessEntry) GetPendingSignals() uint64

func (*ProcessEntry) GetPid

func (x *ProcessEntry) GetPid() int64

func (*ProcessEntry) GetPpid

func (x *ProcessEntry) GetPpid() int64

func (*ProcessEntry) GetPriority

func (x *ProcessEntry) GetPriority() int32

func (*ProcessEntry) GetRgid

func (x *ProcessEntry) GetRgid() int64

func (*ProcessEntry) GetRss

func (x *ProcessEntry) GetRss() int64

func (*ProcessEntry) GetRuid

func (x *ProcessEntry) GetRuid() int64

func (*ProcessEntry) GetSchedulingClass

func (x *ProcessEntry) GetSchedulingClass() SchedulingClass

func (*ProcessEntry) GetSgid

func (x *ProcessEntry) GetSgid() int64

func (*ProcessEntry) GetStartedTime

func (x *ProcessEntry) GetStartedTime() string

func (*ProcessEntry) GetState

func (x *ProcessEntry) GetState() ProcessState

func (*ProcessEntry) GetStateCode

func (x *ProcessEntry) GetStateCode() []ProcessStateCode

func (*ProcessEntry) GetSuid

func (x *ProcessEntry) GetSuid() int64

func (*ProcessEntry) GetThreadId

func (x *ProcessEntry) GetThreadId() int64

func (*ProcessEntry) GetVsize

func (x *ProcessEntry) GetVsize() int64

func (*ProcessEntry) GetWchan

func (x *ProcessEntry) GetWchan() string

func (*ProcessEntry) ProtoMessage

func (*ProcessEntry) ProtoMessage()

func (*ProcessEntry) ProtoReflect

func (x *ProcessEntry) ProtoReflect() protoreflect.Message

func (*ProcessEntry) Reset

func (x *ProcessEntry) Reset()

func (*ProcessEntry) String

func (x *ProcessEntry) String() string

type ProcessServer

type ProcessServer interface {
	// List returns the output from the ps command.
	// NOTE: Since this contains the command line this can
	// contain sensitive data.
	List(context.Context, *ListRequest) (*ListReply, error)
	// Kill will send a signal to the given process id and return its status via
	// error handling.
	Kill(context.Context, *KillRequest) (*emptypb.Empty, error)
	// GetStacks will return the output from pstack which generally has nothing
	// sensitive in it but depending on function names could have internal details
	// so be careful.
	GetStacks(context.Context, *GetStacksRequest) (*GetStacksReply, error)
	// GetJavaStacks will return the output from jstack which generally has
	// nothing sensitive in it but depending on function names could have internal
	// details so be careful.
	GetJavaStacks(context.Context, *GetJavaStacksRequest) (*GetJavaStacksReply, error)
	// GetMemoryDump will return the output from gcore or jmap which 100% has
	// sensitive data contained within it. Be very careful where this is
	// stored/transferred/etc.
	// NOTE: Enough disk space is required to hold the dump file before streaming
	//       the response.
	GetMemoryDump(*GetMemoryDumpRequest, Process_GetMemoryDumpServer) error
}

ProcessServer is the server API for Process service. All implementations should embed UnimplementedProcessServer for forward compatibility

type ProcessState

type ProcessState int32

ProcessState refers to the single letter state "ps -o s" returns.

const (
	ProcessState_PROCESS_STATE_UNKNOWN ProcessState = 0
	// D
	ProcessState_PROCESS_STATE_UNINTERRUPTIBLE_SLEEP ProcessState = 1
	// R
	ProcessState_PROCESS_STATE_RUNNING ProcessState = 2
	// S
	ProcessState_PROCESS_STATE_INTERRUPTIBLE_SLEEP ProcessState = 3
	// T
	ProcessState_PROCESS_STATE_STOPPED_JOB_CONTROL ProcessState = 4
	// t
	ProcessState_PROCESS_STATE_STOPPED_DEBUGGER ProcessState = 5
	// Z
	ProcessState_PROCESS_STATE_ZOMBIE ProcessState = 6
)

func (ProcessState) Descriptor

func (ProcessState) Enum

func (x ProcessState) Enum() *ProcessState

func (ProcessState) EnumDescriptor deprecated

func (ProcessState) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProcessState.Descriptor instead.

func (ProcessState) Number

func (ProcessState) String

func (x ProcessState) String() string

func (ProcessState) Type

type ProcessStateCode

type ProcessStateCode int32

ProcessStateCode interprets the additional characters appened to ps -o stat output.

const (
	ProcessStateCode_PROCESS_STATE_CODE_UNKNOWN         ProcessStateCode = 0
	ProcessStateCode_PROCESS_STATE_CODE_HIGH_PRIORITY   ProcessStateCode = 1
	ProcessStateCode_PROCESS_STATE_CODE_LOW_PRIORITY    ProcessStateCode = 2
	ProcessStateCode_PROCESS_STATE_CODE_LOCKED_PAGES    ProcessStateCode = 3
	ProcessStateCode_PROCESS_STATE_CODE_SESSION_LEADER  ProcessStateCode = 4
	ProcessStateCode_PROCESS_STATE_CODE_MULTI_THREADED  ProcessStateCode = 5
	ProcessStateCode_PROCESS_STATE_CODE_FOREGROUND_PGRP ProcessStateCode = 6
)

func (ProcessStateCode) Descriptor

func (ProcessStateCode) Enum

func (ProcessStateCode) EnumDescriptor deprecated

func (ProcessStateCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ProcessStateCode.Descriptor instead.

func (ProcessStateCode) Number

func (ProcessStateCode) String

func (x ProcessStateCode) String() string

func (ProcessStateCode) Type

type Process_GetMemoryDumpClient

type Process_GetMemoryDumpClient interface {
	Recv() (*GetMemoryDumpReply, error)
	grpc.ClientStream
}

type Process_GetMemoryDumpClientProxy

type Process_GetMemoryDumpClientProxy interface {
	Recv() ([]*GetMemoryDumpManyResponse, error)
	grpc.ClientStream
}

type Process_GetMemoryDumpServer

type Process_GetMemoryDumpServer interface {
	Send(*GetMemoryDumpReply) error
	grpc.ServerStream
}

type SchedulingClass

type SchedulingClass int32
const (
	SchedulingClass_SCHEDULING_CLASS_UNKNOWN      SchedulingClass = 0
	SchedulingClass_SCHEDULING_CLASS_NOT_REPORTED SchedulingClass = 1
	SchedulingClass_SCHEDULING_CLASS_OTHER        SchedulingClass = 2
	SchedulingClass_SCHEDULING_CLASS_FIFO         SchedulingClass = 3
	SchedulingClass_SCHEDULING_CLASS_RR           SchedulingClass = 4
	SchedulingClass_SCHEDULING_CLASS_BATCH        SchedulingClass = 5
	SchedulingClass_SCHEDULING_CLASS_ISO          SchedulingClass = 6
	SchedulingClass_SCHEDULING_CLASS_IDLE         SchedulingClass = 7
	SchedulingClass_SCHEDULING_CLASS_DEADLINE     SchedulingClass = 8
)

func (SchedulingClass) Descriptor

func (SchedulingClass) Enum

func (x SchedulingClass) Enum() *SchedulingClass

func (SchedulingClass) EnumDescriptor deprecated

func (SchedulingClass) EnumDescriptor() ([]byte, []int)

Deprecated: Use SchedulingClass.Descriptor instead.

func (SchedulingClass) Number

func (SchedulingClass) String

func (x SchedulingClass) String() string

func (SchedulingClass) Type

type ThreadStack

type ThreadStack struct {
	ThreadNumber int64    `protobuf:"varint,1,opt,name=thread_number,json=threadNumber,proto3" json:"thread_number,omitempty"`
	ThreadId     int64    `protobuf:"varint,2,opt,name=thread_id,json=threadId,proto3" json:"thread_id,omitempty"`
	Lwp          int64    `protobuf:"varint,3,opt,name=lwp,proto3" json:"lwp,omitempty"`
	Stacks       []string `protobuf:"bytes,4,rep,name=stacks,proto3" json:"stacks,omitempty"`
	// contains filtered or unexported fields
}

func (*ThreadStack) Descriptor deprecated

func (*ThreadStack) Descriptor() ([]byte, []int)

Deprecated: Use ThreadStack.ProtoReflect.Descriptor instead.

func (*ThreadStack) GetLwp

func (x *ThreadStack) GetLwp() int64

func (*ThreadStack) GetStacks

func (x *ThreadStack) GetStacks() []string

func (*ThreadStack) GetThreadId

func (x *ThreadStack) GetThreadId() int64

func (*ThreadStack) GetThreadNumber

func (x *ThreadStack) GetThreadNumber() int64

func (*ThreadStack) ProtoMessage

func (*ThreadStack) ProtoMessage()

func (*ThreadStack) ProtoReflect

func (x *ThreadStack) ProtoReflect() protoreflect.Message

func (*ThreadStack) Reset

func (x *ThreadStack) Reset()

func (*ThreadStack) String

func (x *ThreadStack) String() string

type UnimplementedProcessServer

type UnimplementedProcessServer struct {
}

UnimplementedProcessServer should be embedded to have forward compatible implementations.

func (UnimplementedProcessServer) GetJavaStacks

func (UnimplementedProcessServer) GetMemoryDump

func (UnimplementedProcessServer) GetStacks

func (UnimplementedProcessServer) Kill added in v1.3.0

func (UnimplementedProcessServer) List

type UnsafeProcessServer

type UnsafeProcessServer interface {
	// contains filtered or unexported methods
}

UnsafeProcessServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ProcessServer will result in compilation errors.

Directories

Path Synopsis
Package client provides the client interface for 'process'
Package client provides the client interface for 'process'
Package server implements the sansshell 'Process' service.
Package server implements the sansshell 'Process' service.

Jump to

Keyboard shortcuts

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