Documentation ¶
Index ¶
- Constants
- Variables
- func AccountMultiplex(meta schema.ClientMeta) []schema.ClientMeta
- func MockTestHelper(t *testing.T, table *schema.Table, ...)
- func New(logger zerolog.Logger, spec Spec) (schema.ClientMeta, error)
- func ResolveAccount(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error
- func ResolveRegion(_ context.Context, meta schema.ClientMeta, r *schema.Resource, _ schema.Column) error
- func ServiceAccountRegionMultiplexer(service string) func(meta schema.ClientMeta) []schema.ClientMeta
- func TimestampResolver(layout, path string) schema.ColumnResolver
- type AccountSpec
- type Client
- type Services
- type Spec
- type TestOptions
Constants ¶
View Source
const ServiceECS = "ecs"
Variables ¶
View Source
var JSONSchema string
View Source
var ServiceRegions = map[string][]string{ ServiceECS: { "cn-hangzhou", "cn-qingdao", "cn-beijing", "cn-zhangjiakou", "cn-huhehaote", "cn-shanghai", "cn-shenzhen", "cn-hongkong", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3", "ap-southeast-5", "ap-northeast-1", "eu-west-1", "us-west-1", "us-east-1", "eu-central-1", "me-east-1", "ap-south-1", "cn-shanghai-finance-1", "cn-shenzhen-finance-1", "cn-chengdu", "cn-heyuan", "cn-wulanchabu", "rus-west-1", "cn-guangzhou", "ap-southeast-6", "cn-nanjing", }, }
ServiceRegions maps service name to a list of regions where the service is available. Extracted from https://api.aliyun.com/#/region
Functions ¶
func AccountMultiplex ¶
func AccountMultiplex(meta schema.ClientMeta) []schema.ClientMeta
func MockTestHelper ¶
func MockTestHelper(t *testing.T, table *schema.Table, builder func(*testing.T, *gomock.Controller) Services, _ TestOptions)
func ResolveAccount ¶
func ResolveRegion ¶
func ServiceAccountRegionMultiplexer ¶
func ServiceAccountRegionMultiplexer(service string) func(meta schema.ClientMeta) []schema.ClientMeta
func TimestampResolver ¶
func TimestampResolver(layout, path string) schema.ColumnResolver
Types ¶
type AccountSpec ¶
type AccountSpec struct { Name string `json:"name,omitempty" jsonschema:"required,minLength=1"` Regions []string `json:"regions,omitempty" jsonschema:"required,minItems=1"` AccessKey string `json:"access_key,omitempty" jsonschema:"required,minLength=1"` SecretKey string `json:"secret_key,omitempty" jsonschema:"required,minLength=1"` }
type Client ¶
type Client struct { Spec Spec AccountID string Region string // contains filtered or unexported fields }
func (*Client) WithAccountIDAndRegion ¶
type Spec ¶
type Spec struct { Accounts []AccountSpec `json:"accounts,omitempty" jsonschema:"required,minItems=1"` BillHistoryMonths int `json:"bill_history_months,omitempty"` Concurrency int `json:"concurrency,omitempty"` }
func (*Spec) SetDefaults ¶
func (s *Spec) SetDefaults()
type TestOptions ¶
type TestOptions struct{}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.