postgres

package
v0.0.0-...-7669f62 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DialogTable       = "dialog_table"
	MessageTable      = "message_table"
	ParticipantsTable = "participant_table"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Storage

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

func NewStorage

func NewStorage(logger *zap.Logger, config xstorage.StorageConfig, salt string) (*Storage, error)

func (*Storage) AddParticipants

func (s *Storage) AddParticipants(ctx context.Context, dialogID model.DialogID, participants []*model.Participant) error

func (*Storage) Close

func (s *Storage) Close() error

func (*Storage) CreateDialog

func (s *Storage) CreateDialog(ctx context.Context, id model.DialogID) error

func (*Storage) CreateMessage

func (s *Storage) CreateMessage(ctx context.Context, params *model.Message) (*model.Message, error)

func (*Storage) DeleteDialog

func (s *Storage) DeleteDialog(ctx context.Context, dialogID model.DialogID) error

func (*Storage) DeleteMessage

func (s *Storage) DeleteMessage(ctx context.Context, dialogID model.DialogID, messageID model.MessageID) error

func (*Storage) DeleteParticipants

func (s *Storage) DeleteParticipants(ctx context.Context, dialogID model.DialogID, participants []*model.Participant) error

func (*Storage) Dialog

func (s *Storage) Dialog() storage.DialogRepository

func (*Storage) GetDialogMessages

func (s *Storage) GetDialogMessages(ctx context.Context, dialogID model.DialogID) ([]*model.Message, error)

func (*Storage) GetDialogParticipants

func (s *Storage) GetDialogParticipants(ctx context.Context, dialogID model.DialogID) ([]*model.Participant, error)

func (*Storage) Hosts

func (s *Storage) Hosts() []string

func (*Storage) Master

func (s *Storage) Master() sqlx.ExtContext

func (*Storage) Salt

func (s *Storage) Salt() string

func (*Storage) Slave

func (s *Storage) Slave() sqlx.ExtContext

Jump to

Keyboard shortcuts

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