sharedmeta

package
v1.83.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package sharedmeta provides framework-side resources/data sources with the same runtime context as SDKv2 (credentials and a shared SDK client).

This package never parses credentials. Credentials are parsed exclusively by the SDKv2 provider's ConfigureContextFunc and then injected via SetSharedMeta; this package only carries and holds the value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSharedMeta

func GetSharedMeta() *connectivity.TencentCloudClient

GetSharedMeta is invoked by the framework provider in Configure. A nil return means the SDKv2 provider has not finished configuring; the caller should emit a diagnostic instead of panicking.

func ResetSharedMetaForTest

func ResetSharedMetaForTest()

ResetSharedMetaForTest is intended only for unit tests to reset state between cases. Do not call it from production code.

func SetSharedMeta

func SetSharedMeta(c *connectivity.TencentCloudClient)

SetSharedMeta is invoked by the SDKv2 provider after credentials are resolved and the client is constructed, exposing the same client to the framework provider for reuse.

Multiple invocations are legal: last write wins (e.g. acceptance tests that reset state between cases).

Types

type ProviderMeta

type ProviderMeta struct {
	// Client is the same TencentCloud SDK client instance shared with the
	// SDKv2 provider; it owns credentials, SDK client cache, UA, and retry
	// behaviour.
	Client *connectivity.TencentCloudClient
}

ProviderMeta is the concrete type of req.ProviderData that framework-side resources/data sources receive in their Configure phase. Each framework resource should type-assert to *ProviderMeta in Configure to obtain Client.

The field set is deliberately minimal. Future extensions (e.g. region override or module name) can be appended here without affecting existing framework resources.

Jump to

Keyboard shortcuts

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