api

package
v0.0.0-...-08e4530 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	pb.UnimplementedAccumulatorServer
	// contains filtered or unexported fields
}

Server implements API server

func NewServer

func NewServer(accumulator storage.MerkleAccumulator, logger *zap.SugaredLogger) *Server

NewServer returns a new API server

func (Server) Append

func (s Server) Append(_ context.Context, hash *pb.Hash) (*pb.ID, error)

Append appends new hash to accumulator

func (Server) Get

func (s Server) Get(_ context.Context, id *pb.ID) (*pb.Hash, error)

Get gets certain hash by id from accumulator

func (Server) GetDigest

func (s Server) GetDigest(context.Context, *pb.Empty) (*pb.Hash, error)

GetDigest requests latest digest from accumulator

func (Server) GetOldProofByHash

func (s Server) GetOldProofByHash(_ context.Context, in *pb.GetOldProofByHashRequest) (*pb.HashProof, error)

GetOldProofByHash requests hash proof of certain node to a past digest by hash

func (Server) GetOldProofByID

func (s Server) GetOldProofByID(_ context.Context, in *pb.GetOldProofByIDRequest) (*pb.HashProof, error)

GetOldProofByID requests hash proof of certain node to a past digest by id

func (Server) GetProofByHash

func (s Server) GetProofByHash(_ context.Context, hash *pb.Hash) (*pb.HashProof, error)

GetProofByHash requests hash proof of certain node to latest digest by hash

func (Server) GetProofByID

func (s Server) GetProofByID(_ context.Context, id *pb.ID) (*pb.HashProof, error)

GetProofByID requests hash proof of certain node to latest digest by id

func (Server) Search

func (s Server) Search(_ context.Context, hash *pb.Hash) (*pb.ID, error)

Search searches accumulator and returns id of oldest node related to input hash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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