minioproto

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

README

minio-proto

Minio Caching for Protobuffers.

This is a simple library for using Minio for caching protbuffer payloads.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a basic wrapper around minio.Client with support for storing Protobuf, JSON or CSV files.

func New

func New(ctx context.Context, logger *zap.Logger, bucketName, address, accessKey, accessSecret, token string, useSSL bool) (*Cache, error)

New creates a Cache instance using the given configuration

func NewFromURL

func NewFromURL(ctx context.Context, logger *zap.Logger, connectionURL string) (*Cache, error)

NewFromURL creates a new instance using a connection url: > http(s)://<user>:<password>@<host>/<bucket>?token=<token>

func (*Cache) CSVExists

func (cache *Cache) CSVExists(path string, opts minio.StatObjectOptions) (*minio.ObjectInfo, error)

CSVExists checks if CSV file exists in minio

func (*Cache) DataExists

func (cache *Cache) DataExists(path string, opts minio.StatObjectOptions) (*minio.ObjectInfo, error)

DataExists checks to see if the given path exists

func (*Cache) GetCSV

func (cache *Cache) GetCSV(path string, opts minio.GetObjectOptions) ([][]string, error)

GetCSV reads a CSV file from minio

func (*Cache) GetJSON

func (cache *Cache) GetJSON(path string, output interface{}, opts minio.GetObjectOptions) error

GetJSON reads a JSON file from minio

func (*Cache) GetPROTO

func (cache *Cache) GetPROTO(path string, data proto.Message, unmarshalOpts *proto.UnmarshalOptions, opts minio.GetObjectOptions) error

GetPROTO reads a PROTO file from minio

func (*Cache) JSONExists

func (cache *Cache) JSONExists(path string, opts minio.StatObjectOptions) (*minio.ObjectInfo, error)

JSONExists checks if JSON file exists in minio

func (*Cache) PROTOExists

func (cache *Cache) PROTOExists(path string, opts minio.StatObjectOptions) (*minio.ObjectInfo, error)

PROTOExists checks if PROTO file exists in minio

func (*Cache) PutCSV

func (cache *Cache) PutCSV(path string, records [][]string, opts minio.PutObjectOptions) error

PutCSV writes a CSV file to minio

func (*Cache) PutJSON

func (cache *Cache) PutJSON(path string, data interface{}, opts minio.PutObjectOptions) error

PutJSON writes a JSON file to minio

func (*Cache) PutPROTO

func (cache *Cache) PutPROTO(path string, data proto.Message, marshalOpts *proto.MarshalOptions, opts minio.PutObjectOptions) error

PutPROTO writes a PROTO file to minio

func (*Cache) ReadData

func (cache *Cache) ReadData(path string, opts minio.GetObjectOptions) ([]byte, error)

ReadData reads the raw bytes from the minio Cache

func (*Cache) WriteData

func (cache *Cache) WriteData(path string, data []byte, opts minio.PutObjectOptions) error

WriteData writes the raw bytes from the minio Cache

Jump to

Keyboard shortcuts

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