pyroscopeapi

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithServerURL

func WithServerURL(ctx context.Context, u *url.URL) context.Context

WithServerURL sets context key to override server URL.

Types

type ApplicationMetadata

type ApplicationMetadata struct {
	Name       OptString                   `json:"name"`
	SpyName    OptString                   `json:"spyName"`
	SampleRate OptUint32                   `json:"sampleRate"`
	Units      OptApplicationMetadataUnits `json:"units"`
}

Ref: #/components/schemas/ApplicationMetadata

func (*ApplicationMetadata) Decode

func (s *ApplicationMetadata) Decode(d *jx.Decoder) error

Decode decodes ApplicationMetadata from json.

func (*ApplicationMetadata) Encode

func (s *ApplicationMetadata) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*ApplicationMetadata) GetName

func (s *ApplicationMetadata) GetName() OptString

GetName returns the value of Name.

func (*ApplicationMetadata) GetSampleRate

func (s *ApplicationMetadata) GetSampleRate() OptUint32

GetSampleRate returns the value of SampleRate.

func (*ApplicationMetadata) GetSpyName

func (s *ApplicationMetadata) GetSpyName() OptString

GetSpyName returns the value of SpyName.

func (*ApplicationMetadata) GetUnits

GetUnits returns the value of Units.

func (*ApplicationMetadata) MarshalJSON

func (s *ApplicationMetadata) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*ApplicationMetadata) SetFake

func (s *ApplicationMetadata) SetFake()

SetFake set fake values.

func (*ApplicationMetadata) SetName

func (s *ApplicationMetadata) SetName(val OptString)

SetName sets the value of Name.

func (*ApplicationMetadata) SetSampleRate

func (s *ApplicationMetadata) SetSampleRate(val OptUint32)

SetSampleRate sets the value of SampleRate.

func (*ApplicationMetadata) SetSpyName

func (s *ApplicationMetadata) SetSpyName(val OptString)

SetSpyName sets the value of SpyName.

func (*ApplicationMetadata) SetUnits

SetUnits sets the value of Units.

func (*ApplicationMetadata) UnmarshalJSON

func (s *ApplicationMetadata) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ApplicationMetadata) Validate

func (s *ApplicationMetadata) Validate() error

type ApplicationMetadataUnits

type ApplicationMetadataUnits string
const (
	ApplicationMetadataUnitsSamples         ApplicationMetadataUnits = "samples"
	ApplicationMetadataUnitsObjects         ApplicationMetadataUnits = "objects"
	ApplicationMetadataUnitsGoroutines      ApplicationMetadataUnits = "goroutines"
	ApplicationMetadataUnitsBytes           ApplicationMetadataUnits = "bytes"
	ApplicationMetadataUnitsLockNanoseconds ApplicationMetadataUnits = "lock_nanoseconds"
	ApplicationMetadataUnitsLockSamples     ApplicationMetadataUnits = "lock_samples"
)

func (ApplicationMetadataUnits) AllValues added in v0.1.0

AllValues returns all ApplicationMetadataUnits values.

func (*ApplicationMetadataUnits) Decode

func (s *ApplicationMetadataUnits) Decode(d *jx.Decoder) error

Decode decodes ApplicationMetadataUnits from json.

func (ApplicationMetadataUnits) Encode

func (s ApplicationMetadataUnits) Encode(e *jx.Encoder)

Encode encodes ApplicationMetadataUnits as json.

func (ApplicationMetadataUnits) MarshalJSON

func (s ApplicationMetadataUnits) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (ApplicationMetadataUnits) MarshalText

func (s ApplicationMetadataUnits) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*ApplicationMetadataUnits) SetFake

func (s *ApplicationMetadataUnits) SetFake()

SetFake set fake values.

func (*ApplicationMetadataUnits) UnmarshalJSON

func (s *ApplicationMetadataUnits) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*ApplicationMetadataUnits) UnmarshalText

func (s *ApplicationMetadataUnits) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (ApplicationMetadataUnits) Validate

func (s ApplicationMetadataUnits) Validate() error

type AtTime

type AtTime string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements OAS client.

func NewClient

func NewClient(serverURL string, opts ...ClientOption) (*Client, error)

NewClient initializes new Client defined by OAS.

func (*Client) GetApps

func (c *Client) GetApps(ctx context.Context) ([]ApplicationMetadata, error)

GetApps invokes getApps operation.

Returns list of application metadata. Used by Grafana to test connection to Pyroscope.

GET /api/apps

func (*Client) Ingest

func (c *Client) Ingest(ctx context.Context, request *IngestReqWithContentType, params IngestParams) error

Ingest invokes ingest operation.

Push data to Pyroscope.

POST /ingest

func (*Client) LabelValues

func (c *Client) LabelValues(ctx context.Context, params LabelValuesParams) (LabelValues, error)

LabelValues invokes labelValues operation.

Returns list of label values.

GET /label-values

func (*Client) Labels

func (c *Client) Labels(ctx context.Context, params LabelsParams) (Labels, error)

Labels invokes labels operation.

Returns list of labels.

GET /labels

func (*Client) Render

func (c *Client) Render(ctx context.Context, params RenderParams) (*FlamebearerProfileV1, error)

Render invokes render operation.

Renders given query. One of `query` or `key` is required.

GET /render

type ClientOption

type ClientOption interface {
	// contains filtered or unexported methods
}

ClientOption is client config option.

func WithClient

func WithClient(client ht.Client) ClientOption

WithClient specifies http client to use.

type Error

type Error string

func (*Error) Decode

func (s *Error) Decode(d *jx.Decoder) error

Decode decodes Error from json.

func (Error) Encode

func (s Error) Encode(e *jx.Encoder)

Encode encodes Error as json.

func (Error) MarshalJSON

func (s Error) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetFake

func (s *Error) SetFake()

SetFake set fake values.

func (*Error) UnmarshalJSON

func (s *Error) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type ErrorHandler

type ErrorHandler = ogenerrors.ErrorHandler

ErrorHandler is error handler.

type ErrorStatusCode

type ErrorStatusCode struct {
	StatusCode int
	Response   Error
}

ErrorStatusCode wraps Error with StatusCode.

func (*ErrorStatusCode) Error

func (s *ErrorStatusCode) Error() string

func (*ErrorStatusCode) GetResponse

func (s *ErrorStatusCode) GetResponse() Error

GetResponse returns the value of Response.

func (*ErrorStatusCode) GetStatusCode

func (s *ErrorStatusCode) GetStatusCode() int

GetStatusCode returns the value of StatusCode.

func (*ErrorStatusCode) SetResponse

func (s *ErrorStatusCode) SetResponse(val Error)

SetResponse sets the value of Response.

func (*ErrorStatusCode) SetStatusCode

func (s *ErrorStatusCode) SetStatusCode(val int)

SetStatusCode sets the value of StatusCode.

type FlamebearerMetadataV1

type FlamebearerMetadataV1 struct {
	Name       OptString                     `json:"name"`
	SpyName    OptString                     `json:"spyName"`
	SampleRate OptUint32                     `json:"sampleRate"`
	Units      OptFlamebearerMetadataV1Units `json:"units"`
	Format     string                        `json:"format"`
}

Ref: #/components/schemas/FlamebearerMetadataV1

func (*FlamebearerMetadataV1) Decode

func (s *FlamebearerMetadataV1) Decode(d *jx.Decoder) error

Decode decodes FlamebearerMetadataV1 from json.

func (*FlamebearerMetadataV1) Encode

func (s *FlamebearerMetadataV1) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FlamebearerMetadataV1) GetFormat

func (s *FlamebearerMetadataV1) GetFormat() string

GetFormat returns the value of Format.

func (*FlamebearerMetadataV1) GetName

func (s *FlamebearerMetadataV1) GetName() OptString

GetName returns the value of Name.

func (*FlamebearerMetadataV1) GetSampleRate

func (s *FlamebearerMetadataV1) GetSampleRate() OptUint32

GetSampleRate returns the value of SampleRate.

func (*FlamebearerMetadataV1) GetSpyName

func (s *FlamebearerMetadataV1) GetSpyName() OptString

GetSpyName returns the value of SpyName.

func (*FlamebearerMetadataV1) GetUnits

GetUnits returns the value of Units.

func (*FlamebearerMetadataV1) MarshalJSON

func (s *FlamebearerMetadataV1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerMetadataV1) SetFake

func (s *FlamebearerMetadataV1) SetFake()

SetFake set fake values.

func (*FlamebearerMetadataV1) SetFormat

func (s *FlamebearerMetadataV1) SetFormat(val string)

SetFormat sets the value of Format.

func (*FlamebearerMetadataV1) SetName

func (s *FlamebearerMetadataV1) SetName(val OptString)

SetName sets the value of Name.

func (*FlamebearerMetadataV1) SetSampleRate

func (s *FlamebearerMetadataV1) SetSampleRate(val OptUint32)

SetSampleRate sets the value of SampleRate.

func (*FlamebearerMetadataV1) SetSpyName

func (s *FlamebearerMetadataV1) SetSpyName(val OptString)

SetSpyName sets the value of SpyName.

func (*FlamebearerMetadataV1) SetUnits

SetUnits sets the value of Units.

func (*FlamebearerMetadataV1) UnmarshalJSON

func (s *FlamebearerMetadataV1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FlamebearerMetadataV1) Validate

func (s *FlamebearerMetadataV1) Validate() error

type FlamebearerMetadataV1Units

type FlamebearerMetadataV1Units string
const (
	FlamebearerMetadataV1UnitsSamples         FlamebearerMetadataV1Units = "samples"
	FlamebearerMetadataV1UnitsObjects         FlamebearerMetadataV1Units = "objects"
	FlamebearerMetadataV1UnitsGoroutines      FlamebearerMetadataV1Units = "goroutines"
	FlamebearerMetadataV1UnitsBytes           FlamebearerMetadataV1Units = "bytes"
	FlamebearerMetadataV1UnitsLockNanoseconds FlamebearerMetadataV1Units = "lock_nanoseconds"
	FlamebearerMetadataV1UnitsLockSamples     FlamebearerMetadataV1Units = "lock_samples"
)

func (FlamebearerMetadataV1Units) AllValues added in v0.1.0

AllValues returns all FlamebearerMetadataV1Units values.

func (*FlamebearerMetadataV1Units) Decode

Decode decodes FlamebearerMetadataV1Units from json.

func (FlamebearerMetadataV1Units) Encode

func (s FlamebearerMetadataV1Units) Encode(e *jx.Encoder)

Encode encodes FlamebearerMetadataV1Units as json.

func (FlamebearerMetadataV1Units) MarshalJSON

func (s FlamebearerMetadataV1Units) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (FlamebearerMetadataV1Units) MarshalText

func (s FlamebearerMetadataV1Units) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*FlamebearerMetadataV1Units) SetFake

func (s *FlamebearerMetadataV1Units) SetFake()

SetFake set fake values.

func (*FlamebearerMetadataV1Units) UnmarshalJSON

func (s *FlamebearerMetadataV1Units) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FlamebearerMetadataV1Units) UnmarshalText

func (s *FlamebearerMetadataV1Units) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (FlamebearerMetadataV1Units) Validate

func (s FlamebearerMetadataV1Units) Validate() error

type FlamebearerProfileV1

type FlamebearerProfileV1 struct {
	Flamebearer FlamebearerV1                 `json:"flamebearer"`
	Metadata    FlamebearerMetadataV1         `json:"metadata"`
	Timeline    OptFlamebearerTimelineV1      `json:"timeline"`
	Groups      OptFlamebearerProfileV1Groups `json:"groups"`
	Heatmap     OptNilHeatmap                 `json:"heatmap"`
	LeftTicks   OptUint64                     `json:"leftTicks"`
	RightTicks  OptUint64                     `json:"rightTicks"`
}

Ref: #/components/schemas/FlamebearerProfileV1

func (*FlamebearerProfileV1) Decode

func (s *FlamebearerProfileV1) Decode(d *jx.Decoder) error

Decode decodes FlamebearerProfileV1 from json.

func (*FlamebearerProfileV1) Encode

func (s *FlamebearerProfileV1) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FlamebearerProfileV1) GetFlamebearer

func (s *FlamebearerProfileV1) GetFlamebearer() FlamebearerV1

GetFlamebearer returns the value of Flamebearer.

func (*FlamebearerProfileV1) GetGroups

GetGroups returns the value of Groups.

func (*FlamebearerProfileV1) GetHeatmap

func (s *FlamebearerProfileV1) GetHeatmap() OptNilHeatmap

GetHeatmap returns the value of Heatmap.

func (*FlamebearerProfileV1) GetLeftTicks

func (s *FlamebearerProfileV1) GetLeftTicks() OptUint64

GetLeftTicks returns the value of LeftTicks.

func (*FlamebearerProfileV1) GetMetadata

GetMetadata returns the value of Metadata.

func (*FlamebearerProfileV1) GetRightTicks

func (s *FlamebearerProfileV1) GetRightTicks() OptUint64

GetRightTicks returns the value of RightTicks.

func (*FlamebearerProfileV1) GetTimeline

GetTimeline returns the value of Timeline.

func (*FlamebearerProfileV1) MarshalJSON

func (s *FlamebearerProfileV1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerProfileV1) SetFake

func (s *FlamebearerProfileV1) SetFake()

SetFake set fake values.

func (*FlamebearerProfileV1) SetFlamebearer

func (s *FlamebearerProfileV1) SetFlamebearer(val FlamebearerV1)

SetFlamebearer sets the value of Flamebearer.

func (*FlamebearerProfileV1) SetGroups

SetGroups sets the value of Groups.

func (*FlamebearerProfileV1) SetHeatmap

func (s *FlamebearerProfileV1) SetHeatmap(val OptNilHeatmap)

SetHeatmap sets the value of Heatmap.

func (*FlamebearerProfileV1) SetLeftTicks

func (s *FlamebearerProfileV1) SetLeftTicks(val OptUint64)

SetLeftTicks sets the value of LeftTicks.

func (*FlamebearerProfileV1) SetMetadata

func (s *FlamebearerProfileV1) SetMetadata(val FlamebearerMetadataV1)

SetMetadata sets the value of Metadata.

func (*FlamebearerProfileV1) SetRightTicks

func (s *FlamebearerProfileV1) SetRightTicks(val OptUint64)

SetRightTicks sets the value of RightTicks.

func (*FlamebearerProfileV1) SetTimeline

func (s *FlamebearerProfileV1) SetTimeline(val OptFlamebearerTimelineV1)

SetTimeline sets the value of Timeline.

func (*FlamebearerProfileV1) UnmarshalJSON

func (s *FlamebearerProfileV1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FlamebearerProfileV1) Validate

func (s *FlamebearerProfileV1) Validate() error

type FlamebearerProfileV1Groups

type FlamebearerProfileV1Groups map[string]FlamebearerTimelineV1

func (*FlamebearerProfileV1Groups) Decode

Decode decodes FlamebearerProfileV1Groups from json.

func (FlamebearerProfileV1Groups) Encode

func (s FlamebearerProfileV1Groups) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (FlamebearerProfileV1Groups) MarshalJSON

func (s FlamebearerProfileV1Groups) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerProfileV1Groups) SetFake

func (s *FlamebearerProfileV1Groups) SetFake()

SetFake set fake values.

func (*FlamebearerProfileV1Groups) UnmarshalJSON

func (s *FlamebearerProfileV1Groups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (FlamebearerProfileV1Groups) Validate

func (s FlamebearerProfileV1Groups) Validate() error

type FlamebearerTimelineV1

type FlamebearerTimelineV1 struct {
	// Time at which the timeline starts, as a Unix timestamp.
	StartTime int64 `json:"startTime"`
	// A sequence of samples starting at startTime, spaced by durationDelta seconds.
	Samples []uint64 `json:"samples"`
	// Time delta between samples, in seconds.
	DurationDelta int64                              `json:"durationDelta"`
	Watermarks    OptFlamebearerTimelineV1Watermarks `json:"watermarks"`
}

Ref: #/components/schemas/FlamebearerTimelineV1

func (*FlamebearerTimelineV1) Decode

func (s *FlamebearerTimelineV1) Decode(d *jx.Decoder) error

Decode decodes FlamebearerTimelineV1 from json.

func (*FlamebearerTimelineV1) Encode

func (s *FlamebearerTimelineV1) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FlamebearerTimelineV1) GetDurationDelta

func (s *FlamebearerTimelineV1) GetDurationDelta() int64

GetDurationDelta returns the value of DurationDelta.

func (*FlamebearerTimelineV1) GetSamples

func (s *FlamebearerTimelineV1) GetSamples() []uint64

GetSamples returns the value of Samples.

func (*FlamebearerTimelineV1) GetStartTime

func (s *FlamebearerTimelineV1) GetStartTime() int64

GetStartTime returns the value of StartTime.

func (*FlamebearerTimelineV1) GetWatermarks

GetWatermarks returns the value of Watermarks.

func (*FlamebearerTimelineV1) MarshalJSON

func (s *FlamebearerTimelineV1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerTimelineV1) SetDurationDelta

func (s *FlamebearerTimelineV1) SetDurationDelta(val int64)

SetDurationDelta sets the value of DurationDelta.

func (*FlamebearerTimelineV1) SetFake

func (s *FlamebearerTimelineV1) SetFake()

SetFake set fake values.

func (*FlamebearerTimelineV1) SetSamples

func (s *FlamebearerTimelineV1) SetSamples(val []uint64)

SetSamples sets the value of Samples.

func (*FlamebearerTimelineV1) SetStartTime

func (s *FlamebearerTimelineV1) SetStartTime(val int64)

SetStartTime sets the value of StartTime.

func (*FlamebearerTimelineV1) SetWatermarks

SetWatermarks sets the value of Watermarks.

func (*FlamebearerTimelineV1) UnmarshalJSON

func (s *FlamebearerTimelineV1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FlamebearerTimelineV1) Validate

func (s *FlamebearerTimelineV1) Validate() error

type FlamebearerTimelineV1Watermarks

type FlamebearerTimelineV1Watermarks map[string]int64

func (*FlamebearerTimelineV1Watermarks) Decode

Decode decodes FlamebearerTimelineV1Watermarks from json.

func (FlamebearerTimelineV1Watermarks) Encode

Encode implements json.Marshaler.

func (FlamebearerTimelineV1Watermarks) MarshalJSON

func (s FlamebearerTimelineV1Watermarks) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerTimelineV1Watermarks) SetFake

func (s *FlamebearerTimelineV1Watermarks) SetFake()

SetFake set fake values.

func (*FlamebearerTimelineV1Watermarks) UnmarshalJSON

func (s *FlamebearerTimelineV1Watermarks) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type FlamebearerV1

type FlamebearerV1 struct {
	// Names is the sequence of symbol names.
	Names []string `json:"names"`
	// Levels contains the flamebearer nodes. Each level represents a row in the flamegraph.
	// For each row / level, there's a sequence of values. These values are grouped in chunks
	// which size depend on the flamebearer format: 4 for "single", 7 for "double".
	// For "single" format, each chunk has the following data:
	// i+0 = x offset (prefix sum of the level total values), delta encoded.
	// i+1 = total samples (including the samples in its children nodes).
	// i+2 = self samples (excluding the samples in its children nodes).
	// i+3 = index in names array
	// For "double" format, each chunk has the following data:
	// i+0 = x offset (prefix sum of the level total values), delta encoded, base / left tree.
	// i+1 = total samples (including the samples in its children nodes)   , base / left tree.
	// i+2 = self samples (excluding the samples in its children nodes)    , base / left tree.
	// i+3 = x offset (prefix sum of the level total values), delta encoded, diff / right tree.
	// i+4 = total samples (including the samples in its children nodes)   , diff / right tree.
	// i+5 = self samples (excluding the samples in its children nodes)    , diff / right tree.
	// i+6 = index in the names array.
	Levels   [][]int `json:"levels"`
	NumTicks int     `json:"numTicks"`
	MaxSelf  int     `json:"maxSelf"`
}

Ref: #/components/schemas/FlamebearerV1

func (*FlamebearerV1) Decode

func (s *FlamebearerV1) Decode(d *jx.Decoder) error

Decode decodes FlamebearerV1 from json.

func (*FlamebearerV1) Encode

func (s *FlamebearerV1) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*FlamebearerV1) GetLevels

func (s *FlamebearerV1) GetLevels() [][]int

GetLevels returns the value of Levels.

func (*FlamebearerV1) GetMaxSelf

func (s *FlamebearerV1) GetMaxSelf() int

GetMaxSelf returns the value of MaxSelf.

func (*FlamebearerV1) GetNames

func (s *FlamebearerV1) GetNames() []string

GetNames returns the value of Names.

func (*FlamebearerV1) GetNumTicks

func (s *FlamebearerV1) GetNumTicks() int

GetNumTicks returns the value of NumTicks.

func (*FlamebearerV1) MarshalJSON

func (s *FlamebearerV1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*FlamebearerV1) SetFake

func (s *FlamebearerV1) SetFake()

SetFake set fake values.

func (*FlamebearerV1) SetLevels

func (s *FlamebearerV1) SetLevels(val [][]int)

SetLevels sets the value of Levels.

func (*FlamebearerV1) SetMaxSelf

func (s *FlamebearerV1) SetMaxSelf(val int)

SetMaxSelf sets the value of MaxSelf.

func (*FlamebearerV1) SetNames

func (s *FlamebearerV1) SetNames(val []string)

SetNames sets the value of Names.

func (*FlamebearerV1) SetNumTicks

func (s *FlamebearerV1) SetNumTicks(val int)

SetNumTicks sets the value of NumTicks.

func (*FlamebearerV1) UnmarshalJSON

func (s *FlamebearerV1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*FlamebearerV1) Validate

func (s *FlamebearerV1) Validate() error

type Handler

type Handler interface {
	// GetApps implements getApps operation.
	//
	// Returns list of application metadata.
	// Used by Grafana to test connection to Pyroscope.
	//
	// GET /api/apps
	GetApps(ctx context.Context) ([]ApplicationMetadata, error)
	// Ingest implements ingest operation.
	//
	// Push data to Pyroscope.
	//
	// POST /ingest
	Ingest(ctx context.Context, req *IngestReqWithContentType, params IngestParams) error
	// LabelValues implements labelValues operation.
	//
	// Returns list of label values.
	//
	// GET /label-values
	LabelValues(ctx context.Context, params LabelValuesParams) (LabelValues, error)
	// Labels implements labels operation.
	//
	// Returns list of labels.
	//
	// GET /labels
	Labels(ctx context.Context, params LabelsParams) (Labels, error)
	// Render implements render operation.
	//
	// Renders given query.
	// One of `query` or `key` is required.
	//
	// GET /render
	Render(ctx context.Context, params RenderParams) (*FlamebearerProfileV1, error)
	// NewError creates *ErrorStatusCode from error returned by handler.
	//
	// Used for common default response.
	NewError(ctx context.Context, err error) *ErrorStatusCode
}

Handler handles operations described by OpenAPI v3 specification.

type Heatmap

type Heatmap struct {
	// Values matrix contain values that indicate count of value occurrences,
	// satisfying boundaries of X and Y bins: [StartTime:EndTime) and (MinValue:MaxValue].
	// A value can be accessed via Values[x][y], where:
	// 0 <= x < TimeBuckets, and
	// 0 <= y < ValueBuckets.
	Values [][]uint64 `json:"values"`
	// TimeBuckets denote number of bins on X axis.
	// Length of Values array.
	TimeBuckets OptInt64 `json:"timeBuckets"`
	// ValueBuckets denote number of bins on Y axis.
	// Length of any item in the Values array.
	ValueBuckets OptInt64 `json:"valueBuckets"`
	// StartTime and EndTime indicate boundaries of X axis: [StartTime:EndTime).
	StartTime OptInt64 `json:"startTime"`
	EndTime   OptInt64 `json:"endTime"`
	// MinValue and MaxValue indicate boundaries of Y axis: (MinValue:MaxValue].
	MinValue OptUint64 `json:"minValue"`
	MaxValue OptUint64 `json:"maxValue"`
	// MinDepth and MaxDepth indicate boundaries of Z axis: [MinDepth:MaxDepth].
	// MinDepth is the minimal non-zero value that can be found in Values.
	MinDepth OptUint64 `json:"minDepth"`
	MaxDepth OptUint64 `json:"maxDepth"`
}

Ref: #/components/schemas/Heatmap

func (*Heatmap) Decode

func (s *Heatmap) Decode(d *jx.Decoder) error

Decode decodes Heatmap from json.

func (*Heatmap) Encode

func (s *Heatmap) Encode(e *jx.Encoder)

Encode implements json.Marshaler.

func (*Heatmap) GetEndTime

func (s *Heatmap) GetEndTime() OptInt64

GetEndTime returns the value of EndTime.

func (*Heatmap) GetMaxDepth

func (s *Heatmap) GetMaxDepth() OptUint64

GetMaxDepth returns the value of MaxDepth.

func (*Heatmap) GetMaxValue

func (s *Heatmap) GetMaxValue() OptUint64

GetMaxValue returns the value of MaxValue.

func (*Heatmap) GetMinDepth

func (s *Heatmap) GetMinDepth() OptUint64

GetMinDepth returns the value of MinDepth.

func (*Heatmap) GetMinValue

func (s *Heatmap) GetMinValue() OptUint64

GetMinValue returns the value of MinValue.

func (*Heatmap) GetStartTime

func (s *Heatmap) GetStartTime() OptInt64

GetStartTime returns the value of StartTime.

func (*Heatmap) GetTimeBuckets

func (s *Heatmap) GetTimeBuckets() OptInt64

GetTimeBuckets returns the value of TimeBuckets.

func (*Heatmap) GetValueBuckets

func (s *Heatmap) GetValueBuckets() OptInt64

GetValueBuckets returns the value of ValueBuckets.

func (*Heatmap) GetValues

func (s *Heatmap) GetValues() [][]uint64

GetValues returns the value of Values.

func (*Heatmap) MarshalJSON

func (s *Heatmap) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Heatmap) SetEndTime

func (s *Heatmap) SetEndTime(val OptInt64)

SetEndTime sets the value of EndTime.

func (*Heatmap) SetFake

func (s *Heatmap) SetFake()

SetFake set fake values.

func (*Heatmap) SetMaxDepth

func (s *Heatmap) SetMaxDepth(val OptUint64)

SetMaxDepth sets the value of MaxDepth.

func (*Heatmap) SetMaxValue

func (s *Heatmap) SetMaxValue(val OptUint64)

SetMaxValue sets the value of MaxValue.

func (*Heatmap) SetMinDepth

func (s *Heatmap) SetMinDepth(val OptUint64)

SetMinDepth sets the value of MinDepth.

func (*Heatmap) SetMinValue

func (s *Heatmap) SetMinValue(val OptUint64)

SetMinValue sets the value of MinValue.

func (*Heatmap) SetStartTime

func (s *Heatmap) SetStartTime(val OptInt64)

SetStartTime sets the value of StartTime.

func (*Heatmap) SetTimeBuckets

func (s *Heatmap) SetTimeBuckets(val OptInt64)

SetTimeBuckets sets the value of TimeBuckets.

func (*Heatmap) SetValueBuckets

func (s *Heatmap) SetValueBuckets(val OptInt64)

SetValueBuckets sets the value of ValueBuckets.

func (*Heatmap) SetValues

func (s *Heatmap) SetValues(val [][]uint64)

SetValues sets the value of Values.

func (*Heatmap) UnmarshalJSON

func (s *Heatmap) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Heatmap) Validate

func (s *Heatmap) Validate() error

type IngestOK

type IngestOK struct{}

IngestOK is response for Ingest operation.

type IngestParams

type IngestParams struct {
	Name SegmentKey
	// Start of time range in `attime` format.
	// Defaults to now.
	From OptAtTime
	// End of time range in `attime` format.
	// Defaults to now.
	Until OptAtTime
	// Sample rate.
	// Defaults to `100`.
	// NOTE: Pyroscope ignores parameter if it is invalid.
	SampleRate OptUint32
	SpyName    OptString
	// Could be
	// - `samples`
	// - `objects`
	// - `goroutines`
	// - `bytes`
	// - `lock_nanoseconds`
	// - `lock_samples`
	// but Pyroscope does not check it, so we don't either.
	Units OptString
	// Could be
	// - `average`
	// - `sum`
	// but Pyroscope does not check it, so we don't either.
	AggregationType OptString
	// Input format.
	Format OptString
}

IngestParams is parameters of ingest operation.

type IngestReq

type IngestReq struct {
	Data io.Reader
}

func (IngestReq) Read

func (s IngestReq) Read(p []byte) (n int, err error)

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type IngestReqWithContentType

type IngestReqWithContentType struct {
	ContentType string
	Content     IngestReq
}

IngestReqWithContentType wraps IngestReq with Content-Type.

func (*IngestReqWithContentType) GetContent

func (s *IngestReqWithContentType) GetContent() IngestReq

GetContent returns the value of Content.

func (*IngestReqWithContentType) GetContentType

func (s *IngestReqWithContentType) GetContentType() string

GetContentType returns the value of ContentType.

func (*IngestReqWithContentType) SetContent

func (s *IngestReqWithContentType) SetContent(val IngestReq)

SetContent sets the value of Content.

func (*IngestReqWithContentType) SetContentType

func (s *IngestReqWithContentType) SetContentType(val string)

SetContentType sets the value of ContentType.

type Invoker added in v0.1.0

type Invoker interface {
	// GetApps invokes getApps operation.
	//
	// Returns list of application metadata.
	// Used by Grafana to test connection to Pyroscope.
	//
	// GET /api/apps
	GetApps(ctx context.Context) ([]ApplicationMetadata, error)
	// Ingest invokes ingest operation.
	//
	// Push data to Pyroscope.
	//
	// POST /ingest
	Ingest(ctx context.Context, request *IngestReqWithContentType, params IngestParams) error
	// LabelValues invokes labelValues operation.
	//
	// Returns list of label values.
	//
	// GET /label-values
	LabelValues(ctx context.Context, params LabelValuesParams) (LabelValues, error)
	// Labels invokes labels operation.
	//
	// Returns list of labels.
	//
	// GET /labels
	Labels(ctx context.Context, params LabelsParams) (Labels, error)
	// Render invokes render operation.
	//
	// Renders given query.
	// One of `query` or `key` is required.
	//
	// GET /render
	Render(ctx context.Context, params RenderParams) (*FlamebearerProfileV1, error)
}

Invoker invokes operations described by OpenAPI v3 specification.

type LabelValues

type LabelValues []string

func (*LabelValues) Decode

func (s *LabelValues) Decode(d *jx.Decoder) error

Decode decodes LabelValues from json.

func (LabelValues) Encode

func (s LabelValues) Encode(e *jx.Encoder)

Encode encodes LabelValues as json.

func (LabelValues) MarshalJSON

func (s LabelValues) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*LabelValues) SetFake

func (s *LabelValues) SetFake()

SetFake set fake values.

func (*LabelValues) UnmarshalJSON

func (s *LabelValues) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (LabelValues) Validate

func (s LabelValues) Validate() error

type LabelValuesParams

type LabelValuesParams struct {
	// Label to lookup values.
	Label string
	// Start of time range in `attime` format.
	// For now, Pyroscope ignores parameter, if `query` is not set.
	From OptAtTime
	// End of time range in `attime` format.
	// For now, Pyroscope ignores parameter, if `query` is not set.
	Until OptAtTime
	// FrameQL query.
	Query OptString
}

LabelValuesParams is parameters of labelValues operation.

type Labels

type Labels []string

func (*Labels) Decode

func (s *Labels) Decode(d *jx.Decoder) error

Decode decodes Labels from json.

func (Labels) Encode

func (s Labels) Encode(e *jx.Encoder)

Encode encodes Labels as json.

func (Labels) MarshalJSON

func (s Labels) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (*Labels) SetFake

func (s *Labels) SetFake()

SetFake set fake values.

func (*Labels) UnmarshalJSON

func (s *Labels) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

func (Labels) Validate

func (s Labels) Validate() error

type LabelsParams

type LabelsParams struct {
	// Start of time range in `attime` format.
	// For now, Pyroscope ignores parameter, if `query` is not set.
	From OptAtTime
	// End of time range in `attime` format.
	// For now, Pyroscope ignores parameter, if `query` is not set.
	Until OptAtTime
	// FrameQL query.
	Query OptString
}

LabelsParams is parameters of labels operation.

type Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OptApplicationMetadataUnits

type OptApplicationMetadataUnits struct {
	Value ApplicationMetadataUnits
	Set   bool
}

OptApplicationMetadataUnits is optional ApplicationMetadataUnits.

func NewOptApplicationMetadataUnits

func NewOptApplicationMetadataUnits(v ApplicationMetadataUnits) OptApplicationMetadataUnits

NewOptApplicationMetadataUnits returns new OptApplicationMetadataUnits with value set to v.

func (*OptApplicationMetadataUnits) Decode

Decode decodes ApplicationMetadataUnits from json.

func (OptApplicationMetadataUnits) Encode

func (o OptApplicationMetadataUnits) Encode(e *jx.Encoder)

Encode encodes ApplicationMetadataUnits as json.

func (OptApplicationMetadataUnits) Get

Get returns value and boolean that denotes whether value was set.

func (OptApplicationMetadataUnits) IsSet

IsSet returns true if OptApplicationMetadataUnits was set.

func (OptApplicationMetadataUnits) MarshalJSON

func (s OptApplicationMetadataUnits) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptApplicationMetadataUnits) Or

Or returns value if set, or given parameter if does not.

func (*OptApplicationMetadataUnits) Reset

func (o *OptApplicationMetadataUnits) Reset()

Reset unsets value.

func (*OptApplicationMetadataUnits) SetFake

func (s *OptApplicationMetadataUnits) SetFake()

SetFake set fake values.

func (*OptApplicationMetadataUnits) SetTo

SetTo sets value to v.

func (*OptApplicationMetadataUnits) UnmarshalJSON

func (s *OptApplicationMetadataUnits) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptAtTime

type OptAtTime struct {
	Value AtTime
	Set   bool
}

OptAtTime is optional AtTime.

func NewOptAtTime

func NewOptAtTime(v AtTime) OptAtTime

NewOptAtTime returns new OptAtTime with value set to v.

func (OptAtTime) Get

func (o OptAtTime) Get() (v AtTime, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptAtTime) IsSet

func (o OptAtTime) IsSet() bool

IsSet returns true if OptAtTime was set.

func (OptAtTime) Or

func (o OptAtTime) Or(d AtTime) AtTime

Or returns value if set, or given parameter if does not.

func (*OptAtTime) Reset

func (o *OptAtTime) Reset()

Reset unsets value.

func (*OptAtTime) SetTo

func (o *OptAtTime) SetTo(v AtTime)

SetTo sets value to v.

type OptFlamebearerMetadataV1Units

type OptFlamebearerMetadataV1Units struct {
	Value FlamebearerMetadataV1Units
	Set   bool
}

OptFlamebearerMetadataV1Units is optional FlamebearerMetadataV1Units.

func NewOptFlamebearerMetadataV1Units

func NewOptFlamebearerMetadataV1Units(v FlamebearerMetadataV1Units) OptFlamebearerMetadataV1Units

NewOptFlamebearerMetadataV1Units returns new OptFlamebearerMetadataV1Units with value set to v.

func (*OptFlamebearerMetadataV1Units) Decode

Decode decodes FlamebearerMetadataV1Units from json.

func (OptFlamebearerMetadataV1Units) Encode

Encode encodes FlamebearerMetadataV1Units as json.

func (OptFlamebearerMetadataV1Units) Get

Get returns value and boolean that denotes whether value was set.

func (OptFlamebearerMetadataV1Units) IsSet

IsSet returns true if OptFlamebearerMetadataV1Units was set.

func (OptFlamebearerMetadataV1Units) MarshalJSON

func (s OptFlamebearerMetadataV1Units) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFlamebearerMetadataV1Units) Or

Or returns value if set, or given parameter if does not.

func (*OptFlamebearerMetadataV1Units) Reset

func (o *OptFlamebearerMetadataV1Units) Reset()

Reset unsets value.

func (*OptFlamebearerMetadataV1Units) SetFake

func (s *OptFlamebearerMetadataV1Units) SetFake()

SetFake set fake values.

func (*OptFlamebearerMetadataV1Units) SetTo

SetTo sets value to v.

func (*OptFlamebearerMetadataV1Units) UnmarshalJSON

func (s *OptFlamebearerMetadataV1Units) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFlamebearerProfileV1Groups

type OptFlamebearerProfileV1Groups struct {
	Value FlamebearerProfileV1Groups
	Set   bool
}

OptFlamebearerProfileV1Groups is optional FlamebearerProfileV1Groups.

func NewOptFlamebearerProfileV1Groups

func NewOptFlamebearerProfileV1Groups(v FlamebearerProfileV1Groups) OptFlamebearerProfileV1Groups

NewOptFlamebearerProfileV1Groups returns new OptFlamebearerProfileV1Groups with value set to v.

func (*OptFlamebearerProfileV1Groups) Decode

Decode decodes FlamebearerProfileV1Groups from json.

func (OptFlamebearerProfileV1Groups) Encode

Encode encodes FlamebearerProfileV1Groups as json.

func (OptFlamebearerProfileV1Groups) Get

Get returns value and boolean that denotes whether value was set.

func (OptFlamebearerProfileV1Groups) IsSet

IsSet returns true if OptFlamebearerProfileV1Groups was set.

func (OptFlamebearerProfileV1Groups) MarshalJSON

func (s OptFlamebearerProfileV1Groups) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFlamebearerProfileV1Groups) Or

Or returns value if set, or given parameter if does not.

func (*OptFlamebearerProfileV1Groups) Reset

func (o *OptFlamebearerProfileV1Groups) Reset()

Reset unsets value.

func (*OptFlamebearerProfileV1Groups) SetFake

func (s *OptFlamebearerProfileV1Groups) SetFake()

SetFake set fake values.

func (*OptFlamebearerProfileV1Groups) SetTo

SetTo sets value to v.

func (*OptFlamebearerProfileV1Groups) UnmarshalJSON

func (s *OptFlamebearerProfileV1Groups) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFlamebearerTimelineV1

type OptFlamebearerTimelineV1 struct {
	Value FlamebearerTimelineV1
	Set   bool
}

OptFlamebearerTimelineV1 is optional FlamebearerTimelineV1.

func NewOptFlamebearerTimelineV1

func NewOptFlamebearerTimelineV1(v FlamebearerTimelineV1) OptFlamebearerTimelineV1

NewOptFlamebearerTimelineV1 returns new OptFlamebearerTimelineV1 with value set to v.

func (*OptFlamebearerTimelineV1) Decode

func (o *OptFlamebearerTimelineV1) Decode(d *jx.Decoder) error

Decode decodes FlamebearerTimelineV1 from json.

func (OptFlamebearerTimelineV1) Encode

func (o OptFlamebearerTimelineV1) Encode(e *jx.Encoder)

Encode encodes FlamebearerTimelineV1 as json.

func (OptFlamebearerTimelineV1) Get

Get returns value and boolean that denotes whether value was set.

func (OptFlamebearerTimelineV1) IsSet

func (o OptFlamebearerTimelineV1) IsSet() bool

IsSet returns true if OptFlamebearerTimelineV1 was set.

func (OptFlamebearerTimelineV1) MarshalJSON

func (s OptFlamebearerTimelineV1) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFlamebearerTimelineV1) Or

Or returns value if set, or given parameter if does not.

func (*OptFlamebearerTimelineV1) Reset

func (o *OptFlamebearerTimelineV1) Reset()

Reset unsets value.

func (*OptFlamebearerTimelineV1) SetFake

func (s *OptFlamebearerTimelineV1) SetFake()

SetFake set fake values.

func (*OptFlamebearerTimelineV1) SetTo

SetTo sets value to v.

func (*OptFlamebearerTimelineV1) UnmarshalJSON

func (s *OptFlamebearerTimelineV1) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptFlamebearerTimelineV1Watermarks

type OptFlamebearerTimelineV1Watermarks struct {
	Value FlamebearerTimelineV1Watermarks
	Set   bool
}

OptFlamebearerTimelineV1Watermarks is optional FlamebearerTimelineV1Watermarks.

func NewOptFlamebearerTimelineV1Watermarks

func NewOptFlamebearerTimelineV1Watermarks(v FlamebearerTimelineV1Watermarks) OptFlamebearerTimelineV1Watermarks

NewOptFlamebearerTimelineV1Watermarks returns new OptFlamebearerTimelineV1Watermarks with value set to v.

func (*OptFlamebearerTimelineV1Watermarks) Decode

Decode decodes FlamebearerTimelineV1Watermarks from json.

func (OptFlamebearerTimelineV1Watermarks) Encode

Encode encodes FlamebearerTimelineV1Watermarks as json.

func (OptFlamebearerTimelineV1Watermarks) Get

Get returns value and boolean that denotes whether value was set.

func (OptFlamebearerTimelineV1Watermarks) IsSet

IsSet returns true if OptFlamebearerTimelineV1Watermarks was set.

func (OptFlamebearerTimelineV1Watermarks) MarshalJSON

func (s OptFlamebearerTimelineV1Watermarks) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptFlamebearerTimelineV1Watermarks) Or

Or returns value if set, or given parameter if does not.

func (*OptFlamebearerTimelineV1Watermarks) Reset

Reset unsets value.

func (*OptFlamebearerTimelineV1Watermarks) SetFake

SetFake set fake values.

func (*OptFlamebearerTimelineV1Watermarks) SetTo

SetTo sets value to v.

func (*OptFlamebearerTimelineV1Watermarks) UnmarshalJSON

func (s *OptFlamebearerTimelineV1Watermarks) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptInt

type OptInt struct {
	Value int
	Set   bool
}

OptInt is optional int.

func NewOptInt

func NewOptInt(v int) OptInt

NewOptInt returns new OptInt with value set to v.

func (OptInt) Get

func (o OptInt) Get() (v int, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt) IsSet

func (o OptInt) IsSet() bool

IsSet returns true if OptInt was set.

func (OptInt) Or

func (o OptInt) Or(d int) int

Or returns value if set, or given parameter if does not.

func (*OptInt) Reset

func (o *OptInt) Reset()

Reset unsets value.

func (*OptInt) SetTo

func (o *OptInt) SetTo(v int)

SetTo sets value to v.

type OptInt64

type OptInt64 struct {
	Value int64
	Set   bool
}

OptInt64 is optional int64.

func NewOptInt64

func NewOptInt64(v int64) OptInt64

NewOptInt64 returns new OptInt64 with value set to v.

func (*OptInt64) Decode

func (o *OptInt64) Decode(d *jx.Decoder) error

Decode decodes int64 from json.

func (OptInt64) Encode

func (o OptInt64) Encode(e *jx.Encoder)

Encode encodes int64 as json.

func (OptInt64) Get

func (o OptInt64) Get() (v int64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptInt64) IsSet

func (o OptInt64) IsSet() bool

IsSet returns true if OptInt64 was set.

func (OptInt64) MarshalJSON

func (s OptInt64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptInt64) Or

func (o OptInt64) Or(d int64) int64

Or returns value if set, or given parameter if does not.

func (*OptInt64) Reset

func (o *OptInt64) Reset()

Reset unsets value.

func (*OptInt64) SetFake

func (s *OptInt64) SetFake()

SetFake set fake values.

func (*OptInt64) SetTo

func (o *OptInt64) SetTo(v int64)

SetTo sets value to v.

func (*OptInt64) UnmarshalJSON

func (s *OptInt64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptNilHeatmap

type OptNilHeatmap struct {
	Value Heatmap
	Set   bool
	Null  bool
}

OptNilHeatmap is optional nullable Heatmap.

func NewOptNilHeatmap

func NewOptNilHeatmap(v Heatmap) OptNilHeatmap

NewOptNilHeatmap returns new OptNilHeatmap with value set to v.

func (*OptNilHeatmap) Decode

func (o *OptNilHeatmap) Decode(d *jx.Decoder) error

Decode decodes Heatmap from json.

func (OptNilHeatmap) Encode

func (o OptNilHeatmap) Encode(e *jx.Encoder)

Encode encodes Heatmap as json.

func (OptNilHeatmap) Get

func (o OptNilHeatmap) Get() (v Heatmap, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptNilHeatmap) IsNull

func (o OptNilHeatmap) IsNull() bool

IsSet returns true if value is Null.

func (OptNilHeatmap) IsSet

func (o OptNilHeatmap) IsSet() bool

IsSet returns true if OptNilHeatmap was set.

func (OptNilHeatmap) MarshalJSON

func (s OptNilHeatmap) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptNilHeatmap) Or

func (o OptNilHeatmap) Or(d Heatmap) Heatmap

Or returns value if set, or given parameter if does not.

func (*OptNilHeatmap) Reset

func (o *OptNilHeatmap) Reset()

Reset unsets value.

func (*OptNilHeatmap) SetFake

func (s *OptNilHeatmap) SetFake()

SetFake set fake values.

func (*OptNilHeatmap) SetTo

func (o *OptNilHeatmap) SetTo(v Heatmap)

SetTo sets value to v.

func (*OptNilHeatmap) SetToNull

func (o *OptNilHeatmap) SetToNull()

SetNull sets value to null.

func (*OptNilHeatmap) UnmarshalJSON

func (s *OptNilHeatmap) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptSegmentKey

type OptSegmentKey struct {
	Value SegmentKey
	Set   bool
}

OptSegmentKey is optional SegmentKey.

func NewOptSegmentKey

func NewOptSegmentKey(v SegmentKey) OptSegmentKey

NewOptSegmentKey returns new OptSegmentKey with value set to v.

func (OptSegmentKey) Get

func (o OptSegmentKey) Get() (v SegmentKey, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptSegmentKey) IsSet

func (o OptSegmentKey) IsSet() bool

IsSet returns true if OptSegmentKey was set.

func (OptSegmentKey) Or

Or returns value if set, or given parameter if does not.

func (*OptSegmentKey) Reset

func (o *OptSegmentKey) Reset()

Reset unsets value.

func (*OptSegmentKey) SetTo

func (o *OptSegmentKey) SetTo(v SegmentKey)

SetTo sets value to v.

type OptString

type OptString struct {
	Value string
	Set   bool
}

OptString is optional string.

func NewOptString

func NewOptString(v string) OptString

NewOptString returns new OptString with value set to v.

func (*OptString) Decode

func (o *OptString) Decode(d *jx.Decoder) error

Decode decodes string from json.

func (OptString) Encode

func (o OptString) Encode(e *jx.Encoder)

Encode encodes string as json.

func (OptString) Get

func (o OptString) Get() (v string, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptString) IsSet

func (o OptString) IsSet() bool

IsSet returns true if OptString was set.

func (OptString) MarshalJSON

func (s OptString) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptString) Or

func (o OptString) Or(d string) string

Or returns value if set, or given parameter if does not.

func (*OptString) Reset

func (o *OptString) Reset()

Reset unsets value.

func (*OptString) SetFake

func (s *OptString) SetFake()

SetFake set fake values.

func (*OptString) SetTo

func (o *OptString) SetTo(v string)

SetTo sets value to v.

func (*OptString) UnmarshalJSON

func (s *OptString) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptUint32

type OptUint32 struct {
	Value uint32
	Set   bool
}

OptUint32 is optional uint32.

func NewOptUint32

func NewOptUint32(v uint32) OptUint32

NewOptUint32 returns new OptUint32 with value set to v.

func (*OptUint32) Decode

func (o *OptUint32) Decode(d *jx.Decoder) error

Decode decodes uint32 from json.

func (OptUint32) Encode

func (o OptUint32) Encode(e *jx.Encoder)

Encode encodes uint32 as json.

func (OptUint32) Get

func (o OptUint32) Get() (v uint32, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptUint32) IsSet

func (o OptUint32) IsSet() bool

IsSet returns true if OptUint32 was set.

func (OptUint32) MarshalJSON

func (s OptUint32) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptUint32) Or

func (o OptUint32) Or(d uint32) uint32

Or returns value if set, or given parameter if does not.

func (*OptUint32) Reset

func (o *OptUint32) Reset()

Reset unsets value.

func (*OptUint32) SetFake

func (s *OptUint32) SetFake()

SetFake set fake values.

func (*OptUint32) SetTo

func (o *OptUint32) SetTo(v uint32)

SetTo sets value to v.

func (*OptUint32) UnmarshalJSON

func (s *OptUint32) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type OptUint64

type OptUint64 struct {
	Value uint64
	Set   bool
}

OptUint64 is optional uint64.

func NewOptUint64

func NewOptUint64(v uint64) OptUint64

NewOptUint64 returns new OptUint64 with value set to v.

func (*OptUint64) Decode

func (o *OptUint64) Decode(d *jx.Decoder) error

Decode decodes uint64 from json.

func (OptUint64) Encode

func (o OptUint64) Encode(e *jx.Encoder)

Encode encodes uint64 as json.

func (OptUint64) Get

func (o OptUint64) Get() (v uint64, ok bool)

Get returns value and boolean that denotes whether value was set.

func (OptUint64) IsSet

func (o OptUint64) IsSet() bool

IsSet returns true if OptUint64 was set.

func (OptUint64) MarshalJSON

func (s OptUint64) MarshalJSON() ([]byte, error)

MarshalJSON implements stdjson.Marshaler.

func (OptUint64) Or

func (o OptUint64) Or(d uint64) uint64

Or returns value if set, or given parameter if does not.

func (*OptUint64) Reset

func (o *OptUint64) Reset()

Reset unsets value.

func (*OptUint64) SetFake

func (s *OptUint64) SetFake()

SetFake set fake values.

func (*OptUint64) SetTo

func (o *OptUint64) SetTo(v uint64)

SetTo sets value to v.

func (*OptUint64) UnmarshalJSON

func (s *OptUint64) UnmarshalJSON(data []byte) error

UnmarshalJSON implements stdjson.Unmarshaler.

type Option

type Option interface {
	ServerOption
	ClientOption
}

Option is config option.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider specifies a meter provider to use for creating a meter.

If none is specified, the otel.GetMeterProvider() is used.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer.

If none is specified, the global provider is used.

type RenderFormat

type RenderFormat string
const (
	RenderFormatJSON      RenderFormat = "json"
	RenderFormatPprof     RenderFormat = "pprof"
	RenderFormatCollapsed RenderFormat = "collapsed"
	RenderFormatHTML      RenderFormat = "html"
)

func (RenderFormat) AllValues added in v0.1.0

func (RenderFormat) AllValues() []RenderFormat

AllValues returns all RenderFormat values.

func (RenderFormat) MarshalText

func (s RenderFormat) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*RenderFormat) UnmarshalText

func (s *RenderFormat) UnmarshalText(data []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

func (RenderFormat) Validate

func (s RenderFormat) Validate() error

type RenderParams

type RenderParams struct {
	// Start of time range in `attime` format.
	From OptAtTime
	// End of time range in `attime` format.
	Until OptAtTime
	// FrameQL query.
	Query    OptString
	Name     OptSegmentKey
	GroupBy  OptString
	MaxNodes OptInt
	// Response format.
	Format RenderFormat
}

RenderParams is parameters of render operation.

type Route

type Route struct {
	// contains filtered or unexported fields
}

Route is route object.

func (Route) Args

func (r Route) Args() []string

Args returns parsed arguments.

func (Route) Name

func (r Route) Name() string

Name returns ogen operation name.

It is guaranteed to be unique and not empty.

func (Route) OperationID

func (r Route) OperationID() string

OperationID returns OpenAPI operationId.

func (Route) PathPattern

func (r Route) PathPattern() string

PathPattern returns OpenAPI path.

func (Route) Summary added in v0.1.0

func (r Route) Summary() string

Summary returns OpenAPI summary.

type SegmentKey

type SegmentKey string

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements http server based on OpenAPI v3 specification and calls Handler to handle requests.

func NewServer

func NewServer(h Handler, opts ...ServerOption) (*Server, error)

NewServer creates new Server.

func (*Server) FindPath

func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool)

FindPath finds Route for given method and URL.

func (*Server) FindRoute

func (s *Server) FindRoute(method, path string) (Route, bool)

FindRoute finds Route for given method and path.

Note: this method does not unescape path or handle reserved characters in path properly. Use FindPath instead.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves http request as defined by OpenAPI v3 specification, calling handler that matches the path or returning not found error.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

ServerOption is server config option.

func WithErrorHandler

func WithErrorHandler(h ErrorHandler) ServerOption

WithErrorHandler specifies error handler to use.

func WithMaxMultipartMemory

func WithMaxMultipartMemory(max int64) ServerOption

WithMaxMultipartMemory specifies limit of memory for storing file parts. File parts which can't be stored in memory will be stored on disk in temporary files.

func WithMethodNotAllowed

func WithMethodNotAllowed(methodNotAllowed func(w http.ResponseWriter, r *http.Request, allowed string)) ServerOption

WithMethodNotAllowed specifies Method Not Allowed handler to use.

func WithMiddleware

func WithMiddleware(m ...Middleware) ServerOption

WithMiddleware specifies middlewares to use.

func WithNotFound

func WithNotFound(notFound http.HandlerFunc) ServerOption

WithNotFound specifies Not Found handler to use.

func WithPathPrefix

func WithPathPrefix(prefix string) ServerOption

WithPathPrefix specifies server path prefix.

type UnimplementedHandler

type UnimplementedHandler struct{}

UnimplementedHandler is no-op Handler which returns http.ErrNotImplemented.

func (UnimplementedHandler) GetApps

GetApps implements getApps operation.

Returns list of application metadata. Used by Grafana to test connection to Pyroscope.

GET /api/apps

func (UnimplementedHandler) Ingest

Ingest implements ingest operation.

Push data to Pyroscope.

POST /ingest

func (UnimplementedHandler) LabelValues

func (UnimplementedHandler) LabelValues(ctx context.Context, params LabelValuesParams) (r LabelValues, _ error)

LabelValues implements labelValues operation.

Returns list of label values.

GET /label-values

func (UnimplementedHandler) Labels

func (UnimplementedHandler) Labels(ctx context.Context, params LabelsParams) (r Labels, _ error)

Labels implements labels operation.

Returns list of labels.

GET /labels

func (UnimplementedHandler) NewError

func (UnimplementedHandler) NewError(ctx context.Context, err error) (r *ErrorStatusCode)

NewError creates *ErrorStatusCode from error returned by handler.

Used for common default response.

func (UnimplementedHandler) Render

Render implements render operation.

Renders given query. One of `query` or `key` is required.

GET /render

Jump to

Keyboard shortcuts

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