messagerepo

package
v0.0.0-...-7b6d726 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	IsDebugMode bool
	Logger      Logger
	Host        string
	Port        string
	Password    string
	DBName      string
	User        string
	SSLMode     string
}

Configuration contains setting for connection to message's repository

type Logger

type Logger interface {
	Debug(msg ...interface{})
	Info(msg ...interface{})
	Warn(msg ...interface{})
	Error(msg ...interface{})
	Fatal(msg ...interface{})
}

Logger ...

type Repository

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

Repository represents message's repository

func NewMessageRepository

func NewMessageRepository(ctx context.Context, conf Configuration) (*Repository, error)

NewMessageRepository creates new instance of message's repository

func (*Repository) Close

func (r *Repository) Close(ctx context.Context) error

Close close connection to message's repository

func (*Repository) GetMessages

func (r *Repository) GetMessages(ctx context.Context, input models.GetMessagesInput) ([]*models.Message, error)

GetMessages returns message by given time range

func (*Repository) SaveMessage

func (r *Repository) SaveMessage(ctx context.Context, message *models.Message) error

SaveMessage save message in `messages` table

Jump to

Keyboard shortcuts

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