Documentation
¶
Index ¶
- func GenerateIntID() int64
- func GenerateMediaHash(data []byte) string
- func SanitizeFilename(filename string) string
- type BasicModel
- type ClozeModel
- type Database
- func (d *Database) AddCard(noteID, deckID int64, templateOrd int) (*Database, error)
- func (d *Database) AddDeck(deck *Deck) (*Database, error)
- func (d *Database) AddModel(model *Model) (*Database, error)
- func (d *Database) AddNote(note *Note) (*Database, error)
- func (d *Database) Close() error
- func (d *Database) GetFilePath() (string, error)
- func (d *Database) SetDebug(debug bool) *Database
- func (d *Database) VerifyContent() error
- type Deck
- type Field
- type MediaFile
- type Model
- type Note
- type Package
- func (p *Package) AddMedia(filename string, data []byte) *Package
- func (p *Package) AddMediaFromPath(path string) error
- func (p *Package) AddMediaFromReader(filename string, reader io.Reader) error
- func (p *Package) AddModel(model *Model) *Package
- func (p *Package) ClearMedia()
- func (p *Package) GetMediaCount() int
- func (p *Package) GetMediaFile(filename string) *MediaFile
- func (p *Package) GetMediaFiles() []*MediaFile
- func (p *Package) GetMediaSize() int64
- func (p *Package) RemoveMedia(filename string)
- func (p *Package) SetDebug(debug bool) *Package
- func (p *Package) WriteToFile(path string) error
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIntID ¶
func GenerateIntID() int64
func GenerateMediaHash ¶
func SanitizeFilename ¶
Types ¶
type BasicModel ¶
type BasicModel struct {
*Model
}
func NewBasicModel ¶
func NewBasicModel(id int64, name string) *BasicModel
func StandardBasicModel ¶
func StandardBasicModel(name string) *BasicModel
StandardBasicModel creates a new basic model with Anki's standard model ID
type ClozeModel ¶
type ClozeModel struct {
*Model
}
func NewClozeModel ¶
func NewClozeModel(id int64, name string) *ClozeModel
func StandardClozeModel ¶
func StandardClozeModel(name string) *ClozeModel
StandardClozeModel creates a new cloze model with Anki's standard model ID
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) GetFilePath ¶
func (*Database) VerifyContent ¶
type Deck ¶
type Deck struct { ID int64 Name string Desc string Notes []*Note Media map[string][]byte Created time.Time Modified time.Time }
func StandardDeck ¶
StandardDeck creates a new deck with Anki's standard deck ID
type MediaFile ¶
func NewMediaFile ¶
func NewMediaFileFromPath ¶
func NewMediaFileFromReader ¶
func (*MediaFile) GetMimeType ¶
type Model ¶
func (*Model) AddTemplate ¶
type Note ¶
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func NewPackage ¶
func NewPackage(data interface{}) *Package
NewPackage creates a new package from decks or a database
func (*Package) AddMediaFromPath ¶
func (*Package) AddMediaFromReader ¶
func (*Package) ClearMedia ¶
func (p *Package) ClearMedia()
func (*Package) GetMediaCount ¶
func (*Package) GetMediaFile ¶
func (*Package) GetMediaFiles ¶
func (*Package) GetMediaSize ¶
func (*Package) RemoveMedia ¶
func (*Package) WriteToFile ¶
Click to show internal directories.
Click to hide internal directories.