Documentation ¶
Index ¶
- Variables
- type Client
- type ClientConfig
- type Server
- func (s *Server) Bootstrap(ctx context.Context) error
- func (s *Server) CheckBloom(ctx context.Context, req *rpc.CheckBloomReq) (*rpc.CheckBloomRes, error)
- func (s *Server) Close(ctx context.Context) error
- func (s *Server) FwdOnions(ss rpc.ServerRPC_FwdOnionsServer) error
- func (s *Server) Listen(ctx context.Context) error
- func (s *Server) Run(ctx context.Context) error
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBloomCheckFailure = errors.New("fail to check Bloom, which means noise loss and adversary possibility")
View Source
var ErrBootstrapInvalidPConfigOKSignal = errors.New("invalid bootstrap_pconfig_ok signal: not 1")
View Source
var ErrPublicIPNotFound = errors.New("public IP not found in body returned by Cloudflare")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
TODO: Replace this dummy Client as real impl
func NewClient ¶
func NewClient(c ClientConfig) *Client
type ClientConfig ¶
type Server ¶
type Server struct { rpc.UnimplementedServerRPCServer // contains filtered or unexported fields }
func NewServer ¶
func NewServer(c ServerConfig) *Server
func (*Server) CheckBloom ¶
func (s *Server) CheckBloom(ctx context.Context, req *rpc.CheckBloomReq) (*rpc.CheckBloomRes, error)
type ServerConfig ¶
type ServerConfig struct { Layer int // Addr is the endpoint accessible by other servers. // If empty, use the port of [LAddr] and the public IP by detection. // At that time [LAddr] must be in ":%d" format. Addr string // LAddr is for gRPC Listening LAddr string // PK, SK can be left empty to atomically gen // TODO: PK/SK rotation PK, SK *[32]byte // RAddr is Redis addr RAddr string // MURI is MongoDB URI MURI string BloomFP float64 }
Click to show internal directories.
Click to hide internal directories.