Documentation ¶
Index ¶
- Constants
- Variables
- func CombineClumpedTags(ct1, ct2 string) string
- func ConcatAllContentFromTags(tags []Tag) (content []byte, found bool)
- func GetIdByFilename(filename string) (id uint32, skip bool)
- func GetKind(ext string) (int, error)
- func GetLastIDs() []uint32
- func GetNextID() uint32
- func IdStr(id uint32) string
- func IncrementID()
- func ParseID(idStr string) (uint32, error)
- func ParseIDNoLogLast(idStr string) (uint32, error)
- func ParseIDOp(idStr string, logLast bool) (uint32, error)
- func PrependLast(id uint32)
- func TagUsedInNonConsuming(tag string) bool
- func TodayDate() time.Time
- func ValidateFilenameAsIdea(filename string)
- type Idea
- func NewAudioIdea(consumesIds []uint32, clumpedTags string) Idea
- func NewConsumingTextIdea(consumesIdea Idea) Idea
- func NewIdea(consumesIds []uint32, clumpedTags string, extension string) Idea
- func NewIdeaFromFile(clumpedTags string, filepath string) Idea
- func NewIdeaFromFilename(filename string, loglast bool) (idea Idea)
- func NewIdeaFromFilepath(filepath string, loglast bool) (idea Idea)
- func NewNonConsumingAudioIdea(clumpedTags string) Idea
- func NewNonConsumingTextIdea(clumpedTags string) Idea
- func NewTextIdea(consumesIds []uint32, clumpedTags string) Idea
- func (idea *Idea) AddTags(tags []Tag)
- func (idea Idea) GetClumpedTags() (out string)
- func (idea Idea) GetContent() []byte
- func (idea Idea) HasAnyOfTags(tags []Tag) bool
- func (idea Idea) HasTag(tag Tag) bool
- func (idea Idea) HasTags(tags []Tag) bool
- func (idea Idea) IsAudio() bool
- func (idea Idea) IsImage() bool
- func (idea Idea) IsText() bool
- func (idea Idea) Path() string
- func (idea Idea) Prefix() (prefix string)
- func (idea *Idea) RemoveTags(tagsToRemove []Tag)
- func (idea *Idea) RenameTag(from, to Tag)
- func (idea *Idea) SetConsumed()
- func (idea *Idea) SetZombie()
- func (idea *Idea) UpdateFilename()
- type Ideas
- func (ideas Ideas) Filenames() []string
- func (ideas Ideas) InRange(idStart, idEnd uint32) (subset Ideas)
- func (ideas Ideas) Paths() []string
- func (ideas Ideas) UniqueTags() []Tag
- func (ideas Ideas) WithAnyOfTags(tags []Tag) (subset Ideas)
- func (ideas Ideas) WithImage() (subset Ideas)
- func (ideas Ideas) WithTag(tag Tag) (subset Ideas)
- func (ideas Ideas) WithTags(tags []Tag) (subset Ideas)
- func (ideas Ideas) WithText() (subset Ideas)
- type Tag
- func MustNewTagReg(name, value string) Tag
- func NewTagAll(keyword, _ string) ([]Tag, error)
- func NewTagContains(keyword, containsWhat string) ([]Tag, error)
- func NewTagDates(keyword, date string) ([]Tag, error)
- func NewTagReg(name, value string) ([]Tag, error)
- func NewTagWithout(keyword, without string) ([]Tag, error)
- func ParseClumpedTags(clumpedTags string) []Tag
- func ParseFirstTagFromString(in string) Tag
- func ParseStringTags(strTags []string) []Tag
- func ParseTagFromString(in string) []Tag
- type TagAll
- type TagBase
- type TagContains
- type TagDates
- type TagReg
- type TagWithout
Constants ¶
const ( Last = "last" // last id keyword CycleAlive = iota CycleConsumed CycleZombie KindText = iota KindImage KindAudio KindEnText )
Variables ¶
var ( AllAliveKeyword = "ALL" AllConsumedKeyword = "ALL-CONSUMED" AllZombieKeyword = "ALL-ZOMBIE" )
var ( ContainsKeyword = "CONTAINS" ContainsCIKeyword = "CONTAINS-CI" NoContainsKeyword = "NO-CONTAINS" NoContainsCIKeyword = "NO-CONTAINS-CI" )
var ( CreatedDateKeyword = "DATE" CreatedYearKeyword = "YEAR" CreatedDatesKeyword = "DATES" EditedDateKeyword = "EDIT-DATE" EditedDatesKeyword = "EDIT-DATES" ConsumedDateKeyword = "CONSUMED-DATE" ConsumedDatesKeyword = "CONSUMED-DATES" )
var (
IdeasDir, ConfigFile, LastIdFile string
)
var WithoutKeyword = "WITHOUT"
Functions ¶
func CombineClumpedTags ¶
func GetIdByFilename ¶
func GetLastIDs ¶
func GetLastIDs() []uint32
func IncrementID ¶
func IncrementID()
func ParseIDNoLogLast ¶
func PrependLast ¶
func PrependLast(id uint32)
func TagUsedInNonConsuming ¶
func ValidateFilenameAsIdea ¶
func ValidateFilenameAsIdea(filename string)
Types ¶
type Idea ¶
type Idea struct { Filename string Cycle int // alive/consumed/zombie Id uint32 ConsumesIds []uint32 // Id of idea which this idea consumes Kind int // kind of information Ext string // file extension, blank is assumed to be text TODO does this include the '.' or not?! Created time.Time Edited time.Time Consumed time.Time Tags []Tag }
func NewAudioIdea ¶
NewAliveIdea creates a new idea object
func NewConsumingTextIdea ¶
NewConsumingTextIdea creates a new idea object
func NewIdeaFromFile ¶
func NewIdeaFromFilename ¶
func NewIdeaFromFilepath ¶
func NewNonConsumingTextIdea ¶
func NewTextIdea ¶
NewAliveIdea creates a new idea object
func (Idea) GetClumpedTags ¶
get all the tags clumped together
func (Idea) GetContent ¶
func (Idea) HasAnyOfTags ¶
returns true if the idea contains any of the input tags
func (*Idea) RemoveTags ¶
remove the tag on this idea
func (*Idea) UpdateFilename ¶
func (idea *Idea) UpdateFilename()
creates the filename based on idea information
type Ideas ¶
type Ideas []Idea
func GetAllIdeas ¶
func GetAllIdeas() (ideas Ideas)
these ideas will be sorted from oldest to newest
func GetAllIdeasNonConsuming ¶
func GetAllIdeasNonConsuming() (ideas Ideas)
func (Ideas) UniqueTags ¶
func (Ideas) WithAnyOfTags ¶
type Tag ¶
func MustNewTagReg ¶
func NewTagContains ¶
func NewTagDates ¶
can take either a single date or a [date,range]
func NewTagWithout ¶
func ParseClumpedTags ¶
parse clumped tags seperated by spaces or commas
func ParseFirstTagFromString ¶
func ParseStringTags ¶
func ParseTagFromString ¶
NOTE all tag types must be registered within this function
type TagBase ¶
a tag can be either just a name or a name and a value.
func NewTagBase ¶
NewTagBase creates a new TagBase object
type TagContains ¶
------------------------------------------
func (TagContains) Includes ¶
func (t TagContains) Includes(idea Idea) bool
type TagDates ¶
type TagDates struct { TagBase // contains filtered or unexported fields }
------------------------------------------
type TagWithout ¶
type TagWithout struct{ TagBase }
------------------------------------------
func (TagWithout) Includes ¶
func (t TagWithout) Includes(idea Idea) bool