service

package
v0.1.0-alpha.15 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseXls

func ParseXls(file *excelize.File, opt XLSXOptions) []model.Question

ParseXls 解析xlsx文件

func SyncElasticsearch

func SyncElasticsearch()

SyncElasticsearch 同步Elasticsearch

Types

type Elasticsearch

type Elasticsearch interface {
	// Search 搜索
	Search(index string, query string, from int, size int) (interface{}, error)
	// Create 创建
	Create(index string, id string, data interface{}) error
	// Update 更新
	Update(index string, id string, data interface{}) error
	// Delete 删除
	Delete(index string, id string) error
}

Elasticsearch Elasticsearch接口

func NewElasticsearchClient

func NewElasticsearchClient(add []string) (Elasticsearch, error)

NewElasticsearchClient 创建Elasticsearch客户端

type XLSXOptions

type XLSXOptions struct {
	SheetName string   `json:"sheet"`
	Question  string   `json:"q"`
	Answer    string   `json:"a"`
	Option    []string `json:"o"`
}

XLSXOptions xlsx选项

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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