protocol

package
v0.3.0-docs.0...-f96dd80 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package protocol defines the information types required and expected when interacting with QED.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToBalloonProof

func ToBalloonProof(mr *MembershipResult, hasherF func() hashing.Hasher) *balloon.MembershipProof

ToBaloonProof translate public protocol.MembershipResult to internal balloon.MembershipProof.

func ToIncrementalProof

func ToIncrementalProof(ir *IncrementalResponse, hasherF func() hashing.Hasher) *balloon.IncrementalProof

ToIncrementalProof translate public protocol.IncrementalResponse to internal balloon.IncrementalProof.

Types

type BackupInfo

type BackupInfo struct {
	ID        int64
	Timestamp int64
	Size      int64
	NumFiles  int32
	Metadata  string
}

BackupInfo is the public struct used to parse the backup information. Metadata is suposed to contains only the balloon version.

type BatchSnapshots

type BatchSnapshots struct {
	Snapshots []*SignedSnapshot
}

BatchSnapshots is information structure that QED sends to Agents, and Agents to alerts/snapshot store. It is comprised of an array of Signed Snapshots.

func (*BatchSnapshots) Decode

func (b *BatchSnapshots) Decode(msg []byte) error

func (*BatchSnapshots) Encode

func (b *BatchSnapshots) Encode() ([]byte, error)

type Event

type Event struct {
	Event []byte
}

Event is the public struct that Add handler function uses to parse the post params.

type EventsBulk

type EventsBulk struct {
	Events [][]byte
}

EventBulk is the public struct that AddBulk handler function uses to parse the post params.

type IncrementalRequest

type IncrementalRequest struct {
	Start uint64
	End   uint64
}

IncrementalRequest is the information structure needed to ask for an incremental request.

type IncrementalResponse

type IncrementalResponse struct {
	Start     uint64
	End       uint64
	AuditPath map[string]hashing.Digest
}

IncrementalResponse is the information structure expected from an incremental proof request.

func ToIncrementalResponse

func ToIncrementalResponse(proof *balloon.IncrementalProof) *IncrementalResponse

ToIncrementalResponse translates internal api balloon.IncrementalProof to the public struct protocol.IncrementalResponse.

type MembershipDigest

type MembershipDigest struct {
	KeyDigest hashing.Digest
	Version   *uint64
}

MembershipDigest is the public struct that apihttp.DigestMembership Handler uses to parse the post params.

type MembershipQuery

type MembershipQuery struct {
	Key     []byte
	Version *uint64
}

MembershipQuery is the public struct that apihttp.Membership Handler uses to parse the post params.

type MembershipResult

type MembershipResult struct {
	Exists         bool
	Hyper          map[string]hashing.Digest
	History        map[string]hashing.Digest
	CurrentVersion uint64
	QueryVersion   uint64
	ActualVersion  uint64
	KeyDigest      hashing.Digest
	Key            []byte
}

MembershipResult is the information structure needed or a Membership proof.

func ToMembershipResult

func ToMembershipResult(key []byte, mp *balloon.MembershipProof) *MembershipResult

ToMembershipProof translates internal api balloon.MembershipProof to the public struct protocol.MembershipResult.

type NodeInfo

type NodeInfo struct {
	NodeId      string `json:"node_id"`
	RaftAddr    string `json:"raft_addr"`
	MgmtAddr    string `json:"mgmt_addr"`
	HttpAddr    string `json:"http_addr"`
	MetricsAddr string `json:"metrics_addr"`
}

NodeInfo is the public struct that apihttp.InfoHandler call returns.

type Scheme

type Scheme string
const (
	Http  Scheme = "http"
	Https Scheme = "https"
)

type ShardDetail

type ShardDetail struct {
	NodeId   string `json:"nodeId"`
	HTTPAddr string `json:"httpAddr"`
}

ShardDetail is the information required to define a Shard.

type Shards

type Shards struct {
	NodeId    string                 `json:"nodeId"`
	LeaderId  string                 `json:"leaderId"`
	URIScheme Scheme                 `json:"uriScheme"`
	Shards    map[string]ShardDetail `json:"shards"`
}

Shards is the public struct that apihttp.InfoShardsHandler call returns.

type SignedSnapshot

type SignedSnapshot struct {
	Snapshot  *Snapshot
	Signature []byte
}

SignedSnapshot is the public struct that apihttp.Add Handler call returns. It is comprised of a Snapshot and a signature.

func (*SignedSnapshot) Decode

func (b *SignedSnapshot) Decode(msg []byte) error

func (*SignedSnapshot) Encode

func (b *SignedSnapshot) Encode() ([]byte, error)

type Snapshot

type Snapshot struct {
	EventDigest   hashing.Digest
	HistoryDigest hashing.Digest
	HyperDigest   hashing.Digest
	Version       uint64
}

Snapshot is the public struct that apihttp.Add Handler call returns.

func (*Snapshot) Decode

func (b *Snapshot) Decode(msg []byte) error

func (*Snapshot) Encode

func (b *Snapshot) Encode() ([]byte, error)

Jump to

Keyboard shortcuts

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