C# 클래스 EtcdNet.EtcdClient

The EtcdClient class is used to talk with etcd service
파일 보기 프로젝트 열기: wangjia184/etcdnet 1 사용 예제들

공개 메소드들

메소드 설명
CompareAndDeleteNodeAsync ( string key, long prevIndex ) : Task

Compare and delete specific node

CompareAndDeleteNodeAsync ( string key, string prevValue ) : Task

Compare and delete specific node

CompareAndSwapNodeAsync ( string key, long prevIndex, string value, int ttl = null, bool dir = null ) : Task

CAS(Compare and Swap) a node

CompareAndSwapNodeAsync ( string key, string prevValue, string value, int ttl = null, bool dir = null ) : Task

CAS(Compare and Swap) a node

CreateInOrderNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task

Create in-order node

CreateNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task

Create a new node. If node exists, EtcdCommonException.NodeExist occurs

DeleteNodeAsync ( string key, bool ignoreKeyNotFoundException = false, bool dir = null ) : Task

delete specific node

EtcdClient ( EtcdClientOpitions options ) : System

Constructor

GetNodeAsync ( string key, bool ignoreKeyNotFoundException = false, bool recursive = false, bool sorted = false ) : Task

Get etcd node specified by `key`

GetNodeValueAsync ( string key, bool ignoreKeyNotFoundException = false ) : Task

Simplified version of `GetNodeAsync`. Get the value of the specific node

SetNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task

Get etcd node specified by `key`

WatchNodeAsync ( string key, bool recursive = false, long waitIndex = null ) : Task

Watch changes

비공개 메소드들

메소드 설명
GetLongHeader ( HttpResponseMessage responseMessage, string name ) : long
GetStringHeader ( HttpResponseMessage responseMessage, string name ) : string
SendRequest ( HttpMethod method, string requestUri, string>.IEnumerable formFields = null ) : Task

메소드 상세

CompareAndDeleteNodeAsync() 공개 메소드

Compare and delete specific node
public CompareAndDeleteNodeAsync ( string key, long prevIndex ) : Task
key string path of the node
prevIndex long previous index
리턴 Task

CompareAndDeleteNodeAsync() 공개 메소드

Compare and delete specific node
public CompareAndDeleteNodeAsync ( string key, string prevValue ) : Task
key string Path of the node
prevValue string previous value
리턴 Task

CompareAndSwapNodeAsync() 공개 메소드

CAS(Compare and Swap) a node
public CompareAndSwapNodeAsync ( string key, long prevIndex, string value, int ttl = null, bool dir = null ) : Task
key string path of the node
prevIndex long previous index
value string value
ttl int time to live (in seconds)
dir bool is directory
리턴 Task

CompareAndSwapNodeAsync() 공개 메소드

CAS(Compare and Swap) a node
public CompareAndSwapNodeAsync ( string key, string prevValue, string value, int ttl = null, bool dir = null ) : Task
key string
prevValue string
value string
ttl int
dir bool
리턴 Task

CreateInOrderNodeAsync() 공개 메소드

Create in-order node
public CreateInOrderNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task
key string
value string
ttl int
dir bool
리턴 Task

CreateNodeAsync() 공개 메소드

Create a new node. If node exists, EtcdCommonException.NodeExist occurs
public CreateNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task
key string
value string
ttl int
dir bool
리턴 Task

DeleteNodeAsync() 공개 메소드

delete specific node
public DeleteNodeAsync ( string key, bool ignoreKeyNotFoundException = false, bool dir = null ) : Task
key string The path of the node, must start with `/`
ignoreKeyNotFoundException bool If `true`, `EtcdCommonException.KeyNotFound` exception is ignored and `null` is returned instead.
dir bool true to delete an empty directory
리턴 Task

EtcdClient() 공개 메소드

Constructor
public EtcdClient ( EtcdClientOpitions options ) : System
options EtcdClientOpitions options to initialize
리턴 System

GetNodeAsync() 공개 메소드

Get etcd node specified by `key`
public GetNodeAsync ( string key, bool ignoreKeyNotFoundException = false, bool recursive = false, bool sorted = false ) : Task
key string The path of the node, must start with `/`
ignoreKeyNotFoundException bool If `true`, `EtcdCommonException.KeyNotFound` exception is ignored and `null` is returned instead.
recursive bool Represents whether list the children nodes
sorted bool To enumerate the in-order keys as a sorted list, use the "sorted" parameter.
리턴 Task

GetNodeValueAsync() 공개 메소드

Simplified version of `GetNodeAsync`. Get the value of the specific node
public GetNodeValueAsync ( string key, bool ignoreKeyNotFoundException = false ) : Task
key string The path of the node, must start with `/`
ignoreKeyNotFoundException bool If `true`, `EtcdCommonException.KeyNotFound` exception is ignored and `null` is returned instead.
리턴 Task

SetNodeAsync() 공개 메소드

Get etcd node specified by `key`
public SetNodeAsync ( string key, string value, int ttl = null, bool dir = null ) : Task
key string path of the node
value string value to be set
ttl int time to live, in seconds
dir bool indicates if this is a directory
리턴 Task

WatchNodeAsync() 공개 메소드

Watch changes
public WatchNodeAsync ( string key, bool recursive = false, long waitIndex = null ) : Task
key string Path of the node
recursive bool true to monitor descendants
waitIndex long Etcd Index is continue monitor from
리턴 Task