storage

package
v0.0.0-...-4c0342d Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LocalStorage

type LocalStorage struct {
	RootPath   string
	CustomPath string
}

func NewLocalStorage

func NewLocalStorage(rootpath string, CustomPath string) LocalStorage

func (LocalStorage) BuildIndex

func (ls LocalStorage) BuildIndex(content []byte) error

func (LocalStorage) GetCookies

func (ls LocalStorage) GetCookies() ([]*http.Cookie, error)

func (LocalStorage) ID2FrontendID

func (ls LocalStorage) ID2FrontendID(questionID int) int

func (LocalStorage) ReadDetail

func (ls LocalStorage) ReadDetail(name string) (client.Question, error)

func (LocalStorage) ReadList

func (ls LocalStorage) ReadList() (client.AlgorithmList, error)

func (LocalStorage) ReadTypedCode

func (ls LocalStorage) ReadTypedCode(name string, extension string) string

func (LocalStorage) SaveAlgorithmAns

func (ls LocalStorage) SaveAlgorithmAns(name string, extension string, content []byte) string

func (LocalStorage) SaveAlgorithmDetail

func (ls LocalStorage) SaveAlgorithmDetail(algorithmDetail []byte, titleSlug string) error

func (LocalStorage) SaveAlgorithmList

func (ls LocalStorage) SaveAlgorithmList(algorithmList []byte) error

func (LocalStorage) SaveConnectionInfo

func (ls LocalStorage) SaveConnectionInfo(info client.ConnectionInfo) error

func (LocalStorage) SearchIndexWithID

func (ls LocalStorage) SearchIndexWithID(questionID int) string

type QuestionIndex

type QuestionIndex struct {
	QuestionID         int
	QuestionFrontendID int
	QuestionTitle      string
	QuestionTitleSlug  string
}

type Storage

type Storage interface {
	SaveConnectionInfo(info client.ConnectionInfo) error
	SaveAlgorithmList(algorithmList []byte) error
	BuildIndex(content []byte) error
	SearchIndexWithID(questionID int) string
	SaveAlgorithmDetail(algorithmDetail []byte, titleSlug string) error
	GetCookies() ([]*http.Cookie, error)
	ReadList() (client.AlgorithmList, error)
	ReadDetail(name string) (client.Question, error)
	SaveAlgorithmAns(name string, extension string, content []byte) string
	ReadTypedCode(name string, extension string) string
	ID2FrontendID(questionID int) int
}

func StorageGetter

func StorageGetter(conf config.TomlConfig) Storage

type StorageArgs

type StorageArgs struct {
	Path string
}

Jump to

Keyboard shortcuts

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