client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func ProjectMultiplex

func ProjectMultiplex(meta schema.ClientMeta) []schema.ClientMeta

func ResolveProjectId

func ResolveProjectId(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error

Types

type Client

type Client struct {
	Spec Spec

	SwetrixClient *rest.SwetrixRestClient

	// We multiplex based on projectId - this is the projectId this client is responsible for.
	ProjectId string

	Logger zerolog.Logger
}

func (*Client) ID

func (c *Client) ID() string

type Spec

type Spec struct {
	ProjectIds []string `json:"project_ids"`
	ApiKey     string   `json:"api_key"`

	TimeBucket string `json:"time_bucket"`
	Period     string `json:"period"`

	From     string `json:"from"`
	To       string `json:"to"`
	Timezone string `json:"timezone"`
}

func (*Spec) Validate

func (spec *Spec) Validate() error

Jump to

Keyboard shortcuts

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