archiver

package
v2.2.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewArchiver

func NewArchiver(logger log.Logger) archiversvc.Service

NewArchiver returns the archiver service implementation.

func NewHealth

func NewHealth(logger log.Logger) health.Service

NewHealth returns the health service implementation.

Types

type Archive

type Archive struct {
	*sync.RWMutex
	// contains filtered or unexported fields
}

Archive is the archived documents in-memory "DB"

func (*Archive) Read

func (a *Archive) Read(id int) *Document

Read retrieves an archived document by ID. It returns nil if there isn't one.

func (*Archive) Store

func (a *Archive) Store(doc *Document)

Store adds an archived document to the archive. Store takes care of initializing the document ID.

type Document

type Document struct {
	// Unique ID
	ID int
	// Status is the archived response HTTP status
	Status int
	// Body is the archive response HTTP body
	Body string
}

Document represents a single archive document.

Jump to

Keyboard shortcuts

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