config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package config is a generated protocol buffer package.

It is generated from these files:

config.proto

It has these top-level messages:

Server
Group
Layer
Servers
Groups
Layers

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthConfig = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig   = fmt.Errorf("proto: integer overflow")
)
View Source
var StreamSize = 2 * 1024 * 1024

Functions

func Assignments

func Assignments(groups map[string]*Group) [][]*Group

func CloseConns

func CloseConns(conns map[string]*grpc.ClientConn)

func CreateGroupConfig

func CreateGroupConfig(nGroups int, f float64, addrs []string) (map[string]*Server, map[string]*Group)

func CreateGroupsWithAddresses

func CreateGroupsWithAddresses(addrs [][]string) (map[string]*Server, map[string]*Group)

func CreateOneGroupConfig

func CreateOneGroupConfig(addrs []string) (map[string]*Server, map[string]*Group)

func CreateRandomGroups

func CreateRandomGroups(nGroups int, f float64, addrs []string) [][]string

func CreateRandomGroupsWithSize

func CreateRandomGroupsWithSize(nGroups, size int, addrs []string) [][]string

func DialServers

func DialServers(servers map[string]*Server) (map[string]*grpc.ClientConn, error)

func FindCertificate

func FindCertificate(addr string, servers map[string]*Server) *tls.Certificate

func FindIdentity

func FindIdentity(addr string, servers map[string]*Server) ([]byte, []byte)

func GroupSize

func GroupSize(nGroups int, f float64) int

func GroupToKeys

func GroupToKeys(servers map[string]*Server, group *Group) [][]byte

func MarshalGroups

func MarshalGroups(writer io.Writer, groups map[string]*Group) error

func MarshalGroupsToFile

func MarshalGroupsToFile(fn string, groups map[string]*Group) error

func MarshalServers

func MarshalServers(writer io.Writer, servers map[string]*Server) error

func MarshalServersToFile

func MarshalServersToFile(fn string, servers map[string]*Server) error

func Port

func Port(addr string) string

func SelfSignedCertificate

func SelfSignedCertificate(name pkix.Name) ([]byte, *ecdsa.PrivateKey)

func UnmarshalGroups

func UnmarshalGroups(reader io.Reader) (map[string]*Group, error)

func UnmarshalGroupsFromFile

func UnmarshalGroupsFromFile(fn string) (map[string]*Group, error)

func UnmarshalServers

func UnmarshalServers(reader io.Reader) (map[string]*Server, error)

func UnmarshalServersFromFile

func UnmarshalServersFromFile(fn string) (map[string]*Server, error)

Types

type Group

type Group struct {
	Gid   string `protobuf:"bytes,1,opt,name=gid,proto3" json:"gid,omitempty"`
	Layer uint32 `protobuf:"fixed32,2,opt,name=layer,proto3" json:"layer,omitempty"`
	Row   uint32 `protobuf:"fixed32,3,opt,name=row,proto3" json:"row,omitempty"`
	// server ids of this group
	Servers []string `protobuf:"bytes,4,rep,name=servers" json:"servers,omitempty"`
	// neighbors gids
	Predecessors []string `protobuf:"bytes,5,rep,name=predecessors" json:"predecessors,omitempty"`
	Successors   []string `protobuf:"bytes,6,rep,name=successors" json:"successors,omitempty"`
}

func (*Group) Descriptor

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

func (*Group) GetGid

func (m *Group) GetGid() string

func (*Group) GetLayer

func (m *Group) GetLayer() uint32

func (*Group) GetPredecessors

func (m *Group) GetPredecessors() []string

func (*Group) GetRow

func (m *Group) GetRow() uint32

func (*Group) GetServers

func (m *Group) GetServers() []string

func (*Group) GetSuccessors

func (m *Group) GetSuccessors() []string

func (*Group) Marshal

func (m *Group) Marshal() (dAtA []byte, err error)

func (*Group) MarshalTo

func (m *Group) MarshalTo(dAtA []byte) (int, error)

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) Reset

func (m *Group) Reset()

func (*Group) Size

func (m *Group) Size() (n int)

func (*Group) String

func (m *Group) String() string

func (*Group) Unmarshal

func (m *Group) Unmarshal(dAtA []byte) error

type Groups

type Groups struct {
	Groups map[string]*Group `` /* 139-byte string literal not displayed */
}

func (*Groups) Descriptor

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

func (*Groups) GetGroups

func (m *Groups) GetGroups() map[string]*Group

func (*Groups) Marshal

func (m *Groups) Marshal() (dAtA []byte, err error)

func (*Groups) MarshalTo

func (m *Groups) MarshalTo(dAtA []byte) (int, error)

func (*Groups) ProtoMessage

func (*Groups) ProtoMessage()

func (*Groups) Reset

func (m *Groups) Reset()

func (*Groups) Size

func (m *Groups) Size() (n int)

func (*Groups) String

func (m *Groups) String() string

func (*Groups) Unmarshal

func (m *Groups) Unmarshal(dAtA []byte) error

type Layer

type Layer struct {
	LayerId uint32 `protobuf:"fixed32,1,opt,name=layer_id,json=layerId,proto3" json:"layer_id,omitempty"`
	// group ids of this layer
	Groups []string `protobuf:"bytes,2,rep,name=groups" json:"groups,omitempty"`
}

func (*Layer) Descriptor

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

func (*Layer) GetGroups

func (m *Layer) GetGroups() []string

func (*Layer) GetLayerId

func (m *Layer) GetLayerId() uint32

func (*Layer) Marshal

func (m *Layer) Marshal() (dAtA []byte, err error)

func (*Layer) MarshalTo

func (m *Layer) MarshalTo(dAtA []byte) (int, error)

func (*Layer) ProtoMessage

func (*Layer) ProtoMessage()

func (*Layer) Reset

func (m *Layer) Reset()

func (*Layer) Size

func (m *Layer) Size() (n int)

func (*Layer) String

func (m *Layer) String() string

func (*Layer) Unmarshal

func (m *Layer) Unmarshal(dAtA []byte) error

type Layers

type Layers struct {
	Layers []*Layer `protobuf:"bytes,1,rep,name=layers" json:"layers,omitempty"`
}

func (*Layers) Descriptor

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

func (*Layers) GetLayers

func (m *Layers) GetLayers() []*Layer

func (*Layers) Marshal

func (m *Layers) Marshal() (dAtA []byte, err error)

func (*Layers) MarshalTo

func (m *Layers) MarshalTo(dAtA []byte) (int, error)

func (*Layers) ProtoMessage

func (*Layers) ProtoMessage()

func (*Layers) Reset

func (m *Layers) Reset()

func (*Layers) Size

func (m *Layers) Size() (n int)

func (*Layers) String

func (m *Layers) String() string

func (*Layers) Unmarshal

func (m *Layers) Unmarshal(dAtA []byte) error

type RandReader

type RandReader struct {
	io.Reader
}

func NewRandReader

func NewRandReader(seed []byte) *RandReader

func (*RandReader) Perm

func (r *RandReader) Perm(n int) []int

Knuth shuffle

func (*RandReader) SelectRandom

func (r *RandReader) SelectRandom(n int, t int) []int

select t out of n, without replacement

func (*RandReader) UInt64

func (r *RandReader) UInt64() uint64

type Server

type Server struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	Id      string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	// typically a certificate, but could be a signing key, or whatever
	// else that could be used to authenticate itself
	Identity        []byte `protobuf:"bytes,3,opt,name=identity,proto3" json:"identity,omitempty"`
	PrivateIdentity []byte `protobuf:"bytes,4,opt,name=private_identity,json=privateIdentity,proto3" json:"private_identity,omitempty"`
	// onion encryption key
	PublicKey  []byte `protobuf:"bytes,5,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	PrivateKey []byte `protobuf:"bytes,6,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"`
	// extensions contain the blinding key
	Extensions map[string][]byte `` /* 154-byte string literal not displayed */
}

func CreateServer

func CreateServer(addr string, id string) *Server

func CreateServerWithCertificate

func CreateServerWithCertificate(addr string, id string, cert, key []byte) *Server

func CreateServerWithExisting

func CreateServerWithExisting(addr string, id string, servers map[string]*Server) *Server

func (*Server) Descriptor

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

func (*Server) GetAddress

func (m *Server) GetAddress() string

func (*Server) GetExtensions

func (m *Server) GetExtensions() map[string][]byte

func (*Server) GetId

func (m *Server) GetId() string

func (*Server) GetIdentity

func (m *Server) GetIdentity() []byte

func (*Server) GetPrivateIdentity

func (m *Server) GetPrivateIdentity() []byte

func (*Server) GetPrivateKey

func (m *Server) GetPrivateKey() []byte

func (*Server) GetPublicKey

func (m *Server) GetPublicKey() []byte

func (*Server) Marshal

func (m *Server) Marshal() (dAtA []byte, err error)

func (*Server) MarshalTo

func (m *Server) MarshalTo(dAtA []byte) (int, error)

func (*Server) ProtoMessage

func (*Server) ProtoMessage()

func (*Server) Reset

func (m *Server) Reset()

func (*Server) Size

func (m *Server) Size() (n int)

func (*Server) String

func (m *Server) String() string

func (*Server) Unmarshal

func (m *Server) Unmarshal(dAtA []byte) error

type Servers

type Servers struct {
	Servers map[string]*Server `` /* 141-byte string literal not displayed */
}

func (*Servers) Descriptor

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

func (*Servers) GetServers

func (m *Servers) GetServers() map[string]*Server

func (*Servers) Marshal

func (m *Servers) Marshal() (dAtA []byte, err error)

func (*Servers) MarshalTo

func (m *Servers) MarshalTo(dAtA []byte) (int, error)

func (*Servers) ProtoMessage

func (*Servers) ProtoMessage()

func (*Servers) Reset

func (m *Servers) Reset()

func (*Servers) Size

func (m *Servers) Size() (n int)

func (*Servers) String

func (m *Servers) String() string

func (*Servers) Unmarshal

func (m *Servers) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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