base

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Scan_Run_FullMethodName = "/amaas.scan.v1.Scan/Run"
)

Variables

View Source
var (
	Stage_name = map[int32]string{
		0: "STAGE_INIT",
		1: "STAGE_RUN",
		2: "STAGE_FINI",
	}
	Stage_value = map[string]int32{
		"STAGE_INIT": 0,
		"STAGE_RUN":  1,
		"STAGE_FINI": 2,
	}
)

Enum value maps for Stage.

View Source
var (
	Command_name = map[int32]string{
		0: "CMD_RETR",
		1: "CMD_QUIT",
	}
	Command_value = map[string]int32{
		"CMD_RETR": 0,
		"CMD_QUIT": 1,
	}
)

Enum value maps for Command.

View Source
var Scan_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "amaas.scan.v1.Scan",
	HandlerType: (*ScanServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Run",
			Handler:       _Scan_Run_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "scan.proto",
}

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

Functions

func RegisterScanServer

func RegisterScanServer(s grpc.ServiceRegistrar, srv ScanServer)

Types

type C2S

type C2S struct {
	Stage         Stage    `protobuf:"varint,1,opt,name=stage,proto3,enum=amaas.scan.v1.Stage" json:"stage,omitempty"`
	FileName      string   `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
	RsSize        uint64   `protobuf:"varint,3,opt,name=rs_size,json=rsSize,proto3" json:"rs_size,omitempty"`
	Offset        int32    `protobuf:"varint,4,opt,name=offset,proto3" json:"offset,omitempty"`
	Chunk         []byte   `protobuf:"bytes,5,opt,name=chunk,proto3" json:"chunk,omitempty"`
	Trendx        bool     `protobuf:"varint,6,opt,name=trendx,proto3" json:"trendx,omitempty"`
	FileSha1      string   `protobuf:"bytes,7,opt,name=file_sha1,json=fileSha1,proto3" json:"file_sha1,omitempty"`
	FileSha256    string   `protobuf:"bytes,8,opt,name=file_sha256,json=fileSha256,proto3" json:"file_sha256,omitempty"`
	Tags          []string `protobuf:"bytes,9,rep,name=tags,proto3" json:"tags,omitempty"`
	Bulk          bool     `protobuf:"varint,10,opt,name=bulk,proto3" json:"bulk,omitempty"`
	SpnFeedback   bool     `protobuf:"varint,11,opt,name=spn_feedback,json=spnFeedback,proto3" json:"spn_feedback,omitempty"`
	Verbose       bool     `protobuf:"varint,12,opt,name=verbose,proto3" json:"verbose,omitempty"`
	ActiveContent bool     `protobuf:"varint,13,opt,name=active_content,json=activeContent,proto3" json:"active_content,omitempty"`
	// contains filtered or unexported fields
}

func (*C2S) Descriptor deprecated

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

Deprecated: Use C2S.ProtoReflect.Descriptor instead.

func (*C2S) GetActiveContent added in v1.6.0

func (x *C2S) GetActiveContent() bool

func (*C2S) GetBulk

func (x *C2S) GetBulk() bool

func (*C2S) GetChunk

func (x *C2S) GetChunk() []byte

func (*C2S) GetFileName

func (x *C2S) GetFileName() string

func (*C2S) GetFileSha1

func (x *C2S) GetFileSha1() string

func (*C2S) GetFileSha256

func (x *C2S) GetFileSha256() string

func (*C2S) GetOffset

func (x *C2S) GetOffset() int32

func (*C2S) GetRsSize

func (x *C2S) GetRsSize() uint64

func (*C2S) GetSpnFeedback

func (x *C2S) GetSpnFeedback() bool

func (*C2S) GetStage

func (x *C2S) GetStage() Stage

func (*C2S) GetTags

func (x *C2S) GetTags() []string

func (*C2S) GetTrendx

func (x *C2S) GetTrendx() bool

func (*C2S) GetVerbose added in v1.2.0

func (x *C2S) GetVerbose() bool

func (*C2S) ProtoMessage

func (*C2S) ProtoMessage()

func (*C2S) ProtoReflect

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

func (*C2S) Reset

func (x *C2S) Reset()

func (*C2S) String

func (x *C2S) String() string

type Command

type Command int32
const (
	Command_CMD_RETR Command = 0
	Command_CMD_QUIT Command = 1
)

func (Command) Descriptor

func (Command) Descriptor() protoreflect.EnumDescriptor

func (Command) Enum

func (x Command) Enum() *Command

func (Command) EnumDescriptor deprecated

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

Deprecated: Use Command.Descriptor instead.

func (Command) Number

func (x Command) Number() protoreflect.EnumNumber

func (Command) String

func (x Command) String() string

func (Command) Type

func (Command) Type() protoreflect.EnumType

type S2C

type S2C struct {
	Stage      Stage   `protobuf:"varint,1,opt,name=stage,proto3,enum=amaas.scan.v1.Stage" json:"stage,omitempty"`
	Cmd        Command `protobuf:"varint,2,opt,name=cmd,proto3,enum=amaas.scan.v1.Command" json:"cmd,omitempty"`
	Offset     int32   `protobuf:"varint,3,opt,name=offset,proto3" json:"offset,omitempty"`
	Length     int32   `protobuf:"varint,4,opt,name=length,proto3" json:"length,omitempty"`
	Result     string  `protobuf:"bytes,5,opt,name=result,proto3" json:"result,omitempty"`
	BulkOffset []int32 `protobuf:"varint,6,rep,packed,name=bulk_offset,json=bulkOffset,proto3" json:"bulk_offset,omitempty"`
	BulkLength []int32 `protobuf:"varint,7,rep,packed,name=bulk_length,json=bulkLength,proto3" json:"bulk_length,omitempty"`
	SessionId  string  `protobuf:"bytes,8,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	// contains filtered or unexported fields
}

func (*S2C) Descriptor deprecated

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

Deprecated: Use S2C.ProtoReflect.Descriptor instead.

func (*S2C) GetBulkLength

func (x *S2C) GetBulkLength() []int32

func (*S2C) GetBulkOffset

func (x *S2C) GetBulkOffset() []int32

func (*S2C) GetCmd

func (x *S2C) GetCmd() Command

func (*S2C) GetLength

func (x *S2C) GetLength() int32

func (*S2C) GetOffset

func (x *S2C) GetOffset() int32

func (*S2C) GetResult

func (x *S2C) GetResult() string

func (*S2C) GetSessionId

func (x *S2C) GetSessionId() string

func (*S2C) GetStage

func (x *S2C) GetStage() Stage

func (*S2C) ProtoMessage

func (*S2C) ProtoMessage()

func (*S2C) ProtoReflect

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

func (*S2C) Reset

func (x *S2C) Reset()

func (*S2C) String

func (x *S2C) String() string

type ScanClient

type ScanClient interface {
	Run(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[C2S, S2C], error)
}

ScanClient is the client API for Scan 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.

Interface exported by the server.

func NewScanClient

func NewScanClient(cc grpc.ClientConnInterface) ScanClient

type ScanServer

type ScanServer interface {
	Run(grpc.BidiStreamingServer[C2S, S2C]) error
	// contains filtered or unexported methods
}

ScanServer is the server API for Scan service. All implementations must embed UnimplementedScanServer for forward compatibility.

Interface exported by the server.

type Scan_RunClient

type Scan_RunClient = grpc.BidiStreamingClient[C2S, S2C]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Scan_RunServer

type Scan_RunServer = grpc.BidiStreamingServer[C2S, S2C]

This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.

type Stage

type Stage int32
const (
	Stage_STAGE_INIT Stage = 0
	Stage_STAGE_RUN  Stage = 1
	Stage_STAGE_FINI Stage = 2
)

func (Stage) Descriptor

func (Stage) Descriptor() protoreflect.EnumDescriptor

func (Stage) Enum

func (x Stage) Enum() *Stage

func (Stage) EnumDescriptor deprecated

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

Deprecated: Use Stage.Descriptor instead.

func (Stage) Number

func (x Stage) Number() protoreflect.EnumNumber

func (Stage) String

func (x Stage) String() string

func (Stage) Type

func (Stage) Type() protoreflect.EnumType

type UnimplementedScanServer

type UnimplementedScanServer struct{}

UnimplementedScanServer must 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 (UnimplementedScanServer) Run

type UnsafeScanServer

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

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

Jump to

Keyboard shortcuts

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