models

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2020 License: MIT Imports: 3 Imported by: 5

Documentation

Index

Constants

View Source
const (
	AuditTaskGetSearch   = "getSearch"
	AuditTaskCreateIndex = "createSearchIndex"
	AuditTaskDeleteIndex = "deleteSearchIndex"

	AuditActionAttempted    = "attempted"
	AuditActionSuccessful   = "successful"
	AuditActionUnsuccessful = "unsuccessful"

	AuditActionAttemptedErr    = "failed to audit action attempted event, returning internal server error"
	AuditActionUnsuccessfulErr = "failed to audit action unsuccessful event"
	AuditActionSuccessfulErr   = "failed to audit action successful event"

	Scenario_attemptOnly       = "mock audit a user attempted an action"
	Scenario_attemptAndSucceed = "mock audit a user attempted an action that will be successful"
	Scenario_attemptAndFail    = "mock audit a user attempted an action that will be unsuccessful"
)

Variables

This section is empty.

Functions

func ErrorMaximumOffsetReached added in v1.8.0

func ErrorMaximumOffsetReached(m int) error

Types

type Highlight added in v1.8.0

type Highlight struct {
	Code  []string `json:"code,omitempty"`
	Label []string `json:"label,omitempty"`
}

type HitList added in v1.8.0

type HitList struct {
	Highlight Highlight    `json:"highlight"`
	Score     float64      `json:"_score"`
	Source    SearchResult `json:"_source"`
}

type Hits added in v1.8.0

type Hits struct {
	Total   int       `json:"total"`
	HitList []HitList `json:"hits"`
}

type Matches added in v1.8.0

type Matches struct {
	Code  []Snippet `json:"code,omitempty"`
	Label []Snippet `json:"label,omitempty"`
}

Matches represents a list of members and their arrays of character offsets that matched the search term

type PageVariables added in v1.8.0

type PageVariables struct {
	DefaultMaxResults int
	Limit             int
	Offset            int
}

PageVariables are the necessary fields to determine paging

func (*PageVariables) ValidateQueryParameters added in v1.8.0

func (page *PageVariables) ValidateQueryParameters(term string) error

ValidateQueryParameters represents a model for validating query parameters

type SearchResponse

type SearchResponse struct {
	Hits Hits `json:"hits"`
}

type SearchResult added in v1.8.0

type SearchResult struct {
	Code               string  `json:"code"`
	URL                string  `json:"url,omitempty"`
	DimensionOptionURL string  `json:"dimension_option_url,omitempty"`
	HasData            bool    `json:"has_data"`
	Label              string  `json:"label"`
	Matches            Matches `json:"matches,omitempty"`
	NumberOfChildren   int     `json:"number_of_children"`
}

SearchResult represents data on a single item of search results

type SearchResults added in v1.8.0

type SearchResults struct {
	Count  int            `json:"count"`
	Items  []SearchResult `json:"items"`
	Limit  int            `json:"limit"`
	Offset int            `json:"offset"`
}

SearchResults represents a structure for a list of returned objects

type Snippet added in v1.8.0

type Snippet struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

Snippet represents a pair of integers defining the start and end of a substring in the member that matched the search term

Jump to

Keyboard shortcuts

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