protosink

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package protosink provides a cache.Sink using Protobuf encoding

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProtoSink

type ProtoSink struct {
	// contains filtered or unexported fields
}

ProtoSink is a Sink using Proto for encoding

func (*ProtoSink) Bytes

func (sink *ProtoSink) Bytes() []byte

Bytes returns the Protobuf encoded representation of the object in the Sink.

func (*ProtoSink) Expire

func (sink *ProtoSink) Expire() time.Time

Expire tells when this object will be evicted from the Cache

func (*ProtoSink) Len

func (sink *ProtoSink) Len() int

Len returns the length of the Protobuf encoded representation of the object in the Sink. 0 if empty

func (*ProtoSink) Reset

func (sink *ProtoSink) Reset()

Reset clears everything but the type pointer assigned during creation

func (*ProtoSink) SetBytes

func (sink *ProtoSink) SetBytes(v []byte, e time.Time) error

SetBytes sets the object of the ProtoSink and its expiration time from a Protobuf encoded byte array

func (*ProtoSink) SetString

func (sink *ProtoSink) SetString(s string, e time.Time) error

SetString sets the object of the ProtoSink and its expiration time from a Protobuf encoded string

func (*ProtoSink) SetValue

func (sink *ProtoSink) SetValue(v any, e time.Time) error

SetValue sets the object of the ProtoSink and its expiration time

func (*ProtoSink) Value

func (sink *ProtoSink) Value() proto.Message

Value returns the stored object

Jump to

Keyboard shortcuts

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