fsdb

package
v1.4.68 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Name    string
	Content string
}

type ContextsEntity

type ContextsEntity struct {
	*StorageEntity
}

func (*ContextsEntity) Get

func (o *ContextsEntity) Get(name string) (ret *Context, err error)

Get Load a context from file

func (*ContextsEntity) PrintContext

func (o *ContextsEntity) PrintContext(name string) (err error)

type Db

type Db struct {
	Dir string

	Patterns *PatternsEntity
	Sessions *SessionsEntity
	Contexts *ContextsEntity

	EnvFilePath string
}

func NewDb

func NewDb(dir string) (db *Db)

func (*Db) Configure

func (o *Db) Configure() (err error)

func (*Db) FilePath

func (o *Db) FilePath(fileName string) (ret string)

func (*Db) IsEnvFileExists

func (o *Db) IsEnvFileExists() (ret bool)

func (*Db) LoadEnvFile

func (o *Db) LoadEnvFile() (err error)

func (*Db) SaveEnv

func (o *Db) SaveEnv(content string) (err error)

type DirectoryChange

type DirectoryChange struct {
	Dir       string
	Timestamp time.Time
}

type Pattern

type Pattern struct {
	Name        string
	Description string
	Pattern     string
}

type PatternsEntity

type PatternsEntity struct {
	*StorageEntity
	SystemPatternFile      string
	UniquePatternsFilePath string
}

func (*PatternsEntity) Get

func (o *PatternsEntity) Get(name string) (ret *Pattern, err error)

func (*PatternsEntity) GetApplyVariables

func (o *PatternsEntity) GetApplyVariables(name string, variables map[string]string) (ret *Pattern, err error)

GetApplyVariables finds a pattern by name and returns the pattern as an entry or an error

func (*PatternsEntity) PrintLatestPatterns

func (o *PatternsEntity) PrintLatestPatterns(latestNumber int) (err error)

type Session

type Session struct {
	Name     string
	Messages []*common.Message
	// contains filtered or unexported fields
}

func (*Session) Append

func (o *Session) Append(messages ...*common.Message)

func (*Session) GetLastMessage

func (o *Session) GetLastMessage() (ret *common.Message)

func (*Session) GetVendorMessages

func (o *Session) GetVendorMessages() (ret []*common.Message)

func (*Session) IsEmpty

func (o *Session) IsEmpty() bool

func (*Session) String

func (o *Session) String() (ret string)

type SessionsEntity

type SessionsEntity struct {
	*StorageEntity
}

func (*SessionsEntity) Get

func (o *SessionsEntity) Get(name string) (session *Session, err error)

func (*SessionsEntity) PrintSession

func (o *SessionsEntity) PrintSession(name string) (err error)

func (*SessionsEntity) SaveSession

func (o *SessionsEntity) SaveSession(session *Session) (err error)

type StorageEntity

type StorageEntity struct {
	Label         string
	Dir           string
	ItemIsDir     bool
	FileExtension string
}

func (*StorageEntity) BuildFilePath

func (o *StorageEntity) BuildFilePath(fileName string) (ret string)

func (*StorageEntity) BuildFilePathByName

func (o *StorageEntity) BuildFilePathByName(name string) (ret string)

func (*StorageEntity) Configure

func (o *StorageEntity) Configure() (err error)

func (*StorageEntity) Delete

func (o *StorageEntity) Delete(name string) (err error)

func (*StorageEntity) Exists

func (o *StorageEntity) Exists(name string) (ret bool)

func (*StorageEntity) GetNames

func (o *StorageEntity) GetNames() (ret []string, err error)

GetNames finds all patterns in the patterns directory and enters the id, name, and pattern into a slice of Entry structs. it returns these entries or an error

func (*StorageEntity) ListNames

func (o *StorageEntity) ListNames() (err error)

func (*StorageEntity) Load

func (o *StorageEntity) Load(name string) (ret []byte, err error)

func (*StorageEntity) LoadAsJson

func (o *StorageEntity) LoadAsJson(name string, item interface{}) (err error)

func (*StorageEntity) Rename

func (o *StorageEntity) Rename(oldName, newName string) (err error)

func (*StorageEntity) Save

func (o *StorageEntity) Save(name string, content []byte) (err error)

func (*StorageEntity) SaveAsJson

func (o *StorageEntity) SaveAsJson(name string, item interface{}) (err error)

Jump to

Keyboard shortcuts

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