metrics3

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Anodot20Response

type Anodot20Response struct {
	Errors []struct {
		Description string
		Error       int64
		Index       string
	} `json:"errors"`
	HttpResponse *http.Response `json:"-"`
}

func (*Anodot20Response) ErrorMessage

func (r *Anodot20Response) ErrorMessage() string

func (*Anodot20Response) HasErrors

func (r *Anodot20Response) HasErrors() bool

func (*Anodot20Response) RawResponse

func (r *Anodot20Response) RawResponse() *http.Response

type Anodot30Client

type Anodot30Client struct {
	ServerURL           *url.URL
	AccessKey           *string
	DataCollectionToken *string
	// contains filtered or unexported fields
}

func NewAnodot30Client

func NewAnodot30Client(anodotURL url.URL, accessKey *string, dataToken *string, httpClient *http.Client) (*Anodot30Client, error)

func (*Anodot30Client) CreateSchema

func (c *Anodot30Client) CreateSchema(schema AnodotMetricsSchema) (*CreateSchemaResponse, error)

func (*Anodot30Client) DeleteSchema

func (c *Anodot30Client) DeleteSchema(schemaId string) (*DeleteSchemaResponse, error)

func (*Anodot30Client) GetBearerToken

func (c *Anodot30Client) GetBearerToken() (*string, error)

func (*Anodot30Client) GetSchemas

func (c *Anodot30Client) GetSchemas() (*GetSchemaResponse, error)

func (*Anodot30Client) SendToBC added in v0.0.10

func (c *Anodot30Client) SendToBC(bcData Pipeline) (*Api30Response, error)

func (*Anodot30Client) SubmitMetrics

func (c *Anodot30Client) SubmitMetrics(metrics []AnodotMetrics30) (*SubmitMetricsResponse, error)

func (*Anodot30Client) SubmitWatermark

func (c *Anodot30Client) SubmitWatermark(schemaId string, watermark AnodotTimestamp) (*SubmitWatermarkResponse, error)

type AnodotMetrics30

type AnodotMetrics30 struct {
	SchemaId     string              `json:"schemaId"`
	Timestamp    AnodotTimestamp     `json:"timestamp"`
	Dimensions   map[string]string   `json:"dimensions"`
	Measurements map[string]float64  `json:"measurements"`
	Tags         map[string][]string `json:"tags"`
}

func (*AnodotMetrics30) MarshalJSON

func (m *AnodotMetrics30) MarshalJSON() ([]byte, error)

type AnodotMetricsSchema

type AnodotMetricsSchema struct {
	Id               string                    `json:"id,omitempty"`
	Dimensions       []string                  `json:"dimensions"`
	Measurements     map[string]MeasurmentBase `json:"measurements"`
	MissingDimPolicy *DimensionPolicy          `json:"missingDimPolicy,omitempty"`
	Name             string                    `json:"name"`
	Version          string                    `json:"version,omitempty"`
}

type AnodotResponse

type AnodotResponse interface {
	HasErrors() bool
	ErrorMessage() string
	RawResponse() *http.Response
}

type AnodotTimestamp

type AnodotTimestamp struct {
	time.Time
}

func (AnodotTimestamp) MarshalJSON

func (t AnodotTimestamp) MarshalJSON() ([]byte, error)

type Api30Response

type Api30Response struct {
	Error *struct {
		Status        int    `json:"status"`
		Name          string `json:"name"`
		Message       string `json:"message"`
		AndtErrorCode int    `json:"andtErrorCode"`
		Path          string `json:"path"`
	}
	HttpResponse *http.Response `json:"-"`
}

func (*Api30Response) ErrorMessage

func (r *Api30Response) ErrorMessage() string

func (*Api30Response) HasErrors

func (r *Api30Response) HasErrors() bool

func (*Api30Response) RawResponse

func (r *Api30Response) RawResponse() *http.Response

type CreateSchemaResponse

type CreateSchemaResponse struct {
	SchemaId *string
	Api30Response
}

type DeleteSchemaResponse

type DeleteSchemaResponse struct {
	SchemaId *string
	Api30Response
}

type DimensionPolicy

type DimensionPolicy struct {
	Action string `json:"action"`
	Fill   string `json:"fill,omitempty"`
}

type GetSchemaResponse

type GetSchemaResponse struct {
	Schemas []AnodotMetricsSchema
	Api30Response
}

Responses for api calls Inherits base methods and fields from ApiResponse structure using composition

type Measurment

type Measurment struct {
	Base MeasurmentBase
	Name string
}

type MeasurmentBase

type MeasurmentBase struct {
	Aggregation string `json:"aggregation"`
	CountBy     string `json:"countBy"`
	Units       string `json:"units,omitempty"`
}

type Pipeline added in v0.0.10

type Pipeline struct {
	Id                  string          `json:"pipeline_id"`
	Created             AnodotTimestamp `json:"created"`
	Updated             AnodotTimestamp `json:"updated"`
	Status              string          `json:"status"`
	SchemaId            string          `json:"schemaId"`
	Source              `json:"source"`
	Scheduling          `json:"scheduling"`
	Progress            `json:"progress"`
	AnodotMetricsSchema `json:"schema"`
}

type Progress added in v0.0.10

type Progress struct {
	LastOffset string `json:"last_offset"`
}

type Scheduling added in v0.0.10

type Scheduling struct {
	Interval string `json:"interval"`
	Delay    string `json:"delay"`
}

type Source added in v0.0.10

type Source struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

type StreamSchemaWrapper

type StreamSchemaWrapper struct {
	Wrapper struct {
		Schema AnodotMetricsSchema `json:"schema"`
	} `json:"streamSchemaWrapper"`
}

type SubmitMetricsResponse

type SubmitMetricsResponse struct {
	Anodot20Response
}

type SubmitWatermarkResponse

type SubmitWatermarkResponse struct {
	Anodot20Response
}

Jump to

Keyboard shortcuts

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