config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DirectoryServerHealthcheckURL         = "https://directory.nymtech.net/api/healthcheck"
	DirectoryServerMetricsURL             = "https://directory.nymtech.net/api/metrics/mixes"
	DirectoryServerPkiURL                 = "https://directory.nymtech.net/api/nodes"
	DirectoryServerMixPresenceURL         = "https://directory.nymtech.net/api/presence/mixnodes"
	DirectoryServerMixProviderPresenceURL = "https://directory.nymtech.net/api/presence/mixproviders"
	DirectoryServerTopology               = "https://directory.nymtech.net/api/presence/topology"

	LocalDirectoryServerMetricsURL             = "http://localhost:8080/api/metrics/mixes"
	LocalDirectoryServerMixPresenceURL         = "http://localhost:8080/api/presence/mixnodes"
	LocalDirectoryServerMixProviderPresenceURL = "http://localhost:8080/api/presence/mixproviders"
	LocalDirectoryServerTopology               = "http://localhost:8080/api/presence/topology"

	// TODO: somehow split mixConfig to distinguish providers and mixnodes?
	// But then we would have to deal with nasty interfaces and protobuf issues...
	ProviderLayer = 1000000

	DefaultRemotePort = "1789"
)

Variables

This section is empty.

Functions

func WrapWithFlag

func WrapWithFlag(flag flags.PacketTypeFlag, data []byte) ([]byte, error)

WrapWithFlag packs the given byte information together with a specified flag into the packet.

Types

type ClientConfig

type ClientConfig struct {
	Id                   string     `protobuf:"bytes,1,opt,name=Id,json=id,proto3" json:"Id,omitempty"`
	Host                 string     `protobuf:"bytes,2,opt,name=Host,json=host,proto3" json:"Host,omitempty"`
	Port                 string     `protobuf:"bytes,3,opt,name=Port,json=port,proto3" json:"Port,omitempty"`
	PubKey               []byte     `protobuf:"bytes,4,opt,name=PubKey,json=pubKey,proto3" json:"PubKey,omitempty"`
	Provider             *MixConfig `protobuf:"bytes,5,opt,name=Provider,json=provider,proto3" json:"Provider,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func NewClientConfig

func NewClientConfig(clientID, host, port string, pubKey []byte, providerInfo MixConfig) ClientConfig

NewClientConfig constructor

func (*ClientConfig) Descriptor

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

func (*ClientConfig) GetHost

func (m *ClientConfig) GetHost() string

func (*ClientConfig) GetId

func (m *ClientConfig) GetId() string

func (*ClientConfig) GetPort

func (m *ClientConfig) GetPort() string

func (*ClientConfig) GetProvider

func (m *ClientConfig) GetProvider() *MixConfig

func (*ClientConfig) GetPubKey

func (m *ClientConfig) GetPubKey() []byte

func (*ClientConfig) ProtoMessage

func (*ClientConfig) ProtoMessage()

func (*ClientConfig) Reset

func (m *ClientConfig) Reset()

func (*ClientConfig) String

func (m *ClientConfig) String() string

func (*ClientConfig) XXX_DiscardUnknown

func (m *ClientConfig) XXX_DiscardUnknown()

func (*ClientConfig) XXX_Marshal

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

func (*ClientConfig) XXX_Merge

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

func (*ClientConfig) XXX_Size

func (m *ClientConfig) XXX_Size() int

func (*ClientConfig) XXX_Unmarshal

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

type E2EPath

type E2EPath struct {
	IngressProvider MixConfig
	Mixes           []MixConfig
	EgressProvider  MixConfig
	Recipient       ClientConfig
}

E2EPath holds end to end path data for an entire route, prior to Sphinx header encryption

func (*E2EPath) Len

func (p *E2EPath) Len() int

Len adds 3 to the mix path. TODO: why? Check this with Ania.

type GeneralPacket

type GeneralPacket struct {
	Flag                 []byte   `protobuf:"bytes,1,opt,name=Flag,json=flag,proto3" json:"Flag,omitempty"`
	Data                 []byte   `protobuf:"bytes,2,opt,name=Data,json=data,proto3" json:"Data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func UnmarshalProviderResponse

func UnmarshalProviderResponse(resp ProviderResponse) ([]GeneralPacket, error)

func (*GeneralPacket) Descriptor

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

func (*GeneralPacket) GetData

func (m *GeneralPacket) GetData() []byte

func (*GeneralPacket) GetFlag

func (m *GeneralPacket) GetFlag() []byte

func (*GeneralPacket) ProtoMessage

func (*GeneralPacket) ProtoMessage()

func (*GeneralPacket) Reset

func (m *GeneralPacket) Reset()

func (*GeneralPacket) String

func (m *GeneralPacket) String() string

func (*GeneralPacket) XXX_DiscardUnknown

func (m *GeneralPacket) XXX_DiscardUnknown()

func (*GeneralPacket) XXX_Marshal

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

func (*GeneralPacket) XXX_Merge

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

func (*GeneralPacket) XXX_Size

func (m *GeneralPacket) XXX_Size() int

func (*GeneralPacket) XXX_Unmarshal

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

type MixConfig

type MixConfig struct {
	Id                   string   `protobuf:"bytes,1,opt,name=Id,json=id,proto3" json:"Id,omitempty"`
	Host                 string   `protobuf:"bytes,2,opt,name=Host,json=host,proto3" json:"Host,omitempty"`
	Port                 string   `protobuf:"bytes,3,opt,name=Port,json=port,proto3" json:"Port,omitempty"`
	PubKey               []byte   `protobuf:"bytes,4,opt,name=PubKey,json=pubKey,proto3" json:"PubKey,omitempty"`
	Layer                uint64   `protobuf:"varint,5,opt,name=Layer,json=layer,proto3" json:"Layer,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func NewMixConfig

func NewMixConfig(mixID, host, port string, pubKey []byte, layer uint) MixConfig

NewMixConfig constructor

func (*MixConfig) Descriptor

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

func (*MixConfig) GetHost

func (m *MixConfig) GetHost() string

func (*MixConfig) GetId

func (m *MixConfig) GetId() string

func (*MixConfig) GetLayer

func (m *MixConfig) GetLayer() uint64

func (*MixConfig) GetPort

func (m *MixConfig) GetPort() string

func (*MixConfig) GetPubKey

func (m *MixConfig) GetPubKey() []byte

func (*MixConfig) ProtoMessage

func (*MixConfig) ProtoMessage()

func (*MixConfig) Reset

func (m *MixConfig) Reset()

func (*MixConfig) String

func (m *MixConfig) String() string

func (*MixConfig) XXX_DiscardUnknown

func (m *MixConfig) XXX_DiscardUnknown()

func (*MixConfig) XXX_Marshal

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

func (*MixConfig) XXX_Merge

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

func (*MixConfig) XXX_Size

func (m *MixConfig) XXX_Size() int

func (*MixConfig) XXX_Unmarshal

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

type ProviderResponse

type ProviderResponse struct {
	NumberOfPackets      uint64   `protobuf:"varint,1,opt,name=NumberOfPackets,json=numberOfPackets,proto3" json:"NumberOfPackets,omitempty"`
	Packets              [][]byte `protobuf:"bytes,2,rep,name=Packets,json=packets,proto3" json:"Packets,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ProviderResponse) Descriptor

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

func (*ProviderResponse) GetNumberOfPackets

func (m *ProviderResponse) GetNumberOfPackets() uint64

func (*ProviderResponse) GetPackets

func (m *ProviderResponse) GetPackets() [][]byte

func (*ProviderResponse) ProtoMessage

func (*ProviderResponse) ProtoMessage()

func (*ProviderResponse) Reset

func (m *ProviderResponse) Reset()

func (*ProviderResponse) String

func (m *ProviderResponse) String() string

func (*ProviderResponse) XXX_DiscardUnknown

func (m *ProviderResponse) XXX_DiscardUnknown()

func (*ProviderResponse) XXX_Marshal

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

func (*ProviderResponse) XXX_Merge

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

func (*ProviderResponse) XXX_Size

func (m *ProviderResponse) XXX_Size() int

func (*ProviderResponse) XXX_Unmarshal

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

type PullRequest

type PullRequest struct {
	Token                []byte   `protobuf:"bytes,1,opt,name=Token,json=token,proto3" json:"Token,omitempty"`
	ClientPublicKey      []byte   `protobuf:"bytes,2,opt,name=ClientPublicKey,json=clientPublicKey,proto3" json:"ClientPublicKey,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PullRequest) Descriptor

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

func (*PullRequest) GetClientPublicKey

func (m *PullRequest) GetClientPublicKey() []byte

func (*PullRequest) GetToken

func (m *PullRequest) GetToken() []byte

func (*PullRequest) ProtoMessage

func (*PullRequest) ProtoMessage()

func (*PullRequest) Reset

func (m *PullRequest) Reset()

func (*PullRequest) String

func (m *PullRequest) String() string

func (*PullRequest) XXX_DiscardUnknown

func (m *PullRequest) XXX_DiscardUnknown()

func (*PullRequest) XXX_Marshal

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

func (*PullRequest) XXX_Merge

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

func (*PullRequest) XXX_Size

func (m *PullRequest) XXX_Size() int

func (*PullRequest) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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