Documentation ¶
Overview ¶
Copyright 2021 Layotto Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type EtcdLock
- func (e *EtcdLock) Close() error
- func (e *EtcdLock) Features() []lock.Feature
- func (e *EtcdLock) Init(metadata lock.Metadata) error
- func (e *EtcdLock) LockKeepAlive(ctx context.Context, request *lock.LockKeepAliveRequest) (*lock.LockKeepAliveResponse, error)
- func (e *EtcdLock) TryLock(ctx context.Context, req *lock.TryLockRequest) (*lock.TryLockResponse, error)
- func (e *EtcdLock) Unlock(ctx context.Context, req *lock.UnlockRequest) (*lock.UnlockResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EtcdLock ¶
type EtcdLock struct {
// contains filtered or unexported fields
}
Etcd lock store
func NewEtcdLock ¶
func NewEtcdLock(logger log.ErrorLogger) *EtcdLock
NewEtcdLock returns a new etcd lock
func (*EtcdLock) LockKeepAlive ¶
func (e *EtcdLock) LockKeepAlive(ctx context.Context, request *lock.LockKeepAliveRequest) (*lock.LockKeepAliveResponse, error)
LockKeepAlive try to renewal lease
func (*EtcdLock) TryLock ¶
func (e *EtcdLock) TryLock(ctx context.Context, req *lock.TryLockRequest) (*lock.TryLockResponse, error)
Node tries to acquire a etcd lock
func (*EtcdLock) Unlock ¶
func (e *EtcdLock) Unlock(ctx context.Context, req *lock.UnlockRequest) (*lock.UnlockResponse, error)
Node tries to release a etcd lock