mirror

package
v0.0.0-...-93694fd Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Path          string    `json:"path"`
	OriginURL     string    `json:"origin_url"`
	ContentLength int64     `json:"content_length"`
	ContentType   string    `json:"content_type"`
	LastModified  time.Time `json:"last_modified"`
}

File struct

type Mirror

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

Mirror struct

var M *Mirror

M Mirror instance

func NewMirror

func NewMirror() *Mirror

NewMirror new a mirror

func (*Mirror) AddFile

func (receiver *Mirror) AddFile(bucketName string, file File) bool

AddFile add file to bucket @return ok bool. false: nothing changed, true: file data have been written

func (*Mirror) AddFolder

func (receiver *Mirror) AddFolder(path string, lastModified time.Time)

AddFolder add a folder

func (*Mirror) FileExists

func (receiver *Mirror) FileExists(bucketName string, path string) bool

FileExists check file is exists

func (*Mirror) GetFileInfo

func (receiver *Mirror) GetFileInfo(path string) *File

GetFileInfo get file info

func (*Mirror) GetFolderInfo

func (receiver *Mirror) GetFolderInfo(parentPath string) map[string]WebFile

GetFolderInfo get folder info

func (*Mirror) ListBuckets

func (receiver *Mirror) ListBuckets() []string

ListBuckets get bucket name list

func (*Mirror) ListFiles

func (receiver *Mirror) ListFiles(bucketName string) []*File

ListFiles get file name list of bucket

type WebFile

type WebFile struct {
	LastModified time.Time
	F            *File
}

WebFile struct

Jump to

Keyboard shortcuts

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