vpnproxy

package
v0.12.18 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCode_name = map[int32]string{
		0: "NO_ERROR",
		1: "INTERNAL_SERVER_ERROR",
		2: "INSTANCE_NOT_FOUND",
		3: "PROXY_IS_FULL",
		4: "INVALID_ACCESS_TOKEN",
		5: "VPN_SESSION_EXPIRED",
		6: "MAX_PARALLEL_VPN_LIMIT",
		7: "INVALID_PREFERRED_PORT",
		8: "PREFERRED_PORT_UNAVAILABLE",
	}
	ErrorCode_value = map[string]int32{
		"NO_ERROR":                   0,
		"INTERNAL_SERVER_ERROR":      1,
		"INSTANCE_NOT_FOUND":         2,
		"PROXY_IS_FULL":              3,
		"INVALID_ACCESS_TOKEN":       4,
		"VPN_SESSION_EXPIRED":        5,
		"MAX_PARALLEL_VPN_LIMIT":     6,
		"INVALID_PREFERRED_PORT":     7,
		"PREFERRED_PORT_UNAVAILABLE": 8,
	}
)

Enum value maps for ErrorCode.

View Source
var File_zeropsVpnProtocol_proto protoreflect.FileDescriptor

Functions

func FromProtoIP

func FromProtoIP(m *IP) net.IP

func FromProtoIPRange

func FromProtoIPRange(m *IPRange) net.IPNet

func FromProtoTimestamp

func FromProtoTimestamp(t *Timestamp) time.Time

func IsInternal

func IsInternal(resp interface{}) bool

func RegisterZeropsVpnProtocolServer

func RegisterZeropsVpnProtocolServer(s *grpc.Server, srv ZeropsVpnProtocolServer)

Types

type Error

type Error struct {
	Code    ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=zeropsVpnProtocol.ErrorCode" json:"code,omitempty"`
	Message string    `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() ErrorCode

func (*Error) GetCodeInt

func (x *Error) GetCodeInt() int

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) GetMeta

func (x *Error) GetMeta() []byte

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type ErrorCode

type ErrorCode int32
const (
	ErrorCode_NO_ERROR                   ErrorCode = 0
	ErrorCode_INTERNAL_SERVER_ERROR      ErrorCode = 1
	ErrorCode_INSTANCE_NOT_FOUND         ErrorCode = 2
	ErrorCode_PROXY_IS_FULL              ErrorCode = 3
	ErrorCode_INVALID_ACCESS_TOKEN       ErrorCode = 4
	ErrorCode_VPN_SESSION_EXPIRED        ErrorCode = 5
	ErrorCode_MAX_PARALLEL_VPN_LIMIT     ErrorCode = 6
	ErrorCode_INVALID_PREFERRED_PORT     ErrorCode = 7
	ErrorCode_PREFERRED_PORT_UNAVAILABLE ErrorCode = 8
)

func (ErrorCode) Descriptor

func (ErrorCode) Descriptor() protoreflect.EnumDescriptor

func (ErrorCode) Enum

func (x ErrorCode) Enum() *ErrorCode

func (ErrorCode) EnumDescriptor deprecated

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

Deprecated: Use ErrorCode.Descriptor instead.

func (ErrorCode) Number

func (x ErrorCode) Number() protoreflect.EnumNumber

func (ErrorCode) String

func (x ErrorCode) String() string

func (ErrorCode) Type

type IP

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

func ToProtoIP

func ToProtoIP(ip net.IP) *IP

func (*IP) Descriptor deprecated

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

Deprecated: Use IP.ProtoReflect.Descriptor instead.

func (*IP) GetAddress

func (x *IP) GetAddress() []byte

func (*IP) ProtoMessage

func (*IP) ProtoMessage()

func (*IP) ProtoReflect

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

func (*IP) Reset

func (x *IP) Reset()

func (*IP) String

func (x *IP) String() string

type IPRange

type IPRange struct {
	Ip   []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
	Mask []byte `protobuf:"bytes,2,opt,name=mask,proto3" json:"mask,omitempty"`
	// contains filtered or unexported fields
}

func ToProtoIpNet

func ToProtoIpNet(ipNet *net.IPNet) *IPRange

func (*IPRange) Descriptor deprecated

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

Deprecated: Use IPRange.ProtoReflect.Descriptor instead.

func (*IPRange) GetIp

func (x *IPRange) GetIp() []byte

func (*IPRange) GetMask

func (x *IPRange) GetMask() []byte

func (*IPRange) ProtoMessage

func (*IPRange) ProtoMessage()

func (*IPRange) ProtoReflect

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

func (*IPRange) Reset

func (x *IPRange) Reset()

func (*IPRange) String

func (x *IPRange) String() string

type ProlongVpnRequest

type ProlongVpnRequest struct {
	AccessToken string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	// contains filtered or unexported fields
}

func (*ProlongVpnRequest) Descriptor deprecated

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

Deprecated: Use ProlongVpnRequest.ProtoReflect.Descriptor instead.

func (*ProlongVpnRequest) GetAccessToken

func (x *ProlongVpnRequest) GetAccessToken() string

func (*ProlongVpnRequest) ProtoMessage

func (*ProlongVpnRequest) ProtoMessage()

func (*ProlongVpnRequest) ProtoReflect

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

func (*ProlongVpnRequest) Reset

func (x *ProlongVpnRequest) Reset()

func (*ProlongVpnRequest) String

func (x *ProlongVpnRequest) String() string

type ProlongVpnResponse

type ProlongVpnResponse struct {
	Error *Error `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ProlongVpnResponse) Descriptor deprecated

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

Deprecated: Use ProlongVpnResponse.ProtoReflect.Descriptor instead.

func (*ProlongVpnResponse) GetError

func (x *ProlongVpnResponse) GetError() *Error

func (*ProlongVpnResponse) ProtoMessage

func (*ProlongVpnResponse) ProtoMessage()

func (*ProlongVpnResponse) ProtoReflect

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

func (*ProlongVpnResponse) Reset

func (x *ProlongVpnResponse) Reset()

func (*ProlongVpnResponse) String

func (x *ProlongVpnResponse) String() string

type StartVpnOutDto

type StartVpnOutDto struct {
	Port             int64    `protobuf:"varint,1,opt,name=port,proto3" json:"port,omitempty"`
	ServerPublicKey  string   `protobuf:"bytes,2,opt,name=serverPublicKey,proto3" json:"serverPublicKey,omitempty"`
	AssignedClientIp *IP      `protobuf:"bytes,3,opt,name=assignedClientIp,proto3" json:"assignedClientIp,omitempty"`
	ServerIp         *IP      `protobuf:"bytes,4,opt,name=serverIp,proto3" json:"serverIp,omitempty"`
	VpnIpRange       *IPRange `protobuf:"bytes,5,opt,name=vpnIpRange,proto3" json:"vpnIpRange,omitempty"`
	DnsIp            *IP      `protobuf:"bytes,6,opt,name=dnsIp,proto3" json:"dnsIp,omitempty"`
	// contains filtered or unexported fields
}

func (*StartVpnOutDto) Descriptor deprecated

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

Deprecated: Use StartVpnOutDto.ProtoReflect.Descriptor instead.

func (*StartVpnOutDto) GetAssignedClientIp

func (x *StartVpnOutDto) GetAssignedClientIp() *IP

func (*StartVpnOutDto) GetDnsIp

func (x *StartVpnOutDto) GetDnsIp() *IP

func (*StartVpnOutDto) GetPort

func (x *StartVpnOutDto) GetPort() int64

func (*StartVpnOutDto) GetServerIp

func (x *StartVpnOutDto) GetServerIp() *IP

func (*StartVpnOutDto) GetServerPublicKey

func (x *StartVpnOutDto) GetServerPublicKey() string

func (*StartVpnOutDto) GetVpnIpRange

func (x *StartVpnOutDto) GetVpnIpRange() *IPRange

func (*StartVpnOutDto) ProtoMessage

func (*StartVpnOutDto) ProtoMessage()

func (*StartVpnOutDto) ProtoReflect

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

func (*StartVpnOutDto) Reset

func (x *StartVpnOutDto) Reset()

func (*StartVpnOutDto) String

func (x *StartVpnOutDto) String() string

type StartVpnRequest

type StartVpnRequest struct {
	AccessToken      string `protobuf:"bytes,1,opt,name=accessToken,proto3" json:"accessToken,omitempty"`
	PreferredPortMin uint32 `protobuf:"varint,2,opt,name=preferredPortMin,proto3" json:"preferredPortMin,omitempty"`
	PreferredPortMax uint32 `protobuf:"varint,3,opt,name=preferredPortMax,proto3" json:"preferredPortMax,omitempty"`
	// contains filtered or unexported fields
}

func (*StartVpnRequest) Descriptor deprecated

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

Deprecated: Use StartVpnRequest.ProtoReflect.Descriptor instead.

func (*StartVpnRequest) GetAccessToken

func (x *StartVpnRequest) GetAccessToken() string

func (*StartVpnRequest) GetPreferredPortMax

func (x *StartVpnRequest) GetPreferredPortMax() uint32

func (*StartVpnRequest) GetPreferredPortMin

func (x *StartVpnRequest) GetPreferredPortMin() uint32

func (*StartVpnRequest) ProtoMessage

func (*StartVpnRequest) ProtoMessage()

func (*StartVpnRequest) ProtoReflect

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

func (*StartVpnRequest) Reset

func (x *StartVpnRequest) Reset()

func (*StartVpnRequest) String

func (x *StartVpnRequest) String() string

type StartVpnResponse

type StartVpnResponse struct {
	Error *Error          `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	Vpn   *StartVpnOutDto `protobuf:"bytes,2,opt,name=vpn,proto3" json:"vpn,omitempty"`
	// contains filtered or unexported fields
}

func (*StartVpnResponse) Descriptor deprecated

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

Deprecated: Use StartVpnResponse.ProtoReflect.Descriptor instead.

func (*StartVpnResponse) GetError

func (x *StartVpnResponse) GetError() *Error

func (*StartVpnResponse) GetVpn

func (x *StartVpnResponse) GetVpn() *StartVpnOutDto

func (*StartVpnResponse) ProtoMessage

func (*StartVpnResponse) ProtoMessage()

func (*StartVpnResponse) ProtoReflect

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

func (*StartVpnResponse) Reset

func (x *StartVpnResponse) Reset()

func (*StartVpnResponse) String

func (x *StartVpnResponse) String() string

type Timestamp

type Timestamp struct {
	IsSet   bool  `protobuf:"varint,1,opt,name=isSet,proto3" json:"isSet,omitempty"`
	Seconds int64 `protobuf:"varint,2,opt,name=seconds,proto3" json:"seconds,omitempty"`
	Nanos   int32 `protobuf:"varint,3,opt,name=nanos,proto3" json:"nanos,omitempty"`
	// contains filtered or unexported fields
}

func ToProtoTimestamp

func ToProtoTimestamp(t time.Time) *Timestamp

func (*Timestamp) Descriptor deprecated

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

Deprecated: Use Timestamp.ProtoReflect.Descriptor instead.

func (*Timestamp) GetIsSet

func (x *Timestamp) GetIsSet() bool

func (*Timestamp) GetNanos

func (x *Timestamp) GetNanos() int32

func (*Timestamp) GetSeconds

func (x *Timestamp) GetSeconds() int64

func (*Timestamp) ProtoMessage

func (*Timestamp) ProtoMessage()

func (*Timestamp) ProtoReflect

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

func (*Timestamp) Reset

func (x *Timestamp) Reset()

func (*Timestamp) String

func (x *Timestamp) String() string

type UnimplementedZeropsVpnProtocolServer

type UnimplementedZeropsVpnProtocolServer struct {
}

UnimplementedZeropsVpnProtocolServer can be embedded to have forward compatible implementations.

func (*UnimplementedZeropsVpnProtocolServer) ProlongVpn

func (*UnimplementedZeropsVpnProtocolServer) StartVpn

type ZeropsVpnProtocolClient

type ZeropsVpnProtocolClient interface {
	StartVpn(ctx context.Context, in *StartVpnRequest, opts ...grpc.CallOption) (*StartVpnResponse, error)
	ProlongVpn(ctx context.Context, in *ProlongVpnRequest, opts ...grpc.CallOption) (*ProlongVpnResponse, error)
}

ZeropsVpnProtocolClient is the client API for ZeropsVpnProtocol service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func CreateClient

func CreateClient(ctx context.Context, targetAddress string) (_ ZeropsVpnProtocolClient, closeFunc func(), _ error)

type ZeropsVpnProtocolServer

type ZeropsVpnProtocolServer interface {
	StartVpn(context.Context, *StartVpnRequest) (*StartVpnResponse, error)
	ProlongVpn(context.Context, *ProlongVpnRequest) (*ProlongVpnResponse, error)
}

ZeropsVpnProtocolServer is the server API for ZeropsVpnProtocol service.

Jump to

Keyboard shortcuts

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