view

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package view handles the management of conversation views.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func New

func New(opts Opts) (*Manager, error)

New creates and returns a new instance of the Manager.

func (*Manager) Create

func (v *Manager) Create(name string, filter []byte, userID int) (models.View, error)

Create creates a new view (personal view with visibility='user').

func (*Manager) CreateSharedView

func (v *Manager) CreateSharedView(name string, filter []byte, visibility string, teamID *int) (models.View, error)

CreateSharedView creates a new shared view (admin only).

func (*Manager) Delete

func (v *Manager) Delete(id int) error

Delete deletes a view by ID.

func (*Manager) Get

func (v *Manager) Get(id int) (models.View, error)

Get returns a view by ID.

func (*Manager) GetAllSharedViews

func (v *Manager) GetAllSharedViews() ([]models.View, error)

GetAllSharedViews returns all shared views (for admin management).

func (*Manager) GetSharedViewsForUser

func (v *Manager) GetSharedViewsForUser(teamIDs []int) ([]models.View, error)

GetSharedViewsForUser returns shared views accessible to a user based on their team memberships.

func (*Manager) GetUsersViews

func (v *Manager) GetUsersViews(userID int) ([]models.View, error)

GetUsersViews returns all personal views (visibility='user') for a user.

func (*Manager) Update

func (v *Manager) Update(id int, name string, filter []byte, userID int) (models.View, error)

Update updates a personal view by id.

func (*Manager) UpdateSharedView

func (v *Manager) UpdateSharedView(id int, name string, filter []byte, visibility string, teamID *int) (models.View, error)

UpdateSharedView updates a shared view.

type Opts

type Opts struct {
	DB   *sqlx.DB
	Lo   *logf.Logger
	I18n *i18n.I18n
}

Opts contains options for initializing the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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