long

package
v0.0.0-...-92a07c5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Longs

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

func NewLongService

func NewLongService(longsDB LongsDB) *Longs

NewLongService returns a longService object to implement methods to interact with the database.

func (*Longs) Delete

func (l *Longs) Delete(input []string) (serializer.Serializer, error)

Delete takes an input of a slice of ids of string type to send to database for a bulk row delete query matching the article id.

func (*Longs) Get

func (l *Longs) Get(topic string) (serializer.Serializer, error)

Get retrieves a slice of Long for a given topic to be sent to the client.

func (*Longs) GetTopics

func (l *Longs) GetTopics() (serializer.Serializer, error)

GetTopics retrieves the full list of topics stored on the database.

func (*Longs) Store

func (l *Longs) Store(input string) (serializer.Serializer, error)

Store parses input from the client to be sent to the database.

func (*Longs) Update

func (l *Longs) Update(data *core.Long) (serializer.Serializer, error)

Update calls an update to a row in the long articles table in database, given an article id.

type LongsDB

type LongsDB interface {
	GetTopics() (*core.LongTopics, error)
	Get(topic string) (*core.LongSeries, error)
	Store(data *core.LongPayload) error
	Update(data *core.Long) error
	Delete(ids string) error
}

Jump to

Keyboard shortcuts

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