swift

package
v0.0.0-...-98ff0be Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteFile

func DeleteFile(token string, server string, options Options) bool

Delete deletes a file from swift

func DeleteWithPrefix

func DeleteWithPrefix(token string, server string, options Options)

DeleteWithPrefix deletes all files matching prefix

func DeleteWithSegments

func DeleteWithSegments(token string, server string, options Options)

DeleteWithSegments deletes a file and segments if any from swift

func Download

func Download(token string, server string, options Options) bool

Download downloads a file from swift

func DownloadWithPrefix

func DownloadWithPrefix(token string, server string, options Options)

DownloadWithPrefix downloads all files matching prefix from swift

func Head(token string, server string, options Options) string

Head checks if remote file is a multi-part object, return manifest value

func Show

func Show(token string, server string, options Options) (data map[string]string, err error)

Show prints object meta data

func Upload

func Upload(token string, server string, options Options) bool

Upload uploads a file to swift

Types

type Options

type Options struct {
	Bucket        string
	File          string
	ObjectName    string
	Size          int64
	Prefix        string
	LeaveSegments bool
	Meta          map[string]string
}

Options to access swift content

type Segment

type Segment struct {
	From int64
	Size int64
}

type SwiftFile

type SwiftFile struct {
	Hash         string
	LastModified string `json:"last_modified"`
	Bytes        uint64
	Name         string
	ContentType  string `json:"content_type"`
}

SwiftFile describe a swift object

func List

func List(token string, server string, options Options) []SwiftFile

List list swift content

Jump to

Keyboard shortcuts

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