connectors

package
v0.0.0-...-c0c544a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSessionId

func GetSessionId(resp *http.Response) string

func PostQuery

func PostQuery(api RestAPI, database, sql string) ([]byte, error)

func ReadRowColumns

func ReadRowColumns(body []byte) (data []Record, columns []ColumnType, err error)

Types

type ColumnType

type ColumnType struct {
	ColumnName string
	ColumnType string
}

type Record

type Record struct {
	Fields []interface{}
}

type Response

type Response struct {
	Type  string      `json:"type"`
	Error string      `json:"error_message"`
	Data  interface{} `json:"data"`
}

type RestAPI

type RestAPI struct {
	Url      *url.URL
	Email    string
	Password string
	Session  *http.Client
}

func Login

func Login(email, password string) (*RestAPI, error)

func (*RestAPI) APIRequest

func (api *RestAPI) APIRequest(database, method, endpoint string, body map[string]string) ([]byte, error)

func (*RestAPI) SqlQuery

func (api *RestAPI) SqlQuery(session *http.Client, sql string, database string, lowercaseColumns bool) (data []Record, columns []ColumnType, err error)

Jump to

Keyboard shortcuts

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