storage

package
v0.0.0-...-cd88b06 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2017 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright 2017 The GoStor Authors All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoSuchBucket = errors.New("No such bucket")

ErrNoSuchBucket - returned when bucket is not found.

View Source
var ErrNoSuchObject = errors.New("No such object")

ErrNoSuchObject - returned when object is not found.

Functions

func IsNoSuchObject

func IsNoSuchObject(err error) bool

IsNoSuchObject - is err ErrNoSuchObject ?

Types

type Bucket

type Bucket interface {
	Auth() error
	Create() error
	Delete() error
	Get() error
	Object(name string) Object
}

type MinioBucket

type MinioBucket struct {
	Name string
	// contains filtered or unexported fields
}

func (*MinioBucket) Auth

func (mb *MinioBucket) Auth() error

func (*MinioBucket) Create

func (mb *MinioBucket) Create() error

func (*MinioBucket) Delete

func (mb *MinioBucket) Delete() error

func (*MinioBucket) Get

func (mb *MinioBucket) Get() error

func (*MinioBucket) Object

func (mb *MinioBucket) Object(name string) Object

type MinioStorage

type MinioStorage struct {
	Endpoint string
}

func NewMinioStorage

func NewMinioStorage(ep string) *MinioStorage

func (*MinioStorage) Bucket

func (ms *MinioStorage) Bucket(name string, cfg *api.Config) (Bucket, error)

func (*MinioStorage) Ping

func (ms *MinioStorage) Ping() error

type Object

type Object interface {
	Stat() error
	Delete() error
}

type ObjectInfo

type ObjectInfo struct {
	// Name of the bucket.
	Bucket string

	// Name of the object.
	Name string

	// Date and time when the object was last modified.
	ModTime time.Time

	// Total object size.
	Size int64

	// IsDir indicates if the object is prefix.
	IsDir bool

	// Hex encoded unique entity tag of the object.
	ETag string

	// A standard MIME type describing the format of the object.
	ContentType string

	// Specifies what content encodings have been applied to the object and thus
	// what decoding mechanisms must be applied to obtain the object referenced
	// by the Content-Type header field.
	ContentEncoding string
}

ObjectInfo - represents object metadata.

func (*ObjectInfo) Delete

func (mo *ObjectInfo) Delete() error

func (*ObjectInfo) Stat

func (mo *ObjectInfo) Stat() error

type Storage

type Storage interface {
	Ping() error

	Bucket(name string, cfg *api.Config) (Bucket, error)
}

Jump to

Keyboard shortcuts

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