store

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	RespondentID string
	QuestionID   string
	QuestionText string
	QuestionNum  int
	Answer       string
	IsOther      bool
}

Answer is a single answer to a question

type HistoryLine

type HistoryLine struct {
	RespondentID string
	QuestionID   string
	FileName     string
	ShellType    shell.Type
	LineNum      int
	Command      string
	Subcommand   string
	Options      []string
	NumTokens    int

	// Length is the number of characters in the command.
	Length int

	// Sha1 is a hash of the entire c ommand
	Sha1 string

	// CommandTimestamp is the time the command was issued or nil
	// if that is not available.
	CommandTimestamp time.Time
}

HistoryLine is a single command in a history file

type Response

type Response struct {
	// RespondentID is a uuid for a survey respondent
	RespondentID string

	QuestionID string

	// QuestionNum is the question number in the survey
	QuestionNum int

	// Answers is all of the answers to question.  Typically this is
	// a single value but for multi-select answers it may be multiple.
	Answers []Answer

	// HistoryLines is any history file lines associated with the answer
	HistoryLines []HistoryLine
}

Response is an answer to a single question

type Storer

type Storer interface {
	Write(response Response)
}

Storer is an interface for recording responses

func NewWebStore

func NewWebStore(serverRoot string) Storer

NewWebStore makes a webstore pointing at the given serverRoot

Jump to

Keyboard shortcuts

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