grpc-etcd-client-0.1.0.0: gRPC client for etcd

Safe HaskellNone
LanguageHaskell2010

Network.EtcdV3

Contents

Description

Simple lib to access Etcd over gRPC.

Synopsis

Generalities.

type EtcdQuery a = IO (Maybe a) Source #

Type alias to simplify type signatures.

Reading.

data KeyRange Source #

Data type to unify the three addressing schemes in etcd.

See range.

Constructors

SingleKey !ByteString

Exactly one key.

FromKey !ByteString 
Prefixed !ByteString 
Instances
Eq KeyRange Source # 
Instance details

Defined in Network.EtcdV3

Ord KeyRange Source # 
Instance details

Defined in Network.EtcdV3

Show KeyRange Source # 
Instance details

Defined in Network.EtcdV3

range Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> KeyRange

Looked-up range.

-> EtcdQuery RangeResponse 

Lookup a range of values

rangeResponsePairs :: Getting (Endo [(ByteString, ByteString)]) RangeResponse (ByteString, ByteString) Source #

Specific fold to get the key-values of a RangeResponse

Typical usage is:

x <- range grpc (Prefixed "some-dir") print $ x ^.. _Just . rangePairs

Note that Etcd RangeResponse is a rich object, please refer to Etcd documentation to understand what you will miss out (e.g., whether the list is complete or not).

Granting leases.

grantLease Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> Int64

TTL for the lease.

-> EtcdQuery LeaseGrantResponse 

Asks for a lease of a given duration.

fromLeaseGrantResponse :: LeaseGrantResponse -> GrantedLease Source #

Constructor for GrantedLease.

keepAlive Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> GrantedLease

A previously-granted lease.

-> EtcdQuery LeaseKeepAliveResponse 

Keep a lease alive.

Writing.

put Source #

Arguments

:: GrpcClient

initialized gRPC client

-> ByteString

Key.

-> ByteString

Value.

-> Maybe GrantedLease

Lease on the key.

-> EtcdQuery PutResponse 

Put one value.

re-exports

def :: Default a => a #

The default value for this type.