Documentation ¶
Index ¶
- Constants
- Variables
- func NewConfig() *config.Config
- func NewFullText(analyzer string, enabled bool) fullText
- func SchemaToDSL(schemas []RepoSchemaEntry, indent string) (dsl string)
- type CreateRepoDSLInput
- type CreateRepoInput
- type DeleteRepoInput
- type GetRepoConfigInput
- type GetRepoConfigOutput
- type GetRepoInput
- type GetRepoOutput
- type Highlight
- type ListReposInput
- type ListReposOutput
- type Log
- type LogHistogramDesc
- type Logdb
- func (c *Logdb) CreateRepo(input *CreateRepoInput) (err error)
- func (c *Logdb) CreateRepoFromDSL(input *CreateRepoDSLInput) (err error)
- func (c *Logdb) DeleteRepo(input *DeleteRepoInput) (err error)
- func (c *Logdb) GetRepo(input *GetRepoInput) (output *GetRepoOutput, err error)
- func (c *Logdb) GetRepoConfig(input *GetRepoConfigInput) (output *GetRepoConfigOutput, err error)
- func (c *Logdb) GetSampleDataSchema(input *SchemaRefInput) (output *SchemaRefOut, err error)
- func (c *Logdb) ListRepos(input *ListReposInput) (output *ListReposOutput, err error)
- func (c *Logdb) MakeToken(desc *base.TokenDesc) (string, error)
- func (c *Logdb) NewOperation(opName string, args ...interface{}) *request.Operation
- func (c *Logdb) PartialQuery(input *PartialQueryInput) (output *PartialQueryOutput, err error)
- func (c *Logdb) PutRepoConfig(input *PutRepoConfigInput) (err error)
- func (c *Logdb) QueryAnalysisLog(jobId string) (output *QueryAnalysisLogOutput, err error)
- func (c *Logdb) QueryAnalysisLogJob(input *QueryAnalysisLogInput) (jobId string, err error)
- func (c *Logdb) QueryHistogramLog(input *QueryHistogramLogInput) (output *QueryHistogramLogOutput, err error)
- func (c *Logdb) QueryLog(input *QueryLogInput) (output *QueryLogOutput, err error)
- func (c *Logdb) QueryScroll(input *QueryScrollInput) (output *QueryLogOutput, err error)
- func (c *Logdb) QuerySearchLog(jobId string) (output *QuerySearchLogOutput, err error)
- func (c *Logdb) QuerySearchLogJob(input *QuerySearchLogInput) (jobId string, err error)
- func (c *Logdb) SendLog(input *SendLogInput) (output *SendLogOutput, err error)
- func (c *Logdb) UpdateRepo(input *UpdateRepoInput) (err error)
- type LogdbAPI
- type LogdbErrBuilder
- type Logs
- type PartialQueryInput
- type PartialQueryOutput
- type PutRepoConfigInput
- type QueryAnalysisLogHit
- type QueryAnalysisLogInput
- type QueryAnalysisLogOutput
- type QueryHistogramLogInput
- type QueryHistogramLogOutput
- type QueryLogInput
- type QueryLogOutput
- type QueryScrollInput
- type QuerySearchLogHit
- type QuerySearchLogInput
- type QuerySearchLogOutput
- type RepoDesc
- type RepoSchemaEntry
- type SchemaRefInput
- type SchemaRefOut
- type SendLogInput
- type SendLogOutput
- type UpdateRepoInput
Constants ¶
View Source
const ( StandardAnalyzer = "standard" SimpleAnalyzer = "simple" WhitespaceAnalyzer = "whitespace" StopAnalyzer = "stop" AnsjAnalyzer = "index_ansj" DicAnajAnalyzer = "dic_ansj" SearchAnsjAnalyzer = "search_ansj" ToAnsjAnalyzer = "to_ansj" UserAnsjAnalyzer = "user_ansj" KeyWordAnalyzer = "keyword" PathAnalyzer = "path" )
View Source
const ( TypeString = "string" TypeLong = "long" TypeFloat = "float" TypeBoolean = "boolean" TypeDate = "date" TypeGeoPoint = "geo_point" TypeIP = "ip" TypeObject = "object" )
View Source
const ( PartialQuerySearchTypeA int = iota //混合模式 PartialQuerySearchTypeQ //searching模式 PartialQuerySearchTypeH //直方图模式 )
Variables ¶
View Source
var Analyzers = map[string]bool{ StandardAnalyzer: true, SimpleAnalyzer: true, WhitespaceAnalyzer: true, StopAnalyzer: true, AnsjAnalyzer: true, DicAnajAnalyzer: true, SearchAnsjAnalyzer: true, ToAnsjAnalyzer: true, UserAnsjAnalyzer: true, KeyWordAnalyzer: true, PathAnalyzer: true, }
Functions ¶
func NewFullText ¶
func SchemaToDSL ¶
func SchemaToDSL(schemas []RepoSchemaEntry, indent string) (dsl string)
SchemaToDSL 会把schema信息转换为格式化的dsl字符串,其中indent是格式化的占位符,一般是"\t"或者2个空格。
Types ¶
type CreateRepoDSLInput ¶
type CreateRepoInput ¶
type CreateRepoInput struct { PandoraToken RepoName string Region string `json:"region"` Retention string `json:"retention"` Schema []RepoSchemaEntry `json:"schema"` PrimaryField string `json:"primaryField"` FullText fullText `json:"fullText"` }
func (*CreateRepoInput) Validate ¶
func (r *CreateRepoInput) Validate() (err error)
type DeleteRepoInput ¶
type DeleteRepoInput struct { PandoraToken RepoName string }
type GetRepoConfigInput ¶
type GetRepoConfigInput struct { PandoraToken RepoName string }
type GetRepoConfigOutput ¶
type GetRepoConfigOutput struct {
TimeFieldName string `json:"timeFieldName"`
}
type GetRepoInput ¶
type GetRepoInput struct { PandoraToken RepoName string }
type GetRepoOutput ¶
type Highlight ¶
type ListReposInput ¶
type ListReposInput struct {
PandoraToken
}
type ListReposOutput ¶
type ListReposOutput struct {
Repos []RepoDesc `json:"repos"`
}
type LogHistogramDesc ¶
type Logdb ¶
func (*Logdb) CreateRepo ¶
func (c *Logdb) CreateRepo(input *CreateRepoInput) (err error)
func (*Logdb) CreateRepoFromDSL ¶
func (c *Logdb) CreateRepoFromDSL(input *CreateRepoDSLInput) (err error)
func (*Logdb) DeleteRepo ¶
func (c *Logdb) DeleteRepo(input *DeleteRepoInput) (err error)
func (*Logdb) GetRepo ¶
func (c *Logdb) GetRepo(input *GetRepoInput) (output *GetRepoOutput, err error)
func (*Logdb) GetRepoConfig ¶
func (c *Logdb) GetRepoConfig(input *GetRepoConfigInput) (output *GetRepoConfigOutput, err error)
func (*Logdb) GetSampleDataSchema ¶
func (c *Logdb) GetSampleDataSchema(input *SchemaRefInput) (output *SchemaRefOut, err error)
输入JSON样例数据,输出对应的LOGDB Schema
func (*Logdb) ListRepos ¶
func (c *Logdb) ListRepos(input *ListReposInput) (output *ListReposOutput, err error)
func (*Logdb) NewOperation ¶
func (*Logdb) PartialQuery ¶
func (c *Logdb) PartialQuery(input *PartialQueryInput) (output *PartialQueryOutput, err error)
func (*Logdb) PutRepoConfig ¶
func (c *Logdb) PutRepoConfig(input *PutRepoConfigInput) (err error)
func (*Logdb) QueryAnalysisLog ¶
func (c *Logdb) QueryAnalysisLog(jobId string) (output *QueryAnalysisLogOutput, err error)
func (*Logdb) QueryAnalysisLogJob ¶
func (c *Logdb) QueryAnalysisLogJob(input *QueryAnalysisLogInput) (jobId string, err error)
func (*Logdb) QueryHistogramLog ¶
func (c *Logdb) QueryHistogramLog(input *QueryHistogramLogInput) (output *QueryHistogramLogOutput, err error)
func (*Logdb) QueryLog ¶
func (c *Logdb) QueryLog(input *QueryLogInput) (output *QueryLogOutput, err error)
func (*Logdb) QueryScroll ¶
func (c *Logdb) QueryScroll(input *QueryScrollInput) (output *QueryLogOutput, err error)
func (*Logdb) QuerySearchLog ¶
func (c *Logdb) QuerySearchLog(jobId string) (output *QuerySearchLogOutput, err error)
func (*Logdb) QuerySearchLogJob ¶
func (c *Logdb) QuerySearchLogJob(input *QuerySearchLogInput) (jobId string, err error)
func (*Logdb) SendLog ¶
func (c *Logdb) SendLog(input *SendLogInput) (output *SendLogOutput, err error)
func (*Logdb) UpdateRepo ¶
func (c *Logdb) UpdateRepo(input *UpdateRepoInput) (err error)
type LogdbAPI ¶
type LogdbAPI interface { CreateRepo(*CreateRepoInput) error GetRepo(*GetRepoInput) (*GetRepoOutput, error) ListRepos(*ListReposInput) (*ListReposOutput, error) DeleteRepo(*DeleteRepoInput) error UpdateRepo(*UpdateRepoInput) error SendLog(*SendLogInput) (*SendLogOutput, error) QueryLog(*QueryLogInput) (*QueryLogOutput, error) QuerySearchLogJob(*QuerySearchLogInput) (string, error) QuerySearchLog(string) (*QuerySearchLogOutput, error) QueryAnalysisLogJob(*QueryAnalysisLogInput) (string, error) QueryAnalysisLog(string) (*QueryAnalysisLogOutput, error) QueryScroll(*QueryScrollInput) (*QueryLogOutput, error) QueryHistogramLog(*QueryHistogramLogInput) (*QueryHistogramLogOutput, error) PutRepoConfig(*PutRepoConfigInput) error GetRepoConfig(*GetRepoConfigInput) (*GetRepoConfigOutput, error) MakeToken(*base.TokenDesc) (string, error) PartialQuery(input *PartialQueryInput) (output *PartialQueryOutput, err error) GetSampleDataSchema(input *SchemaRefInput) (output *SchemaRefOut, err error) }
type LogdbErrBuilder ¶
type LogdbErrBuilder struct{}
type PartialQueryInput ¶
type PartialQueryInput struct { PandoraToken RepoName string `json:"-"` StartTime int64 `json:"startTime"` EndTime int64 `json:"endTime"` Highlight struct { PostTag string `json:"post_tag"` PreTag string `json:"pre_tag"` } `json:"highlight"` QueryString string `json:"query_string"` SearchType int `json:"searchType"` Size int `json:"size"` Sort string `json:"sort"` }
func (*PartialQueryInput) Buf ¶
func (partialQueryInput *PartialQueryInput) Buf() (buf []byte, err error)
type PartialQueryOutput ¶
type PutRepoConfigInput ¶
type PutRepoConfigInput struct { PandoraToken RepoName string TimeFieldName string `json:"timeFieldName"` }
func (*PutRepoConfigInput) Validate ¶
func (r *PutRepoConfigInput) Validate() (err error)
type QueryAnalysisLogHit ¶
type QueryAnalysisLogInput ¶
type QueryAnalysisLogInput struct { PandoraToken Start time.Time End time.Time RepoName string Query string Sort string From int Size int Scroll string Fields string }
func (*QueryAnalysisLogInput) Buf ¶
func (input *QueryAnalysisLogInput) Buf() (buf []byte, err error)
type QueryAnalysisLogOutput ¶
type QueryAnalysisLogOutput struct { Took int `json:"took,omitempty"` Process float32 `json:"process,omitempty"` Total int `json:"total"` PartialSuccess bool `json:"partialSuccess"` Hits []QueryAnalysisLogHit `json:"hits"` }
type QueryHistogramLogInput ¶
type QueryHistogramLogOutput ¶
type QueryHistogramLogOutput struct { Total int `json:"total"` PartialSuccess bool `json:"partialSuccess"` Buckets []LogHistogramDesc `json:"buckets"` }
type QueryLogInput ¶
type QueryLogOutput ¶
type QueryScrollInput ¶
type QueryScrollInput struct { PandoraToken RepoName string `json:"-"` ScrollId string `json:"scroll_id"` Scroll string `json:"scroll"` }
func (*QueryScrollInput) Buf ¶
func (input *QueryScrollInput) Buf() (buf []byte, err error)
type QuerySearchLogHit ¶
type QuerySearchLogInput ¶
type QuerySearchLogInput struct { PandoraToken Start time.Time End time.Time RepoName string Query string Sort string }
func (*QuerySearchLogInput) Buf ¶
func (input *QuerySearchLogInput) Buf() (buf []byte, err error)
type QuerySearchLogOutput ¶
type QuerySearchLogOutput struct { Took int `json:"took,omitempty"` Process float32 `json:"process,omitempty"` Total int `json:"total"` PartialSuccess bool `json:"partial_success"` Hits []QuerySearchLogHit `json:"hits"` }
type RepoSchemaEntry ¶
type RepoSchemaEntry struct { Key string `json:"key"` ValueType string `json:"valtype"` Analyzer string `json:"analyzer,omitempty"` //替代SearchWay Primary bool `json:"primary,omitempty"` //默认值是false Schemas []RepoSchemaEntry `json:"nested,omitempty"` Options map[string]interface{} `json:"options,omitempty"` // 对于一些特殊的类型,比如IP或者geo_point会有一些特殊的属性。 }
func DSLtoSchema ¶
func DSLtoSchema(dsl string) (schemas []RepoSchemaEntry, err error)
DSLtoSchema 是将DSL字符串转化为schema
func (RepoSchemaEntry) String ¶
func (e RepoSchemaEntry) String() string
func (*RepoSchemaEntry) Validate ¶
func (e *RepoSchemaEntry) Validate() (err error)
type SchemaRefInput ¶
type SchemaRefInput struct { PandoraToken SampleData map[string]interface{} `json:"sample_data"` }
func (SchemaRefInput) Buf ¶
func (srf SchemaRefInput) Buf() (buf []byte, err error)
type SchemaRefOut ¶
type SchemaRefOut []RepoSchemaEntry
type SendLogInput ¶
type SendLogOutput ¶
type UpdateRepoInput ¶
type UpdateRepoInput struct { PandoraToken RepoName string Retention string `json:"retention"` Schema []RepoSchemaEntry `json:"schema"` }
func (*UpdateRepoInput) Validate ¶
func (r *UpdateRepoInput) Validate() (err error)
Click to show internal directories.
Click to hide internal directories.