migration

package
v0.10.10 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXCHANGE_NOT_INFORMED    = "exchange not informed"
	ROUTING_KEY_NOT_INFORMED = "routing key not informed"
	DATA_NOT_INFORMED        = "data not informed"
)
View Source
const (
	DATABASE_GENERAL   = "general"
	DATABASE_FINANCE   = "finance"
	DATABASE_MESSAGING = "messaging"
)

Variables

This section is empty.

Functions

func CreateTableSQLite

func CreateTableSQLite(db *sql.DB) error

func GenerateTestData

func GenerateTestData(db *sql.DB) error

func GetDB

func GetDB() *sql.DB

func GetPool

func GetPool(db *sql.DB) *database.Pool

func SetupTest

func SetupTest(t *testing.T) (func(t *testing.T), *database.Pool)

Types

type Message

type Message struct {
	RabbitCacheID string `json:"id"`
	DE_Exchange   string `json:"exchange" validate:"required"`
	DE_RoutingKey string `json:"routingKey" validate:"required"`
	JS_Data       string `json:"data" validate:"required"`
	SN_Durable    int16  `json:"durable" validate:"required"`
	TS_Operacao   time.Time
}

func NewMessage

func NewMessage() *Message

func (*Message) GetData

func (m *Message) GetData() string

func (*Message) GetDurable

func (m *Message) GetDurable() int16

func (*Message) GetExchange

func (m *Message) GetExchange() string

func (*Message) GetID

func (m *Message) GetID() string

func (*Message) GetRoutingKey

func (m *Message) GetRoutingKey() string

func (*Message) IsValid

func (m *Message) IsValid() error

func (*Message) SetData

func (m *Message) SetData(data interface{})

func (*Message) SetDurable

func (m *Message) SetDurable(durable int16)

func (*Message) SetExchange

func (m *Message) SetExchange(exchange string)

func (*Message) SetID

func (m *Message) SetID(id string)

func (*Message) SetRoutingKey

func (m *Message) SetRoutingKey(routingKey string)

type MessageDB

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

func NewMessageDB

func NewMessageDB(db *sql.DB) *MessageDB

func (*MessageDB) Delete

func (p *MessageDB) Delete(id string) error

func (*MessageDB) Get

func (p *MessageDB) Get(id string) (*Message, error)

func (*MessageDB) GetNext

func (p *MessageDB) GetNext() (*Message, error)

func (*MessageDB) Save

func (p *MessageDB) Save(message *Message) error

type MessageService

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

func NewMessageService

func NewMessageService(persistence *MessageDB) *MessageService

func (*MessageService) Create

func (s *MessageService) Create(exchange string, routingKey string, data string, durable int16) (*Message, error)

func (*MessageService) Delete

func (s *MessageService) Delete(id string) error

func (*MessageService) Get

func (s *MessageService) Get(id string) (*Message, error)

func (*MessageService) GetNext

func (s *MessageService) GetNext() (*Message, error)

func (*MessageService) Send

func (s *MessageService) Send(exchange string, routingKey string, data string, durable int16) (*Message, error)

Jump to

Keyboard shortcuts

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