yearning

package module
v0.0.0-...-e2b3cba Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: MIT Imports: 8 Imported by: 0

README

Yearning Golang SDK

Coverage

Query
  • Refer
  • Status
  • Fetch Databases
  • SQL Results
Fetch
  • IDC List
  • Sources
  • Databases
  • Tables
Login
  • Normal Login
  • LDAP Login

Documentation

Index

Constants

View Source
const Unauthorized = Error("Unauthorized")

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error string

func (Error) Error

func (e Error) Error() string

func (Error) YearningError

func (Error) YearningError()

type FetchBaseChildChild

type FetchBaseChildChild struct {
}

type FetchBaseHighlight

type FetchBaseHighlight struct {
	Meta string `json:"meta"`
	Vl   string `json:"vl"`
}

type FetchBaseInfo

type FetchBaseInfo struct {
	Children []FetchBaseInfoChild `json:"children"`
	Expand   string               `json:"expand"`
	Title    string               `json:"title"`
}

type FetchBaseInfoChild

type FetchBaseInfoChild struct {
	Children []FetchBaseChildChild `json:"children"`
	Title    string                `json:"title"`
}

type FetchBasePayload

type FetchBasePayload struct {
	Highlight []FetchBaseHighlight `json:"highlight"`
	Idc       string               `json:"idc"`
	Info      []FetchBaseInfo      `json:"info"`
	Sign      interface{}          `json:"sign"`
	Status    int64                `json:"status"`
}

type FetchDataBaseResult

type FetchDataBaseResult struct {
	Payload FetchDatabasePayload `json:"payload"`
	Code    int64                `json:"code"`
	Text    string               `json:"text"`
}

type FetchDatabaseHighlight

type FetchDatabaseHighlight struct {
	Meta string `json:"meta"`
	Vl   string `json:"vl"`
}

type FetchDatabasePayload

type FetchDatabasePayload struct {
	Highlight []FetchDatabaseHighlight `json:"highlight"`
	Results   []string                 `json:"results"`
}

type FetchIdcResult

type FetchIdcResult struct {
	Payload []string `json:"payload"`
	Code    int64    `json:"code"`
	Text    string   `json:"text"`
}

type FetchSourcePayload

type FetchSourcePayload struct {
	Assigned []string `json:"assigned"`
	Source   []string `json:"source"`
}

type FetchSourceResult

type FetchSourceResult struct {
	Payload FetchSourcePayload `json:"payload"`
	Code    int64              `json:"code"`
	Text    string             `json:"text"`
}

type FetchTablesHighlight

type FetchTablesHighlight struct {
	Meta string `json:"meta"`
	Vl   string `json:"vl"`
}

type FetchTablesPayload

type FetchTablesPayload struct {
	Highlight []FetchTablesHighlight `json:"highlight"`
	Table     []string               `json:"table"`
}

type FetchTablesResult

type FetchTablesResult struct {
	Payload FetchTablesPayload `json:"payload"`
	Code    int64              `json:"code"`
	Text    string             `json:"text"`
}

type JWTPayload

type JWTPayload struct {
	Exp  int64  `json:"exp"`
	Name string `json:"name"`
	Role string `json:"role"`
}

type LoginPayload

type LoginPayload struct {
	Permissions string `json:"permissions"`
	RealName    string `json:"real_name"`
	Token       string `json:"token"`
	User        string `json:"user"`
}

type LoginResult

type LoginResult struct {
	Payload LoginPayload `json:"payload"`
	Code    int64        `json:"code"`
	Text    string       `json:"text"`
}

type QueryFetchBaseResult

type QueryFetchBaseResult struct {
	Payload FetchBasePayload `json:"payload"`
	Code    int64            `json:"code"`
	Text    string           `json:"text"`
}

type QueryReferResult

type QueryReferResult struct {
	Payload interface{} `json:"payload"`
	Code    int64       `json:"code"`
	Text    string      `json:"text"`
}

type QueryResultPayload

type QueryResultPayload struct {
	Data   []map[string]string `json:"data"`
	Status bool                `json:"status"`
	Time   int64               `json:"time"`
	Title  []QueryResultTitle  `json:"title"`
	Total  int64               `json:"total"`
}

type QueryResultTitle

type QueryResultTitle struct {
	Fixed *string `json:"fixed,omitempty"`
	Key   string  `json:"key"`
	Title string  `json:"title"`
	Width string  `json:"width"`
}

type QueryResults

type QueryResults struct {
	Payload QueryResultPayload `json:"payload"`
	Code    int64              `json:"code"`
	Text    string             `json:"text"`
}

type QueryStatusPayload

type QueryStatusPayload struct {
	Export bool   `json:"export"`
	Idc    string `json:"idc"`
	Status int64  `json:"status"`
}

type QueryStatusResult

type QueryStatusResult struct {
	Payload QueryStatusPayload `json:"payload"`
	Code    int64              `json:"code"`
	Text    string             `json:"text"`
}

type TableQuery

type TableQuery struct {
	IDC      string `json:"idc"`
	Source   string `json:"source"`
	Database string `json:"data_base"`
	Table    string `json:"table"`
	Reason   string `json:"reason"`
	Delay    string `json:"delay"`
	Assigned string `json:"assigned"`
	Backup   int    `json:"backup"`
	Export   int    `json:"export"`
	Tp       int    `json:"tp"`
}

type Yearning

type Yearning struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(username, password, host, loginType string) *Yearning

NewClient new a client

func (*Yearning) FetchDatabases

func (y *Yearning) FetchDatabases(source string) (baseRes FetchDataBaseResult, err error)

FetchDatabases get databases from a source

func (*Yearning) FetchIDC

func (y *Yearning) FetchIDC() (idcRes FetchIdcResult, err error)

FetchIDC get idc list

func (*Yearning) FetchSource

func (y *Yearning) FetchSource(idc, tp string) (sourceRes FetchSourceResult, err error)

FetchSource get sources from an IDC

func (*Yearning) FetchTables

func (y *Yearning) FetchTables(tQ *TableQuery) (tRes FetchTablesResult, err error)

FetchTables fetch tables

func (*Yearning) Login

func (y *Yearning) Login(normal string) (loginRes LoginResult, err error)

Login Login yearning

func (*Yearning) QueryFetchBase

func (y *Yearning) QueryFetchBase(source string) (fetchBase QueryFetchBaseResult, err error)

QueryFetchBase get the databases from a source

func (*Yearning) QueryRefer

func (y *Yearning) QueryRefer(assigned, idc, reason string) (referRes QueryReferResult, err error)

QueryRefer submit a reference

func (*Yearning) QueryResults

func (y *Yearning) QueryResults(source, database, sql string) (qRes QueryResults, err error)

QueryResults get sql results

func (*Yearning) QueryStatus

func (y *Yearning) QueryStatus() (statusRes QueryStatusResult, err error)

QueryStatus the query status

Jump to

Keyboard shortcuts

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