database

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const ES_ACGER_PAIR = "acger_pair"

Variables

View Source
var AcgerPairBody = `` /* 1320-byte string literal not displayed */

Functions

func GetCacheElement added in v1.0.3

func GetCacheElement(uid uint64, client *redis.Redis) *pair.EleSaveReq

func InitIndex added in v1.0.3

func InitIndex(client *es.Client, index string, body string)

func NewElasticsearch added in v1.0.3

func NewElasticsearch(conf *config.Config) *es.Client

func NewMysql

func NewMysql(c *config.Config) *gorm.DB

Types

type EsSearchPairResult added in v1.0.3

type EsSearchPairResult struct {
	Took     int    `json:"took"`
	TimedOut bool   `json:"timed_out"`
	Shards   Shards `json:"_shards"`
	Hits     Hit    `json:"hits"`
}

type Highlight added in v1.0.3

type Highlight struct {
	Skill     []string `json:"skill"`
	SkillNeed []string `json:"skill_need"`
}

type Hit added in v1.0.3

type Hit struct {
	Total    Total   `json:"total"`
	MaxScore float64 `json:"max_score"`
	Hits     []Hits  `json:"hits"`
}

type Hits added in v1.0.3

type Hits struct {
	Index     string    `json:"_index"`
	Type      string    `json:"_type"`
	ID        string    `json:"_id"`
	Score     float64   `json:"_score"`
	Source    Source    `json:"_source"`
	Highlight Highlight `json:"highlight"`
}

type Shards added in v1.0.3

type Shards struct {
	Total      int `json:"total"`
	Successful int `json:"successful"`
	Skipped    int `json:"skipped"`
	Failed     int `json:"failed"`
}

type Source added in v1.0.3

type Source struct {
	Skill     string      `json:"skill"`
	SkillNeed string      `json:"skill_need"`
	UID       int         `json:"uid"`
	Boost     int         `json:"boost"`
	Star      int         `json:"star"`
	CreatedAt time.Time   `json:"created_at"`
	UpdatedAt time.Time   `json:"updated_at"`
	DeletedAt interface{} `json:"deleted_at"`
}

type Total added in v1.0.3

type Total struct {
	Value    int    `json:"value"`
	Relation string `json:"relation"`
}

Jump to

Keyboard shortcuts

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