rafterrors

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: BSD-2-Clause Imports: 3 Imported by: 6

Documentation

Overview

Package rafterrors annotates Raft errors with gRPC status codes.

Use MarkRetriable/MarkUnretriable to add a gRPC status code.

Use MarkRetriable for atomic operations like Apply, ApplyLog, Barrier, changing configuration/voters.

Use MarkUnretriable if your own application already made changes that it didn't roll back and for Restore. Restore does multiple operation, and errors could be from the first or second and it's unsafe to distinguish.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarkRetriable

func MarkRetriable(err error) error

MarkRetriable annotates a Raft error with a gRPC status code, given that the entire operation is retriable.

func MarkUnretriable

func MarkUnretriable(err error) error

MarkUnretriable annotates a Raft error with a gRPC status code, given that the entire operation is not retriable.

func RetriableCode

func RetriableCode(err error) codes.Code

RetriableCode returns a gRPC status code for a given Raft error, given that the entire operation is retriable.

func UnretriableCode

func UnretriableCode(err error) codes.Code

Code returns a gRPC status code for a given Raft error, given that the entire operation is not retriable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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