proxy

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ProxyStatus_name = map[int32]string{
		0: "Error",
		1: "Accepted",
		3: "Session",
		4: "EOF",
	}
	ProxyStatus_value = map[string]int32{
		"Error":    0,
		"Accepted": 1,
		"Session":  3,
		"EOF":      4,
	}
)

Enum value maps for ProxyStatus.

View Source
var (
	DnsResolvePath = "/proxy.Proxy/DnsResolve"
	ProxyPath      = "/proxy.Proxy/Proxy"
)
View Source
var File_proxy_proto protoreflect.FileDescriptor
View Source
var Proxy_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proxy.Proxy",
	HandlerType: (*ProxyServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "DnsResolve",
			Handler:       _Proxy_DnsResolve_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "Proxy",
			Handler:       _Proxy_Proxy_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "proxy.proto",
}

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

Functions

func RegisterProxyServer

func RegisterProxyServer(s grpc.ServiceRegistrar, srv ProxyServer)

func SetServiceName

func SetServiceName(name string)

Types

type DnsRequest

type DnsRequest struct {

	// user uuid
	Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"`
	// fqdn name
	Fqdn string `protobuf:"bytes,2,opt,name=fqdn,proto3" json:"fqdn,omitempty"`
	// enable ipv6
	Ipv6 bool `protobuf:"varint,3,opt,name=ipv6,proto3" json:"ipv6,omitempty"`
	// contains filtered or unexported fields
}

func (*DnsRequest) Descriptor deprecated

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

Deprecated: Use DnsRequest.ProtoReflect.Descriptor instead.

func (*DnsRequest) GetFqdn

func (x *DnsRequest) GetFqdn() string

func (*DnsRequest) GetIpv6

func (x *DnsRequest) GetIpv6() bool

func (*DnsRequest) GetUuid

func (x *DnsRequest) GetUuid() string

func (*DnsRequest) ProtoMessage

func (*DnsRequest) ProtoMessage()

func (*DnsRequest) ProtoReflect

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

func (*DnsRequest) Reset

func (x *DnsRequest) Reset()

func (*DnsRequest) String

func (x *DnsRequest) String() string

type DnsResponse

type DnsResponse struct {

	// fqdn name
	Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"`
	// fqdn resolved result
	Result string `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*DnsResponse) Descriptor deprecated

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

Deprecated: Use DnsResponse.ProtoReflect.Descriptor instead.

func (*DnsResponse) GetDomain

func (x *DnsResponse) GetDomain() string

func (*DnsResponse) GetResult

func (x *DnsResponse) GetResult() string

func (*DnsResponse) ProtoMessage

func (*DnsResponse) ProtoMessage()

func (*DnsResponse) ProtoReflect

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

func (*DnsResponse) Reset

func (x *DnsResponse) Reset()

func (*DnsResponse) String

func (x *DnsResponse) String() string

type ProxyClient

type ProxyClient interface {
	DnsResolve(ctx context.Context, opts ...grpc.CallOption) (Proxy_DnsResolveClient, error)
	Proxy(ctx context.Context, opts ...grpc.CallOption) (Proxy_ProxyClient, error)
}

ProxyClient is the client API for Proxy 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 NewProxyClient

func NewProxyClient(cc grpc.ClientConnInterface) ProxyClient

type ProxyDST

type ProxyDST struct {

	// status
	Status ProxyStatus `protobuf:"varint,1,opt,name=status,proto3,enum=proxy.ProxyStatus" json:"status,omitempty"`
	// data bytes
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // EOF if failed
	// bind addr
	Addr string `protobuf:"bytes,3,opt,name=addr,proto3" json:"addr,omitempty"`
	// contains filtered or unexported fields
}

func (*ProxyDST) Descriptor deprecated

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

Deprecated: Use ProxyDST.ProtoReflect.Descriptor instead.

func (*ProxyDST) GetAddr

func (x *ProxyDST) GetAddr() string

func (*ProxyDST) GetData

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

func (*ProxyDST) GetStatus

func (x *ProxyDST) GetStatus() ProxyStatus

func (*ProxyDST) ProtoMessage

func (*ProxyDST) ProtoMessage()

func (*ProxyDST) ProtoReflect

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

func (*ProxyDST) Reset

func (x *ProxyDST) Reset()

func (*ProxyDST) String

func (x *ProxyDST) String() string

type ProxySRC

type ProxySRC struct {

	// user id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// bytes
	Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// fqdn
	Fqdn string `protobuf:"bytes,3,opt,name=fqdn,proto3" json:"fqdn,omitempty"`
	// port
	Port uint32 `protobuf:"varint,4,opt,name=port,proto3" json:"port,omitempty"`
	// contains filtered or unexported fields
}

func (*ProxySRC) Descriptor deprecated

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

Deprecated: Use ProxySRC.ProtoReflect.Descriptor instead.

func (*ProxySRC) GetData

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

func (*ProxySRC) GetFqdn

func (x *ProxySRC) GetFqdn() string

func (*ProxySRC) GetId

func (x *ProxySRC) GetId() string

func (*ProxySRC) GetPort

func (x *ProxySRC) GetPort() uint32

func (*ProxySRC) ProtoMessage

func (*ProxySRC) ProtoMessage()

func (*ProxySRC) ProtoReflect

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

func (*ProxySRC) Reset

func (x *ProxySRC) Reset()

func (*ProxySRC) String

func (x *ProxySRC) String() string

type ProxyServer

type ProxyServer interface {
	DnsResolve(Proxy_DnsResolveServer) error
	Proxy(Proxy_ProxyServer) error
	// contains filtered or unexported methods
}

ProxyServer is the server API for Proxy service. All implementations must embed UnimplementedProxyServer for forward compatibility

type ProxyStatus

type ProxyStatus int32
const (
	ProxyStatus_Error    ProxyStatus = 0
	ProxyStatus_Accepted ProxyStatus = 1
	ProxyStatus_Session  ProxyStatus = 3
	ProxyStatus_EOF      ProxyStatus = 4
)

func (ProxyStatus) Descriptor

func (ProxyStatus) Enum

func (x ProxyStatus) Enum() *ProxyStatus

func (ProxyStatus) EnumDescriptor deprecated

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

Deprecated: Use ProxyStatus.Descriptor instead.

func (ProxyStatus) Number

func (x ProxyStatus) Number() protoreflect.EnumNumber

func (ProxyStatus) String

func (x ProxyStatus) String() string

func (ProxyStatus) Type

type Proxy_DnsResolveClient

type Proxy_DnsResolveClient interface {
	Send(*DnsRequest) error
	Recv() (*DnsResponse, error)
	grpc.ClientStream
}

type Proxy_DnsResolveServer

type Proxy_DnsResolveServer interface {
	Send(*DnsResponse) error
	Recv() (*DnsRequest, error)
	grpc.ServerStream
}

type Proxy_ProxyClient

type Proxy_ProxyClient interface {
	Send(*ProxySRC) error
	Recv() (*ProxyDST, error)
	grpc.ClientStream
}

type Proxy_ProxyServer

type Proxy_ProxyServer interface {
	Send(*ProxyDST) error
	Recv() (*ProxySRC, error)
	grpc.ServerStream
}

type UnimplementedProxyServer

type UnimplementedProxyServer struct {
}

UnimplementedProxyServer must be embedded to have forward compatible implementations.

func (UnimplementedProxyServer) DnsResolve

func (UnimplementedProxyServer) Proxy

type UnsafeProxyServer

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

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

Jump to

Keyboard shortcuts

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