dps

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ContentTypeWarc        = "warc"
	ContentTypeAcquisition = "acquisition"
)

Variables

This section is empty.

Functions

func CreateUuid

func CreateUuid() ([]byte, error)

func IsWebArchiveMessage

func IsWebArchiveMessage(message *Message) bool

func IsWebArchiveOwned

func IsWebArchiveOwned(message *Message) bool

func ReadLatestMessages

func ReadLatestMessages(ctx context.Context, kafkaEndpoints []string, kafkaTopic string, fn func(*Message) error) error

func Send

func Send(ctx context.Context, w *kafka.Writer, msg Message) error

Types

type Check

type Check struct {
	Status  string
	Message string
	Reason  string
	File    string
}

type KafkaMessage added in v0.2.1

type KafkaMessage struct {
	Offset int64
	Key    string
	Value  Message
}

func NextMessage

func NextMessage(ctx context.Context, reader *kafka.Reader, filter func(*Message) bool) (*KafkaMessage, error)

type Message added in v0.2.1

type Message struct {
	Date            string  `json:"date"`
	Identifier      string  `json:"identifier"`
	Urn             string  `json:"urn"`
	Path            string  `json:"path"`
	ContentType     string  `json:"contentType"`
	ContentCategory string  `json:"contentCategory"`
	Checks          []Check `json:"checks,omitempty"`
}

func CreateMessage added in v0.2.1

func CreateMessage(path string, payloadDirName string, contentType string) Message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳