data

package
v0.0.0-...-7dfca68 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RTGitHubCSV = "rtgithub.csv"

RTGitHubCSV returns the filename for the mapping of tickets from RT to GitHub

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentMeta

type AttachmentMeta struct {
	TicketID string
	// We could recompute the Offsets from the Ticket but storing them
	// saves a little time.
	TransactionOffset int
	AttachmentOffset  int
}

type Data

type Data struct {
	Index  bleve.Index
	Merged map[string]string
	// contains filtered or unexported fields
}

TODO: fixme data.Data stutters

func New

func New(dataPath string, indexPath string) (*Data, error)

func (*Data) Close

func (d *Data) Close()

func (*Data) GetAttachment

func (d *Data) GetAttachment(id string) (string, string, []byte, error)

GetAttachment returns the filename, content-type, and bytes of an attachment.

func (*Data) GetTicket

func (d *Data) GetTicket(id string) (interface{}, error)

func (*Data) LoadIndex

func (d *Data) LoadIndex(fh io.Reader) error

LoadIndex loads an index.json file.

func (*Data) LoadMerged

func (d *Data) LoadMerged(fh io.Reader) error

func (*Data) LoadRTGitHubMap

func (d *Data) LoadRTGitHubMap(fh io.Reader) error

LoadRTGitHubMap loads the mapping of old ids to the new ones.

func (*Data) RTGitHubCSV

func (d *Data) RTGitHubCSV() (io.ReadCloser, error)

RTGitHubCSV returns a io.ReadCloser pointing to the rtgithub.csv file

type IndexTicket

type IndexTicket struct {
	ID           string `json:"Id"`
	Status       string
	Subject      string
	Transactions []struct {
		ID          string `json:"Id"`
		Attachments []struct {
			ID string `json:"Id"`
		}
	}
}

type TicketSource

type TicketSource interface {
	GetTicket(id string) (interface{}, error)
	GetJSON(id string) (io.ReadCloser, error)
	GetFile(id string) (io.ReadCloser, error)
}

TicketSource describes the interface of the ticket reader classes we use.

Jump to

Keyboard shortcuts

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