trackmsg

package
v0.0.0-...-57b3f38 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package trackmsg provides a core business API to do a tracking message.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

Core manages the set of APIs for track message.

func NewCore

func NewCore(logger *slog.Logger, db *sqlx.DB) *Core

NewCore constructs the track message acces API.

func (*Core) Create

func (c *Core) Create(ctx context.Context, tmID, dataType string, statusCode int) error

Create creates a track message to a DB.

func (*Core) RetrieveByMsgID

func (c *Core) RetrieveByMsgID(ctx context.Context, tmID string) (TrackMsg, error)

RetrieveByMsgID retrives a track message from a DB.

func (*Core) Update

func (c *Core) Update(ctx context.Context, tmID string, statusCode int) (TrackMsg, error)

Update updates a track message into a DB.

type TrackMsg

type TrackMsg struct {
	ID          string    `json:"message_id"`
	DataType    string    `json:"data_type"`
	StatusCode  int       `json:"status_code"`
	DateCreated time.Time `json:"date_created"`
	DateUpdated time.Time `json:"date_updated"`
}

A TrackMsg contains the data needed to track a message.

Directories

Path Synopsis
Package trackmsgdb contains tracking message related CRUD functionality.
Package trackmsgdb contains tracking message related CRUD functionality.

Jump to

Keyboard shortcuts

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