calibre

package
v0.0.0-...-950254a Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

判断所给路径文件/文件夹是否存在

func IsDir

func IsDir(path string) bool

判断所给路径是否为文件夹

func IsFile

func IsFile(path string) bool

判断所给路径是否为文件

Types

type Api

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

func NewClient

func NewClient(config *Config) Api

func (Api) SetupRouter

func (c Api) SetupRouter(r *gin.Engine)

type Book

type Book struct {
	AuthorSort  string   `json:"author_sort"`
	Authors     string   `json:"authors"`
	Cover       string   `json:"cover"`
	Formats     []string `json:"formats"`
	ID          int64    `json:"id"`
	Identifiers struct {
		MobiAsin string `json:"mobi-asin"`
	} `json:"identifiers"`
	Isbn         string    `json:"isbn"`
	Languages    []string  `json:"languages"`
	LastModified time.Time `json:"last_modified"`
	Pubdate      time.Time `json:"pubdate"`
	Publisher    string    `json:"publisher"`
	SeriesIndex  float64   `json:"series_index"`
	Size         int64     `json:"size"`
	Tags         []string  `json:"tags"`
	Timestamp    time.Time `json:"timestamp"`
	Title        string    `json:"title"`
	UUID         string    `json:"uuid"`
}

type Config

type Config struct {
	Address string  `mapstructure:"address"`
	Debug   bool    `mapstructure:"debug"`
	Search  Search  `mapstructure:"search"`
	Storage Storage `mapstructure:"storage"`
}

type FileClient

type FileClient interface {
	Stat(path string) (os.FileInfo, error)
	ReadStream(path string) (io.ReadCloser, error)
}

func NewLocalClient

func NewLocalClient(local Local) FileClient

func NewMinioClient

func NewMinioClient(config Minio, ctx context.Context) (FileClient, error)

func NewWebDavClient

func NewWebDavClient(webdav Webdav) FileClient

type FileInfo

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

func (*FileInfo) IsDir

func (s *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (s *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (s *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (s *FileInfo) Name() string

Name Implements os.FileInfo

func (*FileInfo) Size

func (s *FileInfo) Size() int64

func (*FileInfo) Sys

func (s *FileInfo) Sys() interface{}

type Local

type Local struct {
	Path string `mapstructure:"path"`
}

type LocalFileClient

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

func (LocalFileClient) ReadStream

func (l LocalFileClient) ReadStream(p string) (io.ReadCloser, error)

func (LocalFileClient) Stat

func (l LocalFileClient) Stat(p string) (os.FileInfo, error)

type Minio

type Minio struct {
	Endpoint        string `mapstructure:"endpoint"`
	AccessKeyID     string `mapstructure:"accessKeyID"`
	SecretAccessKey string `mapstructure:"secretAccessKey"`
	UseSSL          bool   `mapstructure:"useSSL"`
	BucketName      string `mapstructure:"bucketName"`
	Path            string `mapstructure:"path"`
}

type MinioFileClient

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

func (MinioFileClient) ReadStream

func (m MinioFileClient) ReadStream(p string) (io.ReadCloser, error)

func (MinioFileClient) Stat

func (m MinioFileClient) Stat(p string) (os.FileInfo, error)
type Search struct {
	Host     string `mapstructure:"host"`
	APIKey   string `mapstructure:"apikey"`
	Index    string `mapstructure:"index"`
	TrimPath string `mapstructure:"trimPath"`
}

type Storage

type Storage struct {
	Use    string `mapstructure:"use"`
	TmpDir string `mapstructure:"tmpdir"`
	Webdav Webdav `mapstructure:"webdav"`
	Minio  Minio  `mapstructure:"minio"`
	Local  Local  `mapstructure:"local"`
}

type Webdav

type Webdav struct {
	Host     string `mapstructure:"host"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	Path     string `mapstructure:"path"`
}

Jump to

Keyboard shortcuts

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