wg

package
v0.0.0-...-eeb3e7f Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnreachableVPNServiceErr = errors.New("Wireguard service is not running !")
	UnauthorizedErr          = errors.New("Unauthorized attempt to use VPN service ")
	NoTokenErrMsg            = "token contains an invalid number of segments"
	UnauthorizeErrMsg        = "unauthorized"
	AUTH_KEY                 = "wg"
)

Functions

func RegisterWireguardServer

func RegisterWireguardServer(s *grpc.Server, srv WireguardServer)

func TranslateRPCErr

func TranslateRPCErr(err error) error

Types

type AddPReq

type AddPReq struct {
	Nic                  string   `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"`
	AllowedIPs           string   `protobuf:"bytes,2,opt,name=allowedIPs,proto3" json:"allowedIPs,omitempty"`
	PublicKey            string   `protobuf:"bytes,3,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddPReq) Descriptor

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

func (*AddPReq) GetAllowedIPs

func (m *AddPReq) GetAllowedIPs() string

func (*AddPReq) GetNic

func (m *AddPReq) GetNic() string

func (*AddPReq) GetPublicKey

func (m *AddPReq) GetPublicKey() string

func (*AddPReq) ProtoMessage

func (*AddPReq) ProtoMessage()

func (*AddPReq) Reset

func (m *AddPReq) Reset()

func (*AddPReq) String

func (m *AddPReq) String() string

func (*AddPReq) XXX_DiscardUnknown

func (m *AddPReq) XXX_DiscardUnknown()

func (*AddPReq) XXX_Marshal

func (m *AddPReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddPReq) XXX_Merge

func (m *AddPReq) XXX_Merge(src proto.Message)

func (*AddPReq) XXX_Size

func (m *AddPReq) XXX_Size() int

func (*AddPReq) XXX_Unmarshal

func (m *AddPReq) XXX_Unmarshal(b []byte) error

type AddPResp

type AddPResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*AddPResp) Descriptor

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

func (*AddPResp) GetMessage

func (m *AddPResp) GetMessage() string

func (*AddPResp) ProtoMessage

func (*AddPResp) ProtoMessage()

func (*AddPResp) Reset

func (m *AddPResp) Reset()

func (*AddPResp) String

func (m *AddPResp) String() string

func (*AddPResp) XXX_DiscardUnknown

func (m *AddPResp) XXX_DiscardUnknown()

func (*AddPResp) XXX_Marshal

func (m *AddPResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AddPResp) XXX_Merge

func (m *AddPResp) XXX_Merge(src proto.Message)

func (*AddPResp) XXX_Size

func (m *AddPResp) XXX_Size() int

func (*AddPResp) XXX_Unmarshal

func (m *AddPResp) XXX_Unmarshal(b []byte) error

type Creds

type Creds struct {
	Token    string
	Insecure bool
}

func (Creds) GetRequestMetadata

func (c Creds) GetRequestMetadata(context.Context, ...string) (map[string]string, error)

func (Creds) RequireTransportSecurity

func (c Creds) RequireTransportSecurity() bool

type DelPReq

type DelPReq struct {
	PeerPublicKey        string   `protobuf:"bytes,1,opt,name=peerPublicKey,proto3" json:"peerPublicKey,omitempty"`
	IpAddress            string   `protobuf:"bytes,2,opt,name=ipAddress,proto3" json:"ipAddress,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DelPReq) Descriptor

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

func (*DelPReq) GetIpAddress

func (m *DelPReq) GetIpAddress() string

func (*DelPReq) GetPeerPublicKey

func (m *DelPReq) GetPeerPublicKey() string

func (*DelPReq) ProtoMessage

func (*DelPReq) ProtoMessage()

func (*DelPReq) Reset

func (m *DelPReq) Reset()

func (*DelPReq) String

func (m *DelPReq) String() string

func (*DelPReq) XXX_DiscardUnknown

func (m *DelPReq) XXX_DiscardUnknown()

func (*DelPReq) XXX_Marshal

func (m *DelPReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DelPReq) XXX_Merge

func (m *DelPReq) XXX_Merge(src proto.Message)

func (*DelPReq) XXX_Size

func (m *DelPReq) XXX_Size() int

func (*DelPReq) XXX_Unmarshal

func (m *DelPReq) XXX_Unmarshal(b []byte) error

type DelPResp

type DelPResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*DelPResp) Descriptor

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

func (*DelPResp) GetMessage

func (m *DelPResp) GetMessage() string

func (*DelPResp) ProtoMessage

func (*DelPResp) ProtoMessage()

func (*DelPResp) Reset

func (m *DelPResp) Reset()

func (*DelPResp) String

func (m *DelPResp) String() string

func (*DelPResp) XXX_DiscardUnknown

func (m *DelPResp) XXX_DiscardUnknown()

func (*DelPResp) XXX_Marshal

func (m *DelPResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DelPResp) XXX_Merge

func (m *DelPResp) XXX_Merge(src proto.Message)

func (*DelPResp) XXX_Size

func (m *DelPResp) XXX_Size() int

func (*DelPResp) XXX_Unmarshal

func (m *DelPResp) XXX_Unmarshal(b []byte) error

type IReq

type IReq struct {
	Address              string   `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	ListenPort           uint32   `protobuf:"varint,2,opt,name=listenPort,proto3" json:"listenPort,omitempty"`
	SaveConfig           bool     `protobuf:"varint,3,opt,name=saveConfig,proto3" json:"saveConfig,omitempty"`
	PrivateKey           string   `protobuf:"bytes,4,opt,name=privateKey,proto3" json:"privateKey,omitempty"`
	Eth                  string   `protobuf:"bytes,5,opt,name=eth,proto3" json:"eth,omitempty"`
	IName                string   `protobuf:"bytes,6,opt,name=iName,proto3" json:"iName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*IReq) Descriptor

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

func (*IReq) GetAddress

func (m *IReq) GetAddress() string

func (*IReq) GetEth

func (m *IReq) GetEth() string

func (*IReq) GetIName

func (m *IReq) GetIName() string

func (*IReq) GetListenPort

func (m *IReq) GetListenPort() uint32

func (*IReq) GetPrivateKey

func (m *IReq) GetPrivateKey() string

func (*IReq) GetSaveConfig

func (m *IReq) GetSaveConfig() bool

func (*IReq) ProtoMessage

func (*IReq) ProtoMessage()

func (*IReq) Reset

func (m *IReq) Reset()

func (*IReq) String

func (m *IReq) String() string

func (*IReq) XXX_DiscardUnknown

func (m *IReq) XXX_DiscardUnknown()

func (*IReq) XXX_Marshal

func (m *IReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IReq) XXX_Merge

func (m *IReq) XXX_Merge(src proto.Message)

func (*IReq) XXX_Size

func (m *IReq) XXX_Size() int

func (*IReq) XXX_Unmarshal

func (m *IReq) XXX_Unmarshal(b []byte) error

type IResp

type IResp struct {
	// message could be error or ordinary result depend on function result.
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*IResp) Descriptor

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

func (*IResp) GetMessage

func (m *IResp) GetMessage() string

func (*IResp) ProtoMessage

func (*IResp) ProtoMessage()

func (*IResp) Reset

func (m *IResp) Reset()

func (*IResp) String

func (m *IResp) String() string

func (*IResp) XXX_DiscardUnknown

func (m *IResp) XXX_DiscardUnknown()

func (*IResp) XXX_Marshal

func (m *IResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*IResp) XXX_Merge

func (m *IResp) XXX_Merge(src proto.Message)

func (*IResp) XXX_Size

func (m *IResp) XXX_Size() int

func (*IResp) XXX_Unmarshal

func (m *IResp) XXX_Unmarshal(b []byte) error

type ListPeersReq

type ListPeersReq struct {
	Nicname              string   `protobuf:"bytes,1,opt,name=nicname,proto3" json:"nicname,omitempty"`
	Error                string   `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListPeersReq) Descriptor

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

func (*ListPeersReq) GetError

func (m *ListPeersReq) GetError() string

func (*ListPeersReq) GetNicname

func (m *ListPeersReq) GetNicname() string

func (*ListPeersReq) ProtoMessage

func (*ListPeersReq) ProtoMessage()

func (*ListPeersReq) Reset

func (m *ListPeersReq) Reset()

func (*ListPeersReq) String

func (m *ListPeersReq) String() string

func (*ListPeersReq) XXX_DiscardUnknown

func (m *ListPeersReq) XXX_DiscardUnknown()

func (*ListPeersReq) XXX_Marshal

func (m *ListPeersReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListPeersReq) XXX_Merge

func (m *ListPeersReq) XXX_Merge(src proto.Message)

func (*ListPeersReq) XXX_Size

func (m *ListPeersReq) XXX_Size() int

func (*ListPeersReq) XXX_Unmarshal

func (m *ListPeersReq) XXX_Unmarshal(b []byte) error

type ListPeersResp

type ListPeersResp struct {
	Response             string   `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ListPeersResp) Descriptor

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

func (*ListPeersResp) GetResponse

func (m *ListPeersResp) GetResponse() string

func (*ListPeersResp) ProtoMessage

func (*ListPeersResp) ProtoMessage()

func (*ListPeersResp) Reset

func (m *ListPeersResp) Reset()

func (*ListPeersResp) String

func (m *ListPeersResp) String() string

func (*ListPeersResp) XXX_DiscardUnknown

func (m *ListPeersResp) XXX_DiscardUnknown()

func (*ListPeersResp) XXX_Marshal

func (m *ListPeersResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ListPeersResp) XXX_Merge

func (m *ListPeersResp) XXX_Merge(src proto.Message)

func (*ListPeersResp) XXX_Size

func (m *ListPeersResp) XXX_Size() int

func (*ListPeersResp) XXX_Unmarshal

func (m *ListPeersResp) XXX_Unmarshal(b []byte) error

type ManageNICReq

type ManageNICReq struct {
	//    manage NIC is responsible to up and down given interface
	Nic                  string   `protobuf:"bytes,1,opt,name=nic,proto3" json:"nic,omitempty"`
	Cmd                  string   `protobuf:"bytes,2,opt,name=cmd,proto3" json:"cmd,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ManageNICReq) Descriptor

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

func (*ManageNICReq) GetCmd

func (m *ManageNICReq) GetCmd() string

func (*ManageNICReq) GetNic

func (m *ManageNICReq) GetNic() string

func (*ManageNICReq) ProtoMessage

func (*ManageNICReq) ProtoMessage()

func (*ManageNICReq) Reset

func (m *ManageNICReq) Reset()

func (*ManageNICReq) String

func (m *ManageNICReq) String() string

func (*ManageNICReq) XXX_DiscardUnknown

func (m *ManageNICReq) XXX_DiscardUnknown()

func (*ManageNICReq) XXX_Marshal

func (m *ManageNICReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ManageNICReq) XXX_Merge

func (m *ManageNICReq) XXX_Merge(src proto.Message)

func (*ManageNICReq) XXX_Size

func (m *ManageNICReq) XXX_Size() int

func (*ManageNICReq) XXX_Unmarshal

func (m *ManageNICReq) XXX_Unmarshal(b []byte) error

type ManageNICResp

type ManageNICResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ManageNICResp) Descriptor

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

func (*ManageNICResp) GetMessage

func (m *ManageNICResp) GetMessage() string

func (*ManageNICResp) ProtoMessage

func (*ManageNICResp) ProtoMessage()

func (*ManageNICResp) Reset

func (m *ManageNICResp) Reset()

func (*ManageNICResp) String

func (m *ManageNICResp) String() string

func (*ManageNICResp) XXX_DiscardUnknown

func (m *ManageNICResp) XXX_DiscardUnknown()

func (*ManageNICResp) XXX_Marshal

func (m *ManageNICResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ManageNICResp) XXX_Merge

func (m *ManageNICResp) XXX_Merge(src proto.Message)

func (*ManageNICResp) XXX_Size

func (m *ManageNICResp) XXX_Size() int

func (*ManageNICResp) XXX_Unmarshal

func (m *ManageNICResp) XXX_Unmarshal(b []byte) error

type NICInfoReq

type NICInfoReq struct {
	Interface            string   `protobuf:"bytes,1,opt,name=interface,proto3" json:"interface,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NICInfoReq) Descriptor

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

func (*NICInfoReq) GetInterface

func (m *NICInfoReq) GetInterface() string

func (*NICInfoReq) ProtoMessage

func (*NICInfoReq) ProtoMessage()

func (*NICInfoReq) Reset

func (m *NICInfoReq) Reset()

func (*NICInfoReq) String

func (m *NICInfoReq) String() string

func (*NICInfoReq) XXX_DiscardUnknown

func (m *NICInfoReq) XXX_DiscardUnknown()

func (*NICInfoReq) XXX_Marshal

func (m *NICInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NICInfoReq) XXX_Merge

func (m *NICInfoReq) XXX_Merge(src proto.Message)

func (*NICInfoReq) XXX_Size

func (m *NICInfoReq) XXX_Size() int

func (*NICInfoReq) XXX_Unmarshal

func (m *NICInfoReq) XXX_Unmarshal(b []byte) error

type NICInfoResp

type NICInfoResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NICInfoResp) Descriptor

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

func (*NICInfoResp) GetMessage

func (m *NICInfoResp) GetMessage() string

func (*NICInfoResp) ProtoMessage

func (*NICInfoResp) ProtoMessage()

func (*NICInfoResp) Reset

func (m *NICInfoResp) Reset()

func (*NICInfoResp) String

func (m *NICInfoResp) String() string

func (*NICInfoResp) XXX_DiscardUnknown

func (m *NICInfoResp) XXX_DiscardUnknown()

func (*NICInfoResp) XXX_Marshal

func (m *NICInfoResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NICInfoResp) XXX_Merge

func (m *NICInfoResp) XXX_Merge(src proto.Message)

func (*NICInfoResp) XXX_Size

func (m *NICInfoResp) XXX_Size() int

func (*NICInfoResp) XXX_Unmarshal

func (m *NICInfoResp) XXX_Unmarshal(b []byte) error

type PeerStatusReq

type PeerStatusReq struct {
	NicName              string   `protobuf:"bytes,1,opt,name=nicName,proto3" json:"nicName,omitempty"`
	PublicKey            string   `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PeerStatusReq) Descriptor

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

func (*PeerStatusReq) GetNicName

func (m *PeerStatusReq) GetNicName() string

func (*PeerStatusReq) GetPublicKey

func (m *PeerStatusReq) GetPublicKey() string

func (*PeerStatusReq) ProtoMessage

func (*PeerStatusReq) ProtoMessage()

func (*PeerStatusReq) Reset

func (m *PeerStatusReq) Reset()

func (*PeerStatusReq) String

func (m *PeerStatusReq) String() string

func (*PeerStatusReq) XXX_DiscardUnknown

func (m *PeerStatusReq) XXX_DiscardUnknown()

func (*PeerStatusReq) XXX_Marshal

func (m *PeerStatusReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerStatusReq) XXX_Merge

func (m *PeerStatusReq) XXX_Merge(src proto.Message)

func (*PeerStatusReq) XXX_Size

func (m *PeerStatusReq) XXX_Size() int

func (*PeerStatusReq) XXX_Unmarshal

func (m *PeerStatusReq) XXX_Unmarshal(b []byte) error

type PeerStatusResp

type PeerStatusResp struct {
	// connected or not connected
	Status               bool     `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PeerStatusResp) Descriptor

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

func (*PeerStatusResp) GetStatus

func (m *PeerStatusResp) GetStatus() bool

func (*PeerStatusResp) ProtoMessage

func (*PeerStatusResp) ProtoMessage()

func (*PeerStatusResp) Reset

func (m *PeerStatusResp) Reset()

func (*PeerStatusResp) String

func (m *PeerStatusResp) String() string

func (*PeerStatusResp) XXX_DiscardUnknown

func (m *PeerStatusResp) XXX_DiscardUnknown()

func (*PeerStatusResp) XXX_Marshal

func (m *PeerStatusResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PeerStatusResp) XXX_Merge

func (m *PeerStatusResp) XXX_Merge(src proto.Message)

func (*PeerStatusResp) XXX_Size

func (m *PeerStatusResp) XXX_Size() int

func (*PeerStatusResp) XXX_Unmarshal

func (m *PeerStatusResp) XXX_Unmarshal(b []byte) error

type PrivKeyReq

type PrivKeyReq struct {
	PrivateKeyName       string   `protobuf:"bytes,1,opt,name=privateKeyName,proto3" json:"privateKeyName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrivKeyReq) Descriptor

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

func (*PrivKeyReq) GetPrivateKeyName

func (m *PrivKeyReq) GetPrivateKeyName() string

func (*PrivKeyReq) ProtoMessage

func (*PrivKeyReq) ProtoMessage()

func (*PrivKeyReq) Reset

func (m *PrivKeyReq) Reset()

func (*PrivKeyReq) String

func (m *PrivKeyReq) String() string

func (*PrivKeyReq) XXX_DiscardUnknown

func (m *PrivKeyReq) XXX_DiscardUnknown()

func (*PrivKeyReq) XXX_Marshal

func (m *PrivKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrivKeyReq) XXX_Merge

func (m *PrivKeyReq) XXX_Merge(src proto.Message)

func (*PrivKeyReq) XXX_Size

func (m *PrivKeyReq) XXX_Size() int

func (*PrivKeyReq) XXX_Unmarshal

func (m *PrivKeyReq) XXX_Unmarshal(b []byte) error

type PrivKeyResp

type PrivKeyResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PrivKeyResp) Descriptor

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

func (*PrivKeyResp) GetMessage

func (m *PrivKeyResp) GetMessage() string

func (*PrivKeyResp) ProtoMessage

func (*PrivKeyResp) ProtoMessage()

func (*PrivKeyResp) Reset

func (m *PrivKeyResp) Reset()

func (*PrivKeyResp) String

func (m *PrivKeyResp) String() string

func (*PrivKeyResp) XXX_DiscardUnknown

func (m *PrivKeyResp) XXX_DiscardUnknown()

func (*PrivKeyResp) XXX_Marshal

func (m *PrivKeyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PrivKeyResp) XXX_Merge

func (m *PrivKeyResp) XXX_Merge(src proto.Message)

func (*PrivKeyResp) XXX_Size

func (m *PrivKeyResp) XXX_Size() int

func (*PrivKeyResp) XXX_Unmarshal

func (m *PrivKeyResp) XXX_Unmarshal(b []byte) error

type PubKeyReq

type PubKeyReq struct {
	PubKeyName           string   `protobuf:"bytes,1,opt,name=pubKeyName,proto3" json:"pubKeyName,omitempty"`
	PrivKeyName          string   `protobuf:"bytes,2,opt,name=privKeyName,proto3" json:"privKeyName,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PubKeyReq) Descriptor

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

func (*PubKeyReq) GetPrivKeyName

func (m *PubKeyReq) GetPrivKeyName() string

func (*PubKeyReq) GetPubKeyName

func (m *PubKeyReq) GetPubKeyName() string

func (*PubKeyReq) ProtoMessage

func (*PubKeyReq) ProtoMessage()

func (*PubKeyReq) Reset

func (m *PubKeyReq) Reset()

func (*PubKeyReq) String

func (m *PubKeyReq) String() string

func (*PubKeyReq) XXX_DiscardUnknown

func (m *PubKeyReq) XXX_DiscardUnknown()

func (*PubKeyReq) XXX_Marshal

func (m *PubKeyReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubKeyReq) XXX_Merge

func (m *PubKeyReq) XXX_Merge(src proto.Message)

func (*PubKeyReq) XXX_Size

func (m *PubKeyReq) XXX_Size() int

func (*PubKeyReq) XXX_Unmarshal

func (m *PubKeyReq) XXX_Unmarshal(b []byte) error

type PubKeyResp

type PubKeyResp struct {
	Message              string   `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PubKeyResp) Descriptor

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

func (*PubKeyResp) GetMessage

func (m *PubKeyResp) GetMessage() string

func (*PubKeyResp) ProtoMessage

func (*PubKeyResp) ProtoMessage()

func (*PubKeyResp) Reset

func (m *PubKeyResp) Reset()

func (*PubKeyResp) String

func (m *PubKeyResp) String() string

func (*PubKeyResp) XXX_DiscardUnknown

func (m *PubKeyResp) XXX_DiscardUnknown()

func (*PubKeyResp) XXX_Marshal

func (m *PubKeyResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PubKeyResp) XXX_Merge

func (m *PubKeyResp) XXX_Merge(src proto.Message)

func (*PubKeyResp) XXX_Size

func (m *PubKeyResp) XXX_Size() int

func (*PubKeyResp) XXX_Unmarshal

func (m *PubKeyResp) XXX_Unmarshal(b []byte) error

type UnimplementedWireguardServer

type UnimplementedWireguardServer struct {
}

UnimplementedWireguardServer can be embedded to have forward compatible implementations.

func (*UnimplementedWireguardServer) AddPeer

func (*UnimplementedWireguardServer) DelPeer

func (*UnimplementedWireguardServer) GenPrivateKey

func (*UnimplementedWireguardServer) GenPublicKey

func (*UnimplementedWireguardServer) GetNICInfo

func (*UnimplementedWireguardServer) GetPeerStatus

func (*UnimplementedWireguardServer) GetPrivateKey

func (*UnimplementedWireguardServer) GetPublicKey

func (*UnimplementedWireguardServer) InitializeI

func (*UnimplementedWireguardServer) InitializeI(ctx context.Context, req *IReq) (*IResp, error)

func (*UnimplementedWireguardServer) ListPeers

func (*UnimplementedWireguardServer) ManageNIC

type WireGuardConfig

type WireGuardConfig struct {
	Endpoint string
	Port     uint64
	AuthKey  string
	SignKey  string
	Enabled  bool
	CertFile string
	CertKey  string
	CAFile   string
	Dir      string // client configuration file will reside
}

type WireguardClient

type WireguardClient interface {
	InitializeI(ctx context.Context, in *IReq, opts ...grpc.CallOption) (*IResp, error)
	AddPeer(ctx context.Context, in *AddPReq, opts ...grpc.CallOption) (*AddPResp, error)
	DelPeer(ctx context.Context, in *DelPReq, opts ...grpc.CallOption) (*DelPResp, error)
	ListPeers(ctx context.Context, in *ListPeersReq, opts ...grpc.CallOption) (*ListPeersResp, error)
	ManageNIC(ctx context.Context, in *ManageNICReq, opts ...grpc.CallOption) (*ManageNICResp, error)
	GetPeerStatus(ctx context.Context, in *PeerStatusReq, opts ...grpc.CallOption) (*PeerStatusResp, error)
	GetNICInfo(ctx context.Context, in *NICInfoReq, opts ...grpc.CallOption) (*NICInfoResp, error)
	GenPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error)
	GenPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error)
	GetPrivateKey(ctx context.Context, in *PrivKeyReq, opts ...grpc.CallOption) (*PrivKeyResp, error)
	GetPublicKey(ctx context.Context, in *PubKeyReq, opts ...grpc.CallOption) (*PubKeyResp, error)
}

WireguardClient is the client API for Wireguard service.

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

func NewGRPCVPNClient

func NewGRPCVPNClient(wgConn WireGuardConfig) (WireguardClient, error)

func NewWireguardClient

func NewWireguardClient(cc *grpc.ClientConn) WireguardClient

type WireguardServer

type WireguardServer interface {
	InitializeI(context.Context, *IReq) (*IResp, error)
	AddPeer(context.Context, *AddPReq) (*AddPResp, error)
	DelPeer(context.Context, *DelPReq) (*DelPResp, error)
	ListPeers(context.Context, *ListPeersReq) (*ListPeersResp, error)
	ManageNIC(context.Context, *ManageNICReq) (*ManageNICResp, error)
	GetPeerStatus(context.Context, *PeerStatusReq) (*PeerStatusResp, error)
	GetNICInfo(context.Context, *NICInfoReq) (*NICInfoResp, error)
	GenPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error)
	GenPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error)
	GetPrivateKey(context.Context, *PrivKeyReq) (*PrivKeyResp, error)
	GetPublicKey(context.Context, *PubKeyReq) (*PubKeyResp, error)
}

WireguardServer is the server API for Wireguard service.

Jump to

Keyboard shortcuts

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