pad

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: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAccess

func CheckAccess(ctx *fiber.Ctx) error

func HandlePadOpen

func HandlePadOpen(c *fiber.Ctx) error

func NormalizeAuthzLevel

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

func UserCanModify

func UserCanModify(padId *string, req *webaccess.SocketClientRequest) 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 List

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

func NewList

func NewList() 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() Manager

func (*Manager) DoesPadExist

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

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)

type ReadOnlyManager

type ReadOnlyManager struct {
	Store db.DataStore
}

func NewReadOnlyManager

func NewReadOnlyManager() *ReadOnlyManager

func (*ReadOnlyManager) GetIds

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

func (*ReadOnlyManager) GetReadOnlyId

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

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() SecurityManager

func (*SecurityManager) CheckAccess

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

type SessionManager

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

func NewSessionManager

func NewSessionManager() *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