pad

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableFonts = []string{
	"Quicksand",
	"Roboto",
	"Alegreya",
	"PlayfairDisplay",
	"Montserrat",
	"OpenDyslexic",
	"RobotoMono",
}

Functions

func CheckAccess

func CheckAccess(ctx *fiber.Ctx, logger *zap.SugaredLogger, retrievedSettings *settings.Settings, readOnlyManager *ReadOnlyManager) error

func CreateNewPad added in v0.0.2

func CreateNewPad(ds db.DataStore) *pad.Pad

func GetTxtFromAText added in v0.0.2

func GetTxtFromAText(retrievedPad *pad.Pad, atext apool.AText) (*string, error)

func HandlePadOpen

func HandlePadOpen(c *fiber.Ctx, uiAssets embed.FS, retrievedSettings *settings.Settings) error

func NormalizeAuthzLevel

func NormalizeAuthzLevel(level interface{}) (*string, error)

func SplitRemoveLastRune added in v0.0.2

func SplitRemoveLastRune(s string) []string

func UserCanModify

func UserCanModify(padId *string, req *webaccess.SocketClientRequest, readOnlyManager ReadOnlyManager) bool

Types

type ClientType

type ClientType interface {
}

type GlobalPadCache

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

func (*GlobalPadCache) DeletePad

func (g *GlobalPadCache) DeletePad(padID string)

func (*GlobalPadCache) GetPad

func (g *GlobalPadCache) GetPad(padID string) *pad.Pad

func (*GlobalPadCache) SetPad

func (g *GlobalPadCache) SetPad(padID string, pad *pad.Pad)

type GrantedAccess

type GrantedAccess struct {
	AccessStatus string
	AuthorId     string
}

type IdRequest

type IdRequest struct {
	ReadOnlyPadId string
	PadId         string
	ReadOnly      bool
}

type LineModel added in v0.0.2

type LineModel struct {
	ListLevel    int
	Text         []rune
	Aline        string
	ListTypeName string
	Start        string
}

func AnalyzeLine added in v0.0.2

func AnalyzeLine(text string, aline string, attrpool apool.APool) (*LineModel, error)

type List

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

func NewList

func NewList(db db.DataStore) List

func (*List) AddPad

func (l *List) AddPad(padID string)

func (*List) GetPads

func (l *List) GetPads() []string

func (*List) RemovePad

func (l *List) RemovePad(padID string)

type Manager

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

func NewManager

func NewManager(db db.DataStore, hook *hooks.Hook) *Manager

func (*Manager) DoesPadExist

func (m *Manager) DoesPadExist(padID string) (*bool, error)

func (*Manager) GetPad

func (m *Manager) GetPad(padID string, text *string, authorId *string) (*pad.Pad, error)

func (*Manager) IsValidPadId

func (m *Manager) IsValidPadId(padID string) bool

func (*Manager) RemovePad

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

func (*Manager) SanitizePadId

func (m *Manager) SanitizePadId(padID string) (*string, error)

func (*Manager) UnloadPad added in v0.0.2

func (m *Manager) UnloadPad(id string)

type ReadOnlyManager

type ReadOnlyManager struct {
	Store db.DataStore
}

func NewReadOnlyManager

func NewReadOnlyManager(db db.DataStore) *ReadOnlyManager

func (*ReadOnlyManager) GetIds

func (r *ReadOnlyManager) GetIds(id *string) (*IdRequest, error)

func (*ReadOnlyManager) GetPadId added in v0.0.2

func (r *ReadOnlyManager) GetPadId(readonlyId string) (*string, error)

func (*ReadOnlyManager) GetReadOnlyId

func (r *ReadOnlyManager) GetReadOnlyId(pad string) string

func (*ReadOnlyManager) IsReadOnlyID added in v0.0.2

func (r *ReadOnlyManager) IsReadOnlyID(id *string) bool

func (*ReadOnlyManager) RemoveReadOnlyPad

func (r *ReadOnlyManager) RemoveReadOnlyPad(readonlyId, padId string) error

type SecurityManager

type SecurityManager struct {
	ReadOnlyManager *ReadOnlyManager
	PadManager      *Manager
	AuthorManager   *author.Manager
	SessionManager  *SessionManager
}

func NewSecurityManager

func NewSecurityManager(db db.DataStore, hooks *hooks.Hook, padManager *Manager) *SecurityManager

func (*SecurityManager) CheckAccess

func (s *SecurityManager) CheckAccess(padId *string, sessionCookie *string, token *string, userSettings *webaccess.SocketClientRequest) (*GrantedAccess, error)

func (*SecurityManager) HasPadAccess added in v0.0.2

func (s *SecurityManager) HasPadAccess(ctx *fiber.Ctx) bool

type SessionManager

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

func NewSessionManager

func NewSessionManager(db db.DataStore) *SessionManager

type UserSettings

type UserSettings struct {
	CanCreate         bool
	ReadOnly          bool
	PadAuthorizations *map[string]string
}

Jump to

Keyboard shortcuts

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