conn

package
v0.0.0-beta31 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package conn @author: Violet-Eva @date : 2024/12/19 @notes :

Index

Constants

View Source
const (
	DefaultKrbConfPath  = "/etc/krb5.conf"
	DefaultKinitProgram = "/usr/bin/kinit"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	Host string
	Port int
	// binary http
	Mode string
}

type HiveConn

type HiveConn struct {
	KA            *KrbAuth
	HCI           *HiveConnInformation
	Conn          *gohive.Connection
	RetryCount    int
	RetryInterval time.Duration
	QueryTimeout  int
}

func NewHiveConn

func NewHiveConn(retryCount int, retryInterval time.Duration, queryTimeout int, information *HiveConnInformation, auth *KrbAuth) *HiveConn

func (*HiveConn) ExecQuery

func (hc *HiveConn) ExecQuery(query string) ([]map[string]interface{}, error)

func (*HiveConn) ExecQueryNoResult

func (hc *HiveConn) ExecQueryNoResult(query string) error

func (*HiveConn) ExecQueryToStruct

func (hc *HiveConn) ExecQueryToStruct(query string, data any) error

ExecQueryToStruct @Description: @param query @param data pointer @return []map[string]interface{} @return error

func (*HiveConn) GetHiveConn

func (hc *HiveConn) GetHiveConn() (err error)

type HiveConnInformation

type HiveConnInformation struct {
	Addresses []Address
	// KERBEROS NONE NOSASL LDAP CUSTOM DIGEST-MD5
	Auth          string
	Configuration *gohive.ConnectConfiguration
	ConnTimeout   time.Duration
}

func NewHiveConnInformation

func NewHiveConnInformation(addresses []Address, auth string, service string, fetchSize int64, hiveConfig map[string]string, connTimeout time.Duration) *HiveConnInformation

type KrbAuth

type KrbAuth struct {
	KrbConfPath      string
	KinitProgramPath string
	KeyTabFilePath   string
	Principal        string
}

func NewKrbAuth

func NewKrbAuth(krbConfPath, kinitProgramPath, keyTabFilePath, principal string) *KrbAuth

Jump to

Keyboard shortcuts

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