Movatterモバイル変換


[0]ホーム

URL:


connection

package
v1.5.1Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2025 License:GPL-3.0Imports:26Imported by:4

Details

Repository

github.com/slingdata-io/sling-cli

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcCloseAlladded inv1.3.5

func CloseAll()

CloseAll closes all cached connections

funcCopyDirect

func CopyDirect(conndatabase.Connection, tableFNamestring, srcFileConnection) (cntuint64, okbool, errerror)

CopyDirect copies directly from cloud files(without passing through dbio)

funcLoadAPISpecadded inv1.4.5

func LoadAPISpec(specIdentifierstring) (specapi.Spec, errerror)

LoadAPISpec loads the spec from the spec location

funcReadConnections

func ReadConnections(env map[string]interface{}) (conns map[string]Connection, errerror)

funcReadConnectionsEnv

func ReadConnectionsEnv(env map[string]interface{}) (conns map[string]Connection, errerror)

ReadConnections loads the connections

funcReadConnectionsFromFile

func ReadConnectionsFromFile(pathstring) (conns map[string]Connection, errerror)

funcReadDbtConnections

func ReadDbtConnections() (conns map[string]Connection, errerror)

funcSchemeType

func SchemeType(urlstring)dbio.Type

SchemeType returns the correct scheme of the url

Types

typeAsConnOptionsadded inv1.4.24

type AsConnOptions struct {UseCacheboolExpireint// in secondsExtra    map[string]any}

typeConnEntriesadded inv1.2.16

type ConnEntries []ConnEntry

funcGetLocalConns

func GetLocalConns(options ...any)ConnEntries

func (ConnEntries)Discoveradded inv1.2.19

func (ceConnEntries) Discover(namestring, opt *DiscoverOptions) (nodesfilesys.FileNodes, schematadatabase.Schemata, endpointsapi.Endpoints, errerror)

func (ConnEntries)Getadded inv1.2.16

func (ceConnEntries) Get(namestring)ConnEntry

func (ConnEntries)Listadded inv1.2.19

func (ceConnEntries) List() (fields []string, rows [][]any)

func (ConnEntries)Namesadded inv1.4.7

func (ceConnEntries) Names() (names []string)

func (ConnEntries)Testadded inv1.2.19

func (ceConnEntries) Test(namestring) (okbool, errerror)

typeConnEntry

type ConnEntry struct {Namestring     `json:"name"`Descriptionstring     `json:"description"`Sourcestring     `json:"source"`ConnectionConnection `json:"connection"`}

funcLocalFileConnEntry

func LocalFileConnEntry()ConnEntry

typeConnection

type Connection struct {Namestring                 `json:"name,omitempty"`Typedbio.Type              `json:"type,omitempty"`Data map[string]interface{} `json:"data,omitempty"`Filefilesys.FileSysClientDatabasedatabase.ConnectionAPI      *api.APIConnection// contains filtered or unexported fields}

Connection is the base connection struct

funcNewConnection

func NewConnection(Namestring, tdbio.Type, Data map[string]interface{}) (connConnection, errerror)

NewConnection creates a new connection

funcNewConnectionFromDbt

func NewConnectionFromDbt(namestring) (cConnection, errerror)

NewConnectionFromDbt loads a Connection from a DBT Profile

funcNewConnectionFromMap

func NewConnectionFromMap(m map[string]interface{}) (cConnection, errerror)

NewConnectionFromMap loads a Connection from a Map

funcNewConnectionFromProfiles

func NewConnectionFromProfiles(namestring) (cConnection, errerror)

NewConnectionFromProfiles loads a Connection from YAML Profiles

funcNewConnectionFromURL

func NewConnectionFromURL(Name, URLstring) (connConnection, errerror)

NewConnectionFromURL creates a new connection from a url

funcParseLocationadded inv1.4.5

func ParseLocation(locationstring) (connConnection, objectExprstring, errerror)

func (*Connection)AsAPIadded inv1.4.5

func (c *Connection) AsAPI(options ...AsConnOptions) (ac *api.APIConnection, errerror)

func (*Connection)AsAPIContextadded inv1.4.5

func (c *Connection) AsAPIContext(ctxcontext.Context, options ...AsConnOptions) (ac *api.APIConnection, errerror)

func (*Connection)AsDatabase

func (c *Connection) AsDatabase(options ...AsConnOptions) (dcdatabase.Connection, errerror)

func (*Connection)AsDatabaseContextadded inv1.3.4

func (c *Connection) AsDatabaseContext(ctxcontext.Context, options ...AsConnOptions) (dcdatabase.Connection, errerror)

func (*Connection)AsFile

func (c *Connection) AsFile(options ...AsConnOptions) (fcfilesys.FileSysClient, errerror)

func (*Connection)AsFileContextadded inv1.3.4

func (c *Connection) AsFileContext(ctxcontext.Context, options ...AsConnOptions) (fcfilesys.FileSysClient, errerror)

func (*Connection)Close

func (c *Connection) Close()error

Close closes the connection

func (*Connection)ConnSetDatabase

func (c *Connection) ConnSetDatabase(dbNamestring) *Connection

ConnSetDatabase returns a new connection with the specifieddatabase name

func (*Connection)Context

func (c *Connection) Context() *g.Context

Context returns the context

func (*Connection)Copy

func (c *Connection) Copy() *Connection

ToMap transforms DataConn to a Map

func (*Connection)DataS

func (c *Connection) DataS(lowerCase ...bool) map[string]string

DataS returns data as map[string]string

func (*Connection)DataSWithExtraadded inv1.4.24

func (c *Connection) DataSWithExtra(extra map[string]any) map[string]string

func (*Connection)Discoveradded inv1.2.16

func (c *Connection) Discover(opt *DiscoverOptions) (okbool, nodesfilesys.FileNodes, schematadatabase.Schemata, endpointsapi.Endpoints, errerror)

func (*Connection)Hash

func (c *Connection) Hash()string

func (*Connection)Info

func (c *Connection) Info()Info

Info returns connection information

func (*Connection)Set

func (c *Connection) Set(m map[string]interface{})

Set sets key/values from a map

func (*Connection)Testadded inv1.2.16

func (c *Connection) Test() (okbool, errerror)

func (*Connection)ToMap

func (c *Connection) ToMap() map[string]interface{}

ToMap transforms DataConn to a Map

func (*Connection)URL

func (c *Connection) URL()string

URL returns the url string

typeConnectionInt

type ConnectionInt interface {// Self() ConnectionClose()errorContext()g.ContextInfo()InfoURL()stringDataS(lowerCase ...bool) map[string]stringToMap() map[string]interface{}AsDatabase() (database.Connection,error)AsFile() (filesys.FileSysClient,error)Set(map[string]interface{})}

ConnectionInt is a connection

typeDiscoverOptions

type DiscoverOptions struct {Patternstring                 `json:"pattern,omitempty"`Leveldatabase.SchemataLevel `json:"level,omitempty"`Recursivebool                   `json:"recursive,omitempty"`}

typeEnvFileConnsadded inv1.2.19

type EnvFileConns struct {NamestringEnvFile *env.EnvFile}

func (*EnvFileConns)ConnectionEntriesadded inv1.2.19

func (ec *EnvFileConns) ConnectionEntries() (entriesConnEntries, errerror)

func (*EnvFileConns)GetConnEntryadded inv1.2.19

func (ec *EnvFileConns) GetConnEntry(namestring) (connConnEntry, okbool)

GetConnEntry get connection from envfile (may be provided via body)

func (*EnvFileConns)Setadded inv1.2.19

func (ec *EnvFileConns) Set(namestring, kvMap map[string]any) (errerror)

func (*EnvFileConns)Unsetadded inv1.2.19

func (ec *EnvFileConns) Unset(namestring) (errerror)

typeInfo

type Info struct {NamestringTypedbio.TypeLongTypestringDatabasestringData     map[string]interface{}}

Info is the connection type

func (*Info)IsURL

func (i *Info) IsURL()bool

typeLocalConnsExcludeadded inv1.4.11

type LocalConnsExcludestring

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp