piwigotools

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChunkSize      int64 = 1 * 1024 * 1024
	ChunkBuffSize  int64 = 32 * 1024
	ChunkBuffCount       = ChunkSize / ChunkBuffSize
)

Functions

This section is empty.

Types

type ActivePlugin

type ActivePlugin map[string]bool

func (ActivePlugin) MarshalJSON

func (uft ActivePlugin) MarshalJSON() ([]byte, error)

func (ActivePlugin) String

func (uft ActivePlugin) String() string

func (*ActivePlugin) UnmarshalJSON

func (uft *ActivePlugin) UnmarshalJSON(data []byte) error

type Categories

type Categories []*Category

func (*Categories) Names

func (c *Categories) Names() []string

type Category

type Category struct {
	Id               int    `json:"id"`
	Name             string `json:"name"`
	ImagesCount      int    `json:"nb_images"`
	TotalImagesCount int    `json:"total_nb_images"`
	Url              string `json:"url"`
}

type FileInfo

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

type FileToUpload

type FileToUpload struct {
	Dir        string
	Name       string
	CategoryId int
	// contains filtered or unexported fields
}

func (*FileToUpload) Base64BuildChunk added in v0.0.3

func (f *FileToUpload) Base64BuildChunk() (chan *FileToUploadChunk, error)

func (*FileToUpload) Checked

func (f *FileToUpload) Checked() bool

func (*FileToUpload) CreatedAt

func (f *FileToUpload) CreatedAt() *TimeResult

func (*FileToUpload) Ext

func (f *FileToUpload) Ext() *string

func (*FileToUpload) FullPath

func (f *FileToUpload) FullPath() *string

func (*FileToUpload) MD5

func (f *FileToUpload) MD5() *string

func (*FileToUpload) Size

func (f *FileToUpload) Size() *int64

type FileToUploadChunk

type FileToUploadChunk struct {
	Position int64
	Size     int64
	Buffer   bytes.Buffer
}

type FileToUploadStat

type FileToUploadStat struct {
	Checked  uint32
	Total    uint32
	Uploaded uint32
	Skipped  uint32
	Failed   uint32

	UploadedBytes int64
	TotalBytes    int64
	// contains filtered or unexported fields
}

func NewFileToUploadStat

func NewFileToUploadStat() *FileToUploadStat

func (*FileToUploadStat) Add

func (s *FileToUploadStat) Add()

func (*FileToUploadStat) AddBytes

func (s *FileToUploadStat) AddBytes(filesize int64)

func (*FileToUploadStat) Check

func (s *FileToUploadStat) Check()

func (*FileToUploadStat) Close

func (s *FileToUploadStat) Close()

func (*FileToUploadStat) Commit

func (s *FileToUploadStat) Commit(fileread int64)

func (*FileToUploadStat) Done

func (s *FileToUploadStat) Done()

func (*FileToUploadStat) Error

func (s *FileToUploadStat) Error(origin string, filename string, err error)

func (*FileToUploadStat) Fail

func (s *FileToUploadStat) Fail()

func (*FileToUploadStat) Skip

func (s *FileToUploadStat) Skip()

type ImageDetails

type ImageDetails struct {
	Id            int        `json:"id"`
	Md5           string     `json:"md5sum"`
	Name          string     `json:"name"`
	DateAvailable TimeResult `json:"date_available"`
	DateCreation  TimeResult `json:"date_creation"`
	LastModified  TimeResult `json:"lastmodified"`
	Width         int        `json:"width"`
	Height        int        `json:"height"`
	Url           string     `json:"page_url"`
	ImageUrl      string     `json:"element_url"`
	Filename      string     `json:"file"`
	Filesize      int64      `json:"filesize"`
	Categories    Categories `json:"categories"`
	Tags          Tags       `json:"tags"`
	Derivatives   map[string]struct {
		Height int    `json:"height"`
		Width  int    `json:"width"`
		Url    string `json:"url"`
	} `json:"derivatives"`
}

func (*ImageDetails) Preview

func (img *ImageDetails) Preview(height int) (string, error)

type Tag

type Tag struct {
	Id           int        `json:"id,string"`
	Name         string     `json:"name"`
	LastModified TimeResult `json:"lastmodified"`
	Birthdate    TimeResult `json:"birthdate"`
	Url          string     `json:"url"`
	UrlName      string     `json:"url_name"`
	ImageUrl     string     `json:"page_url"`
}

func (*Tag) NameWithAgeAt

func (t *Tag) NameWithAgeAt(createdAt *TimeResult) string

type Tags

type Tags []*Tag

func (Tags) Ids

func (t Tags) Ids() []int

func (Tags) JoinIds

func (t Tags) JoinIds(sep string) string

func (Tags) NamesWithAgeAt

func (t Tags) NamesWithAgeAt(createdAt *TimeResult) []string

func (Tags) Selector

func (t Tags) Selector(exclude *regexp.Regexp, keepFilter bool, keepPreviousAnswer bool) func() Tags

type TimeResult

type TimeResult time.Time

func (TimeResult) AgeAt

func (c TimeResult) AgeAt(createdAt *TimeResult) string

func (TimeResult) MarshalJSON

func (c TimeResult) MarshalJSON() ([]byte, error)

func (TimeResult) String

func (c TimeResult) String() string

func (*TimeResult) UnmarshalJSON

func (c *TimeResult) UnmarshalJSON(b []byte) error

type UploadFileType

type UploadFileType map[string]bool

func (UploadFileType) Has

func (uft UploadFileType) Has(s string) bool

func (UploadFileType) MarshalJSON

func (uft UploadFileType) MarshalJSON() ([]byte, error)

func (UploadFileType) String

func (uft UploadFileType) String() string

func (*UploadFileType) UnmarshalJSON

func (uft *UploadFileType) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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