manticore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Index string
	// contains filtered or unexported fields
}

func New

func New(tbl string) (*Client, error)

func (*Client) FindAllByUrl

func (c *Client) FindAllByUrl(ctx context.Context, url string) (*[]answer.Entry, error)

func (*Client) Insert

func (c *Client) Insert(ctx context.Context, entry *answer.Entry) (*int64, error)

func (*Client) Update

func (c *Client) Update(ctx context.Context, entry *answer.Entry) error

type DBEntry

type DBEntry struct {
	Username   string `json:"username"`
	Text       string `json:"text"`
	Url        string `json:"url"`
	AvatarFile string `json:"avatar_file"`
	Role       string `json:"role"`
	Datetime   int64  `json:"datetime"`
	DataID     int64  `json:"data_id"`
	ParentID   int64  `json:"parent_id"`
	Type       int    `json:"type"`
	Position   int    `json:"position"`
}

type Response

type Response struct {
	Took     int  `json:"took"`
	TimedOut bool `json:"timed_out"`
	Hits     struct {
		Total         int    `json:"total"`
		TotalRelation string `json:"total_relation"`
		Hits          []struct {
			Id     int64 `json:"_id"`
			Score  int   `json:"_score"`
			Source struct {
				Username   string `json:"username"`
				Text       string `json:"text"`
				AvatarFile string `json:"avatar_file"`
				Url        string `json:"url"`
				Role       string `json:"role"`
				Datetime   int64  `json:"datetime"`
				DataID     int    `json:"data_id"`
				ParentID   int    `json:"parent_id"`
				Type       int    `json:"type"`
				Position   int    `json:"position"`
			} `json:"_source"`
		} `json:"hits"`
	} `json:"hits"`
}

Jump to

Keyboard shortcuts

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