grpc-etcd-client-0.1.1.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.

data GrantedLease Source #

Opaque lease result.

Show instance used for printing purposes only.

Instances
Show GrantedLease Source # 
Instance details

Defined in Network.EtcdV3

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.

delete Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> KeyRange

Deleted range.

-> EtcdQuery DeleteRangeResponse 

Delete a range of values.

Locking.

data AcquiredLock Source #

Opaque lock.

Show instance used for printing purposes only.

Instances
Show AcquiredLock Source # 
Instance details

Defined in Network.EtcdV3

lock Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> ByteString

Lock Name

-> GrantedLease

Previously-granted lease that will bound the lifetime of the lock ownership.

-> EtcdQuery LockResponse 

unlock Source #

Arguments

:: GrpcClient

Initialized gRPC client.

-> AcquiredLock

Previously-acquired lock.

-> EtcdQuery UnlockResponse 

re-exports

def :: Default a => a #

The default value for this type.