Documentation ¶
Index ¶
- Constants
- func ClientResponseFromError(err error) *pb.ClientResponse
- func ErrorFromClientResponse(resp *pb.ClientResponse) error
- func InjectFault(from, to *net.UDPAddr) bool
- func RecvUDP(sec SecretsManager, conn *net.UDPConn) (*pb.Packet, *net.UDPAddr, uint32, error)
- func SendUDP(sec SecretsManager, secretNum uint32, conn *net.UDPConn, to *net.UDPAddr, ...) error
- func SetFaultInjectorFunction(fn func(from, to *net.UDPAddr) bool)
- type AccessLevel
- type Error
- type FileSecretsManager
- type PacketCategory
- type Secret
- type SecretsManager
- type SimpleSecretsManager
- type StoredSecret
Constants ¶
View Source
const MaxPacketSize = 1200
Variables ¶
This section is empty.
Functions ¶
func ClientResponseFromError ¶
func ClientResponseFromError(err error) *pb.ClientResponse
func ErrorFromClientResponse ¶
func ErrorFromClientResponse(resp *pb.ClientResponse) error
func InjectFault ¶
InjectFault returns true iff a fault should be injected.
func SetFaultInjectorFunction ¶
SetFaultInjectorFunction assigns a fault injector function. If the fault injector function is non-nil, then it is called with the source and destination UDP/IP addresses. If the function then returns true, a fault is injected and the packet is dropped.
Types ¶
type AccessLevel ¶
type AccessLevel uint8
const ( NoAccess AccessLevel = iota ReadAccess WriteAccess AdminAccess PeerAccess )
func (AccessLevel) Check ¶
func (access AccessLevel) Check(category PacketCategory) bool
func (AccessLevel) String ¶
func (access AccessLevel) String() string
type Error ¶
type Error struct { Status pb.ClientResponse_Status ErrorMessage string Redirect string }
func InvalidSessionError ¶
func NotLeaderError ¶
func TimedOutError ¶
func TimedOutError() Error
func (Error) AsClientResponse ¶
func (err Error) AsClientResponse() *pb.ClientResponse
type FileSecretsManager ¶
type FileSecretsManager string
func (FileSecretsManager) LookupSecret ¶
func (path FileSecretsManager) LookupSecret(secretNum uint32) Secret
type PacketCategory ¶
type PacketCategory uint8
const ( UnknownCategory PacketCategory = iota ReadCategory WriteCategory AdminCategory PeerCategory )
func Category ¶
func Category(ptype pb.Packet_Type) PacketCategory
func (PacketCategory) String ¶
func (category PacketCategory) String() string
type Secret ¶
type Secret struct { Key []byte Access AccessLevel }
type SecretsManager ¶
type SimpleSecretsManager ¶
func (SimpleSecretsManager) LookupSecret ¶
func (secrets SimpleSecretsManager) LookupSecret(secretNum uint32) Secret
type StoredSecret ¶
func (*StoredSecret) Get ¶
func (ss *StoredSecret) Get() Secret
func (*StoredSecret) Set ¶
func (ss *StoredSecret) Set(s Secret)
Click to show internal directories.
Click to hide internal directories.