Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromConnParams ¶
func NewYtClientWrapper ¶
func NewYtClientWrapper(clientType ClientType, lgr log.Logger, ytConfig *yt.Config) (yt.Client, error)
NewYtClientWrapper creates YT client and make operations to extract correct logger for YT from second parameter which user passes. You may also can pass any logger or none at all (nil), then it should work properly as you create client with NewClient function of YT library by yourself.
Usage example with four commonly used parameters around Data Transfer code:
client, err := ytclient.NewYtClientWrapper(ytclient.HTTP, logger, &yt.Config{ Proxy: dst.Cluster(), Token: dst.Token(), AllowRequestsFromJob: true, DisableProxyDiscovery: dst.GetConnectionData().DisableProxyDiscovery, }) if err != nil { return nil, xerrors.Errorf("unable to initialize yt client: %w", err) }
Types ¶
type ConnParams ¶
type ConnParams interface { Proxy() string Token() string DisableProxyDiscovery() bool CompressionCodec() yt.ClientCompressionCodec }
Click to show internal directories.
Click to hide internal directories.