demo

package
v0.4.16 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DemoSubdomain = "demo"

DemoSubdomain returns the subdomain used for demo mode URLs.

Variables

This section is empty.

Functions

func TicketURL

func TicketURL(id int64) string

TicketURL returns a plausible ticket URL for demo mode.

Types

type SearchService

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

func NewSearchService

func NewSearchService(store *Store) *SearchService

func (*SearchService) Search

func (s *SearchService) Search(ctx context.Context, query string, opts *types.SearchOptions) (*types.SearchPage, error)

type Store

type Store struct {
	Tickets  map[int64]types.Ticket
	Comments map[int64][]types.Comment
	Audits   map[int64][]types.Audit
	Users    []types.User

	DemoRole string // "", "agent", "light_agent", "admin"
	// contains filtered or unexported fields
}

func NewStore

func NewStore() *Store

func (*Store) CollectAuditUsers added in v0.4.7

func (s *Store) CollectAuditUsers(audits []types.Audit) []types.User

func (*Store) CollectCommentUsers

func (s *Store) CollectCommentUsers(comments []types.Comment) []types.User

func (*Store) CollectUsers

func (s *Store) CollectUsers(tickets []types.Ticket) []types.User

func (*Store) UserByID

func (s *Store) UserByID(id int64) *types.User

type TicketService

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

func NewTicketService

func NewTicketService(store *Store) *TicketService

func (*TicketService) Create

func (*TicketService) Delete

func (s *TicketService) Delete(ctx context.Context, id int64) error

func (*TicketService) Get

func (*TicketService) List

func (*TicketService) ListAudits added in v0.4.7

func (s *TicketService) ListAudits(ctx context.Context, ticketID int64, opts *types.ListAuditsOptions) (*types.AuditPage, error)

func (*TicketService) ListComments

func (s *TicketService) ListComments(ctx context.Context, ticketID int64, opts *types.ListCommentsOptions) (*types.CommentPage, error)

func (*TicketService) Update

type UserService

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

func NewUserService

func NewUserService(store *Store) *UserService

func (*UserService) AutocompleteUsers added in v0.4.5

func (s *UserService) AutocompleteUsers(ctx context.Context, name string) ([]types.User, error)

func (*UserService) GetMe

func (s *UserService) GetMe(ctx context.Context) (*types.User, error)

Jump to

Keyboard shortcuts

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