blob

package
v0.0.0-...-302cdf8 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DiskBasedStreamConfig = nats.StreamConfig{
		Name: "blob_store",
		Subjects: []string{
			subject.WithPrefix("STORE.BLOB.*"),
			subject.WithPrefix("STORE.CHUNK.*"),
		},
		Replicas:          1,
		Discard:           nats.DiscardOld,
		MaxMsgsPerSubject: 1,
		Storage:           nats.FileStorage,
		AllowRollup:       true,
		AllowDirect:       true,
		Compression:       nats.S2Compression,

		RePublish: &nats.RePublish{
			Source:      subject.WithPrefix("STORE.*.*"),
			Destination: subject.WithPrefix("CACHE.{{wildcard(1)}}.{{wildcard(2)}}"),
		},
	}

	MemoryBasedStreamConfig = nats.StreamConfig{
		Name: "blob_cache",
		Subjects: []string{
			subject.WithPrefix("CACHE.BLOB.*"),
			subject.WithPrefix("CACHE.CHUNK.*"),
		},
		Replicas:          1,
		Discard:           nats.DiscardOld,
		MaxMsgsPerSubject: 1,
		MaxBytes:          1024 * 1024 * 128,
		Storage:           nats.MemoryStorage,
		AllowRollup:       true,
		AllowDirect:       true,
	}
)

Functions

func NewChunkStore

func NewChunkStore(conn *nats.Conn) store.Store

func NewMetaStore

func NewMetaStore(conn *nats.Conn) store.Store

Types

type Server

type Server struct {
	capb.UnimplementedBlobServiceServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(conn *nats.Conn) (*Server, error)

func (*Server) GetByDigest

func (s *Server) GetByDigest(digest store.Digest, ctx context.Context) (io.ReadCloser, error)

func (*Server) Put

func (s *Server) Put(server capb.BlobService_PutServer) (err error)

func (*Server) Read

func (s *Server) Read(request *capb.ReadBlobRequest, server capb.BlobService_ReadServer) error

func (*Server) Stat

func (s *Server) Stat(ctx context.Context, request *capb.StatBlobRequest) (*capb.BlobMeta, error)

Jump to

Keyboard shortcuts

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