grpc_idempotency

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 7 Imported by: 0

README

grpc_idempotency

Documentation

Index

Constants

View Source
const KeyHeader = "Idempotency-Key"
View Source
const XKeyHeader = "X-Idempotency-Key"

Variables

View Source
var ErrHeaderNotFound = status.Errorf(codes.InvalidArgument, "header %s or %s not found", KeyHeader, XKeyHeader)

Functions

func IncomingHeaderMatcher

func IncomingHeaderMatcher(key string) (string, bool)

func UnaryServerInterceptor

func UnaryServerInterceptor(storage Storage, acl ACL) grpc.UnaryServerInterceptor

Types

type ACL

type ACL interface {
	Check(ctx context.Context, method string) interface{}
}

type Storage

type Storage interface {
	Get(key string, data interface{}) (res interface{}, err error)
	Set(key string, data interface{})
}

Jump to

Keyboard shortcuts

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