db

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: AGPL-3.0, Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type GetCallJobOpts

type GetCallJobOpts struct {
	FromWriter   bool
	IncludeEnded bool
}

func (GetCallJobOpts) UseWriter

func (o GetCallJobOpts) UseWriter() bool

type GetCallOpts

type GetCallOpts struct {
	FromWriter bool
}

func (GetCallOpts) UseWriter

func (o GetCallOpts) UseWriter() bool

type GetCallSessionOpts

type GetCallSessionOpts struct {
	FromWriter bool
}

func (GetCallSessionOpts) UseWriter

func (o GetCallSessionOpts) UseWriter() bool

type GetCallsChannelOpts

type GetCallsChannelOpts struct {
	FromWriter bool
}

func (GetCallsChannelOpts) UseWriter

func (o GetCallsChannelOpts) UseWriter() bool

type Store

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

func NewStore

func NewStore(settings model.SqlSettings, rConnector driver.Connector, log mlog.LoggerIFace, metrics interfaces.StoreMetrics) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) CreateCall

func (s *Store) CreateCall(call *public.Call) error

func (*Store) CreateCallJob

func (s *Store) CreateCallJob(job *public.CallJob) error

func (*Store) CreateCallSession

func (s *Store) CreateCallSession(session *public.CallSession) error

func (*Store) CreateCallsChannel

func (s *Store) CreateCallsChannel(channel *public.CallsChannel) error

func (*Store) DeleteCall

func (s *Store) DeleteCall(callID string) error

func (*Store) DeleteCallByChannelID

func (s *Store) DeleteCallByChannelID(channelID string) error

func (*Store) DeleteCallSession

func (s *Store) DeleteCallSession(id string) error

func (*Store) DeleteCallsSessions

func (s *Store) DeleteCallsSessions(callID string) error

func (*Store) GetActiveCallByChannelID

func (s *Store) GetActiveCallByChannelID(channelID string, opts GetCallOpts) (*public.Call, error)

func (*Store) GetActiveCallJobs

func (s *Store) GetActiveCallJobs(callID string, opts GetCallJobOpts) (map[public.JobType]*public.CallJob, error)

func (*Store) GetAllActiveCalls

func (s *Store) GetAllActiveCalls(opts GetCallOpts) ([]*public.Call, error)

func (*Store) GetAllCallsChannels

func (s *Store) GetAllCallsChannels(opts GetCallsChannelOpts) ([]*public.CallsChannel, error)

func (*Store) GetAvgCallDuration added in v0.28.0

func (s *Store) GetAvgCallDuration() (int64, error)

func (*Store) GetAvgCallParticipants added in v0.28.0

func (s *Store) GetAvgCallParticipants() (int64, error)

func (*Store) GetCall

func (s *Store) GetCall(callID string, opts GetCallOpts) (*public.Call, error)

func (*Store) GetCallActive added in v0.28.0

func (s *Store) GetCallActive(channelID string, opts GetCallOpts) (bool, error)

func (*Store) GetCallJob

func (s *Store) GetCallJob(id string, opts GetCallJobOpts) (*public.CallJob, error)

func (*Store) GetCallSession

func (s *Store) GetCallSession(id string, opts GetCallSessionOpts) (*public.CallSession, error)

func (*Store) GetCallSessions

func (s *Store) GetCallSessions(callID string, opts GetCallSessionOpts) (map[string]*public.CallSession, error)

func (*Store) GetCallSessionsCount added in v0.28.0

func (s *Store) GetCallSessionsCount(callID string, opts GetCallSessionOpts) (int, error)

func (*Store) GetCallsByChannelType added in v0.28.0

func (s *Store) GetCallsByChannelType() (map[string]int64, error)

func (*Store) GetCallsByDay added in v0.28.0

func (s *Store) GetCallsByDay() (map[string]int64, error)

func (*Store) GetCallsByMonth added in v0.28.0

func (s *Store) GetCallsByMonth() (map[string]int64, error)

func (*Store) GetCallsChannel

func (s *Store) GetCallsChannel(channelID string, opts GetCallsChannelOpts) (*public.CallsChannel, error)

func (*Store) GetCallsStats added in v0.28.0

func (s *Store) GetCallsStats() (*public.CallsStats, error)

func (*Store) GetPost

func (s *Store) GetPost(postID string) (*model.Post, error)

GetPost is an alternative to p.API.GetPost() that fetches from the writer DB node. This should only be used internally to get calls posts as it doesn't take care of more advanced logic needed by clients like populating reply counts.

func (*Store) GetRTCDHostForCall

func (s *Store) GetRTCDHostForCall(callID string, opts GetCallOpts) (string, error)

func (*Store) GetRecordingJobsByDay added in v1.0.0

func (s *Store) GetRecordingJobsByDay() (map[string]int64, error)

func (*Store) GetRecordingJobsByMonth added in v1.0.0

func (s *Store) GetRecordingJobsByMonth() (map[string]int64, error)

func (*Store) GetTotalActiveSessions added in v0.28.0

func (s *Store) GetTotalActiveSessions() (int64, error)

func (*Store) GetTotalCalls added in v0.28.0

func (s *Store) GetTotalCalls(active bool) (int64, error)

func (*Store) IsUserInCall added in v0.29.0

func (s *Store) IsUserInCall(userID, callID string, opts GetCallSessionOpts) (bool, error)

func (*Store) KVGet

func (s *Store) KVGet(pluginID, key string, fromWriter bool) ([]byte, error)

func (*Store) Migrate

func (s *Store) Migrate(direction models.Direction, dryRun bool) error

func (*Store) UpdateCall

func (s *Store) UpdateCall(call *public.Call) error

func (*Store) UpdateCallJob

func (s *Store) UpdateCallJob(job *public.CallJob) error

func (*Store) UpdateCallSession

func (s *Store) UpdateCallSession(session *public.CallSession) error

func (*Store) UpdateCallsChannel

func (s *Store) UpdateCallsChannel(channel *public.CallsChannel) error

func (*Store) UpdateFileInfoPostID

func (s *Store) UpdateFileInfoPostID(fileID, channelID, postID string) error

func (*Store) WriterDB

func (s *Store) WriterDB() *sql.DB

Jump to

Keyboard shortcuts

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