db

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorMethods

type AuthorMethods interface {
	GetAuthor(author string) (*db.AuthorDB, error)
	GetAuthorByToken(token string) (*string, error)
	SetAuthorByToken(token string, author string) error
	SaveAuthor(author db.AuthorDB)
	SaveAuthorName(authorId string, authorName string)
	SaveAuthorColor(authorId string, authorColor int)
}

type ChatMethods

type ChatMethods interface {
	RemoveChat(padId string) error
}

type GroupMethods

type GroupMethods interface {
	GetGroup(groupId string) (*string, error)
}

type MemoryDataStore

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

func NewMemoryDataStore

func NewMemoryDataStore() *MemoryDataStore

func (*MemoryDataStore) CreatePad

func (m *MemoryDataStore) CreatePad(padID string, padDB db.PadDB) bool

func (*MemoryDataStore) CreatePad2ReadOnly

func (m *MemoryDataStore) CreatePad2ReadOnly(padId string, readonlyId string)

func (*MemoryDataStore) CreateReadOnly2Pad

func (m *MemoryDataStore) CreateReadOnly2Pad(padId string, readonlyId string)

func (*MemoryDataStore) DoesPadExist

func (m *MemoryDataStore) DoesPadExist(padID string) bool

func (*MemoryDataStore) GetAuthor

func (m *MemoryDataStore) GetAuthor(author string) (*db.AuthorDB, error)

func (*MemoryDataStore) GetAuthorByToken

func (m *MemoryDataStore) GetAuthorByToken(token string) (*string, error)

func (*MemoryDataStore) GetGroup

func (m *MemoryDataStore) GetGroup(groupId string) (*string, error)

func (*MemoryDataStore) GetPad

func (m *MemoryDataStore) GetPad(padID string) (*db.PadDB, error)

func (*MemoryDataStore) GetPadIds

func (m *MemoryDataStore) GetPadIds() []string

func (*MemoryDataStore) GetPadMetaData

func (m *MemoryDataStore) GetPadMetaData(padId string, revNum int) (*db.PadMetaData, error)

func (*MemoryDataStore) GetReadOnly2Pad

func (m *MemoryDataStore) GetReadOnly2Pad(id string) *string

func (*MemoryDataStore) GetReadonlyPad

func (m *MemoryDataStore) GetReadonlyPad(padId string) (*string, error)

func (*MemoryDataStore) GetRevision

func (m *MemoryDataStore) GetRevision(padId string, rev int) (*db.PadSingleRevision, error)

func (*MemoryDataStore) GetSessionById

func (m *MemoryDataStore) GetSessionById(sessionID string) *session2.Session

func (*MemoryDataStore) RemoveChat

func (m *MemoryDataStore) RemoveChat(padId string) error

func (*MemoryDataStore) RemovePad

func (m *MemoryDataStore) RemovePad(padID string) error

func (*MemoryDataStore) RemovePad2ReadOnly

func (m *MemoryDataStore) RemovePad2ReadOnly(id string) error

func (*MemoryDataStore) RemoveReadOnly2Pad

func (m *MemoryDataStore) RemoveReadOnly2Pad(id string) error

func (*MemoryDataStore) RemoveRevisionsOfPad

func (m *MemoryDataStore) RemoveRevisionsOfPad(padId string) error

func (*MemoryDataStore) RemoveSessionById

func (m *MemoryDataStore) RemoveSessionById(sessionID string) *session2.Session

func (*MemoryDataStore) SaveAuthor

func (m *MemoryDataStore) SaveAuthor(author db.AuthorDB)

func (*MemoryDataStore) SaveAuthorColor

func (m *MemoryDataStore) SaveAuthorColor(authorId string, authorColor int)

func (*MemoryDataStore) SaveAuthorName

func (m *MemoryDataStore) SaveAuthorName(authorId string, authorName string)

func (*MemoryDataStore) SaveRevision

func (m *MemoryDataStore) SaveRevision(padId string, rev int, changeset string,
	text apool.AText, pool apool.APool, authorId *string, timestamp int) error

func (*MemoryDataStore) SetAuthorByToken

func (m *MemoryDataStore) SetAuthorByToken(token string, author string) error

func (*MemoryDataStore) SetSessionById

func (m *MemoryDataStore) SetSessionById(sessionID string, session session2.Session)

type PadMetaData

type PadMetaData interface {
	GetPadMetaData(padId string, revNum int) (*db.PadMetaData, error)
}

type PadMethods

type PadMethods interface {
	DoesPadExist(padID string) bool
	RemovePad(padID string) error
	CreatePad(padID string, padDB db.PadDB) bool
	GetPadIds() []string
	SaveRevision(padId string, rev int, changeset string, text apool.AText, pool apool.APool, authorId *string, timestamp int) error
	GetRevision(padId string, rev int) (*db.PadSingleRevision, error)
	RemoveRevisionsOfPad(padId string) error
	GetPad(padID string) (*db.PadDB, error)
	GetReadonlyPad(padId string) (*string, error)
	CreatePad2ReadOnly(padId string, readonlyId string)
	CreateReadOnly2Pad(padId string, readonlyId string)
	GetReadOnly2Pad(id string) *string
	RemoveReadOnly2Pad(id string) error
	RemovePad2ReadOnly(id string) error
}

type SQLiteDB

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

func NewDirtyDB

func NewDirtyDB(path string) (*SQLiteDB, error)

NewDirtyDB This function creates a new SQLiteDB and returns a pointer to it.

func (SQLiteDB) CreatePad

func (d SQLiteDB) CreatePad(padID string, padDB db.PadDB) bool

func (SQLiteDB) CreatePad2ReadOnly

func (d SQLiteDB) CreatePad2ReadOnly(padId string, readonlyId string)

func (SQLiteDB) CreateReadOnly2Pad

func (d SQLiteDB) CreateReadOnly2Pad(padId string, readonlyId string)

func (SQLiteDB) DoesPadExist

func (d SQLiteDB) DoesPadExist(padID string) bool

func (SQLiteDB) GetAuthor

func (d SQLiteDB) GetAuthor(author string) (*db.AuthorDB, error)

*

  • Returns the Author Obj of the author
  • @param {String} author The id of the author

func (SQLiteDB) GetAuthorByToken

func (d SQLiteDB) GetAuthorByToken(token string) (*string, error)

func (SQLiteDB) GetGroup

func (d SQLiteDB) GetGroup(groupId string) (*string, error)

func (SQLiteDB) GetPad

func (d SQLiteDB) GetPad(padID string) (*db.PadDB, error)

func (SQLiteDB) GetPadIds

func (d SQLiteDB) GetPadIds() []string

func (SQLiteDB) GetPadMetaData

func (d SQLiteDB) GetPadMetaData(padId string, revNum int) (*db.PadMetaData, error)

func (SQLiteDB) GetReadOnly2Pad

func (d SQLiteDB) GetReadOnly2Pad(id string) *string

func (SQLiteDB) GetReadonlyPad

func (d SQLiteDB) GetReadonlyPad(padId string) (*string, error)

func (SQLiteDB) GetRevision

func (d SQLiteDB) GetRevision(padId string, rev int) (*db.PadSingleRevision, error)

func (SQLiteDB) GetSessionById

func (d SQLiteDB) GetSessionById(sessionID string) *session2.Session

func (SQLiteDB) RemoveChat

func (d SQLiteDB) RemoveChat(padId string) error

func (SQLiteDB) RemovePad

func (d SQLiteDB) RemovePad(padID string) error

func (SQLiteDB) RemovePad2ReadOnly

func (d SQLiteDB) RemovePad2ReadOnly(id string) error

func (SQLiteDB) RemoveReadOnly2Pad

func (d SQLiteDB) RemoveReadOnly2Pad(id string) error

func (SQLiteDB) RemoveRevisionsOfPad

func (d SQLiteDB) RemoveRevisionsOfPad(padId string) error

func (SQLiteDB) RemoveSessionById

func (d SQLiteDB) RemoveSessionById(sid string) *session2.Session

func (SQLiteDB) SaveAuthor

func (d SQLiteDB) SaveAuthor(author db.AuthorDB)

func (SQLiteDB) SaveAuthorColor

func (d SQLiteDB) SaveAuthorColor(authorId string, authorColor int)

func (SQLiteDB) SaveAuthorName

func (d SQLiteDB) SaveAuthorName(authorId string, authorName string)

func (SQLiteDB) SaveRevision

func (d SQLiteDB) SaveRevision(padId string, rev int, changeset string, text apool.AText, pool apool.APool, authorId *string, timestamp int) error

func (SQLiteDB) SetAuthorByToken

func (d SQLiteDB) SetAuthorByToken(token, authorId string) error

func (SQLiteDB) SetSessionById

func (d SQLiteDB) SetSessionById(sessionID string, session session2.Session)

type SessionMethods

type SessionMethods interface {
	GetSessionById(sessionID string) *session2.Session
	SetSessionById(sessionID string, session session2.Session)
	RemoveSessionById(sessionID string) *session2.Session
}

Jump to

Keyboard shortcuts

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