client

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitClient

type CommitClient struct {
	Connection proto.CommitClient
	Tracer     *zipkin.Tracer
}

func New

func New(addr string, tracer *zipkin.Tracer) (*CommitClient, error)

New creates instance of peer client. 'addr' is a coordinator network address (host + port).

func (*CommitClient) Commit

func (client *CommitClient) Commit(ctx context.Context, req *proto.CommitRequest) (*proto.Response, error)

func (*CommitClient) Get

func (client *CommitClient) Get(ctx context.Context, key string) (*proto.Value, error)

Get queries value of specific key

func (*CommitClient) NodeInfo

func (client *CommitClient) NodeInfo(ctx context.Context) (*proto.Info, error)

NodeInfo gets info about current node height.

func (*CommitClient) Precommit

func (client *CommitClient) Precommit(ctx context.Context, req *proto.PrecommitRequest) (*proto.Response, error)

func (*CommitClient) Propose

func (client *CommitClient) Propose(ctx context.Context, req *proto.ProposeRequest) (*proto.Response, error)

func (*CommitClient) Put

func (client *CommitClient) Put(ctx context.Context, key string, value []byte) (*proto.Response, error)

Put sends key/value pair to peer (it should be a coordinator). The coordinator reaches consensus and all peers commit the value.

Jump to

Keyboard shortcuts

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