goalisa

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

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

Go to latest
Published: Jun 2, 2021 License: Apache-2.0 Imports: 19 Imported by: 2

README

goalisa: A Go database/sql driver for alisa

Build Status GoDoc License Go Report Card

What is goalisa

To access databases, Go programmers call the standard library database/sql, which relies on drivers to talk to database management systems. goalisa is such a driver that talks to alisa.

For Users

goalisa is go-gettable. Please run the following command to install it:

go get sqlflow.org/goalisa

sqlflow.org/goalisa is a vainty import path of goalisa.

Please make sure you have Go 1.13+.

For developers

  • pop: supplies signature and sends HTTP request.
  • alisa: encapsulates HTTP action to Alisa SDK. It relays on pop.
  • alisa_wrap: integrates the API of Alisa SDK and supplies a high-level API. It relays on alisa.

License

goalisa comes with Apache License 2.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alisa

type Alisa struct {
	*Config
	// contains filtered or unexported fields
}

Alisa wrappered alisa pop client

func New

func New(cfg *Config) *Alisa

New returns an Alisa client instance

func (*Alisa) ExecPyODPSWithWriter

func (ali *Alisa) ExecPyODPSWithWriter(cmd, args string, w io.Writer) error

ExecPyODPSWithWriter executes cmd(pyodps code) and write logs into w

func (*Alisa) ExecWithWriter

func (ali *Alisa) ExecWithWriter(cmd string, w io.Writer) error

ExecWithWriter executes cmd and write logs into w

type Config

type Config struct {
	POPAccessID     string            // POP config
	POPAccessSecret string            // POP config
	POPURL          string            // POPURL does not contain a header like: http/https
	POPScheme       string            // POPScheme: http/https
	Env             map[string]string // Environment variable JSON encoded in base64 format.
	With            map[string]string // With variable JSON encoded in base64 format.
	Verbose         bool              // Verbose denotes whether to print logs to the terminal
	Project         string            // Project(name) of Alisa, generated from Env.
}

Config is the deserialization of connect string, the connection string should of format: pop_access_id:pop_access_secret@pop_url?env=..

func ParseDSN

func ParseDSN(dsn string) (*Config, error)

ParseDSN deserialize the connect string

func (*Config) FormatDSN

func (cfg *Config) FormatDSN() string

FormatDSN serialize a config to connect string

type Driver

type Driver struct{}

Driver implements database/sql/driver.Driver

func (Driver) Open

func (dr Driver) Open(dsn string) (driver.Conn, error)

Open returns a connection

Jump to

Keyboard shortcuts

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