Help us shape the future of Go! Take the 2026 Go Developer Survey

common

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package common 提供 examples 共用的小工具:从环境变量构造连接信息与错误退出。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Conn

func Conn(prefix string) (dqex.DBConnInfo, error)

Conn 从环境变量构造连接信息,变量名前缀 prefix(如 "SRC"、"TGT"):

{P}_TYPE(必填,mysql/postgresql/oracle)、{P}_HOST(必填)、{P}_PORT、
{P}_USER、{P}_PASSWORD、{P}_DBNAME

func Fail

func Fail(err error)

Fail 打印错误并退出(SvcError 额外输出错误码,演示按错误码分支处理,3.3)。

Types

This section is empty.

Jump to

Keyboard shortcuts

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