ytqueryapi

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 27 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 AbortQueryParams

type AbortQueryParams struct {
	// Query ID to get.
	QueryID QueryID
	// Stage.
	Stage OptString
}

AbortQueryParams is parameters of abortQuery operation.

type AbortedQuery

type AbortedQuery struct{}

Ref: #/components/schemas/AbortedQuery

func (*AbortedQuery) Decode

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

Decode decodes AbortedQuery from json.

func (*AbortedQuery) Encode

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

Encode implements json.Marshaler.

func (*AbortedQuery) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*AbortedQuery) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Attributes

type Attributes struct {
	Host         OptString   `json:"host"`
	Pid          OptUint64   `json:"pid"`
	Tid          OptUint64   `json:"tid"`
	Thread       OptString   `json:"thread"`
	Fid          OptUint64   `json:"fid"`
	Datetime     OptDateTime `json:"datetime"`
	TraceID      OptString   `json:"trace_id"`
	SpanID       OptUint64   `json:"span_id"`
	ConnectionID OptString   `json:"connection_id"`
	RealmID      OptString   `json:"realm_id"`
	Method       OptString   `json:"method"`
	RequestID    OptString   `json:"request_id"`
	Timeout      OptInt      `json:"timeout"`
	Address      OptString   `json:"address"`
	Service      OptString   `json:"service"`
}

Ref: #/components/schemas/Attributes

func (*Attributes) Decode

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

Decode decodes Attributes from json.

func (*Attributes) Encode

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

Encode implements json.Marshaler.

func (*Attributes) GetAddress

func (s *Attributes) GetAddress() OptString

GetAddress returns the value of Address.

func (*Attributes) GetConnectionID

func (s *Attributes) GetConnectionID() OptString

GetConnectionID returns the value of ConnectionID.

func (*Attributes) GetDatetime

func (s *Attributes) GetDatetime() OptDateTime

GetDatetime returns the value of Datetime.

func (*Attributes) GetFid

func (s *Attributes) GetFid() OptUint64

GetFid returns the value of Fid.

func (*Attributes) GetHost

func (s *Attributes) GetHost() OptString

GetHost returns the value of Host.

func (*Attributes) GetMethod

func (s *Attributes) GetMethod() OptString

GetMethod returns the value of Method.

func (*Attributes) GetPid

func (s *Attributes) GetPid() OptUint64

GetPid returns the value of Pid.

func (*Attributes) GetRealmID

func (s *Attributes) GetRealmID() OptString

GetRealmID returns the value of RealmID.

func (*Attributes) GetRequestID

func (s *Attributes) GetRequestID() OptString

GetRequestID returns the value of RequestID.

func (*Attributes) GetService

func (s *Attributes) GetService() OptString

GetService returns the value of Service.

func (*Attributes) GetSpanID

func (s *Attributes) GetSpanID() OptUint64

GetSpanID returns the value of SpanID.

func (*Attributes) GetThread

func (s *Attributes) GetThread() OptString

GetThread returns the value of Thread.

func (*Attributes) GetTid

func (s *Attributes) GetTid() OptUint64

GetTid returns the value of Tid.

func (*Attributes) GetTimeout

func (s *Attributes) GetTimeout() OptInt

GetTimeout returns the value of Timeout.

func (*Attributes) GetTraceID

func (s *Attributes) GetTraceID() OptString

GetTraceID returns the value of TraceID.

func (*Attributes) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Attributes) SetAddress

func (s *Attributes) SetAddress(val OptString)

SetAddress sets the value of Address.

func (*Attributes) SetConnectionID

func (s *Attributes) SetConnectionID(val OptString)

SetConnectionID sets the value of ConnectionID.

func (*Attributes) SetDatetime

func (s *Attributes) SetDatetime(val OptDateTime)

SetDatetime sets the value of Datetime.

func (*Attributes) SetFid

func (s *Attributes) SetFid(val OptUint64)

SetFid sets the value of Fid.

func (*Attributes) SetHost

func (s *Attributes) SetHost(val OptString)

SetHost sets the value of Host.

func (*Attributes) SetMethod

func (s *Attributes) SetMethod(val OptString)

SetMethod sets the value of Method.

func (*Attributes) SetPid

func (s *Attributes) SetPid(val OptUint64)

SetPid sets the value of Pid.

func (*Attributes) SetRealmID

func (s *Attributes) SetRealmID(val OptString)

SetRealmID sets the value of RealmID.

func (*Attributes) SetRequestID

func (s *Attributes) SetRequestID(val OptString)

SetRequestID sets the value of RequestID.

func (*Attributes) SetService

func (s *Attributes) SetService(val OptString)

SetService sets the value of Service.

func (*Attributes) SetSpanID

func (s *Attributes) SetSpanID(val OptUint64)

SetSpanID sets the value of SpanID.

func (*Attributes) SetThread

func (s *Attributes) SetThread(val OptString)

SetThread sets the value of Thread.

func (*Attributes) SetTid

func (s *Attributes) SetTid(val OptUint64)

SetTid sets the value of Tid.

func (*Attributes) SetTimeout

func (s *Attributes) SetTimeout(val OptInt)

SetTimeout sets the value of Timeout.

func (*Attributes) SetTraceID

func (s *Attributes) SetTraceID(val OptString)

SetTraceID sets the value of TraceID.

func (*Attributes) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type Client

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

Client implements OAS client.

func NewClient

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

NewClient initializes new Client defined by OAS.

func (*Client) AbortQuery

func (c *Client) AbortQuery(ctx context.Context, params AbortQueryParams) error

AbortQuery invokes abortQuery operation.

Abort running query.

POST /api/v4/abort_query

func (*Client) GetQuery

func (c *Client) GetQuery(ctx context.Context, params GetQueryParams) (*QueryStatus, error)

GetQuery invokes getQuery operation.

Gets query status.

POST /api/v4/get_query

func (*Client) ReadQueryResult

func (c *Client) ReadQueryResult(ctx context.Context, params ReadQueryResultParams) (QueryResult, error)

ReadQueryResult invokes readQueryResult operation.

Read query result.

POST /api/v4/read_query_result

func (*Client) StartQuery

func (c *Client) StartQuery(ctx context.Context, params StartQueryParams) (*StartedQuery, error)

StartQuery invokes startQuery operation.

Start a new query.

POST /api/v4/start_query

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 Engine

type Engine string

Ref: #/components/schemas/Engine

const (
	EngineYql  Engine = "yql"
	EngineQl   Engine = "ql"
	EngineChyt Engine = "chyt"
)

func (*Engine) Decode

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

Decode decodes Engine from json.

func (Engine) Encode

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

Encode encodes Engine as json.

func (Engine) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (Engine) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*Engine) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*Engine) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (Engine) Validate

func (s Engine) Validate() error

type Error

type Error struct {
	Code        int           `json:"code"`
	Message     string        `json:"message"`
	Attributes  OptAttributes `json:"attributes"`
	InnerErrors []Error       `json:"inner_errors"`
}

Ref: #/components/schemas/Error

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 implements json.Marshaler.

func (*Error) GetAttributes

func (s *Error) GetAttributes() OptAttributes

GetAttributes returns the value of Attributes.

func (*Error) GetCode

func (s *Error) GetCode() int

GetCode returns the value of Code.

func (*Error) GetInnerErrors

func (s *Error) GetInnerErrors() []Error

GetInnerErrors returns the value of InnerErrors.

func (*Error) GetMessage

func (s *Error) GetMessage() string

GetMessage returns the value of Message.

func (*Error) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*Error) SetAttributes

func (s *Error) SetAttributes(val OptAttributes)

SetAttributes sets the value of Attributes.

func (*Error) SetCode

func (s *Error) SetCode(val int)

SetCode sets the value of Code.

func (*Error) SetInnerErrors

func (s *Error) SetInnerErrors(val []Error)

SetInnerErrors sets the value of InnerErrors.

func (*Error) SetMessage

func (s *Error) SetMessage(val string)

SetMessage sets the value of Message.

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 GetQueryParams

type GetQueryParams struct {
	// Query ID to get.
	QueryID QueryID
	// Stage.
	Stage OptString
}

GetQueryParams is parameters of getQuery operation.

type Handler

type Handler interface {
	// AbortQuery implements abortQuery operation.
	//
	// Abort running query.
	//
	// POST /api/v4/abort_query
	AbortQuery(ctx context.Context, params AbortQueryParams) error
	// GetQuery implements getQuery operation.
	//
	// Gets query status.
	//
	// POST /api/v4/get_query
	GetQuery(ctx context.Context, params GetQueryParams) (*QueryStatus, error)
	// ReadQueryResult implements readQueryResult operation.
	//
	// Read query result.
	//
	// POST /api/v4/read_query_result
	ReadQueryResult(ctx context.Context, params ReadQueryResultParams) (QueryResult, error)
	// StartQuery implements startQuery operation.
	//
	// Start a new query.
	//
	// POST /api/v4/start_query
	StartQuery(ctx context.Context, params StartQueryParams) (*StartedQuery, 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 Middleware

type Middleware = middleware.Middleware

Middleware is middleware type.

type OperationState

type OperationState string

Ref: #/components/schemas/OperationState

const (
	OperationStateRunning       OperationState = "running"
	OperationStatePending       OperationState = "pending"
	OperationStateCompleted     OperationState = "completed"
	OperationStateFailed        OperationState = "failed"
	OperationStateAborted       OperationState = "aborted"
	OperationStateReviving      OperationState = "reviving"
	OperationStateInitializing  OperationState = "initializing"
	OperationStatePreparing     OperationState = "preparing"
	OperationStateMaterializing OperationState = "materializing"
	OperationStateCompleting    OperationState = "completing"
	OperationStateAborting      OperationState = "aborting"
	OperationStateFailing       OperationState = "failing"
)

func (*OperationState) Decode

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

Decode decodes OperationState from json.

func (OperationState) Encode

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

Encode encodes OperationState as json.

func (OperationState) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OperationState) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*OperationState) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*OperationState) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (OperationState) Validate

func (s OperationState) Validate() error

type OptAttributes

type OptAttributes struct {
	Value Attributes
	Set   bool
}

OptAttributes is optional Attributes.

func NewOptAttributes

func NewOptAttributes(v Attributes) OptAttributes

NewOptAttributes returns new OptAttributes with value set to v.

func (*OptAttributes) Decode

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

Decode decodes Attributes from json.

func (OptAttributes) Encode

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

Encode encodes Attributes as json.

func (OptAttributes) Get

func (o OptAttributes) Get() (v Attributes, ok bool)

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

func (OptAttributes) IsSet

func (o OptAttributes) IsSet() bool

IsSet returns true if OptAttributes was set.

func (OptAttributes) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptAttributes) Or

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

func (*OptAttributes) Reset

func (o *OptAttributes) Reset()

Reset unsets value.

func (*OptAttributes) SetTo

func (o *OptAttributes) SetTo(v Attributes)

SetTo sets value to v.

func (*OptAttributes) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptDateTime

type OptDateTime struct {
	Value time.Time
	Set   bool
}

OptDateTime is optional time.Time.

func NewOptDateTime

func NewOptDateTime(v time.Time) OptDateTime

NewOptDateTime returns new OptDateTime with value set to v.

func (*OptDateTime) Decode

func (o *OptDateTime) Decode(d *jx.Decoder, format func(*jx.Decoder) (time.Time, error)) error

Decode decodes time.Time from json.

func (OptDateTime) Encode

func (o OptDateTime) Encode(e *jx.Encoder, format func(*jx.Encoder, time.Time))

Encode encodes time.Time as json.

func (OptDateTime) Get

func (o OptDateTime) Get() (v time.Time, ok bool)

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

func (OptDateTime) IsSet

func (o OptDateTime) IsSet() bool

IsSet returns true if OptDateTime was set.

func (OptDateTime) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptDateTime) Or

func (o OptDateTime) Or(d time.Time) time.Time

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

func (*OptDateTime) Reset

func (o *OptDateTime) Reset()

Reset unsets value.

func (*OptDateTime) SetTo

func (o *OptDateTime) SetTo(v time.Time)

SetTo sets value to v.

func (*OptDateTime) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptError

type OptError struct {
	Value Error
	Set   bool
}

OptError is optional Error.

func NewOptError

func NewOptError(v Error) OptError

NewOptError returns new OptError with value set to v.

func (*OptError) Decode

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

Decode decodes Error from json.

func (OptError) Encode

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

Encode encodes Error as json.

func (OptError) Get

func (o OptError) Get() (v Error, ok bool)

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

func (OptError) IsSet

func (o OptError) IsSet() bool

IsSet returns true if OptError was set.

func (OptError) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptError) Or

func (o OptError) Or(d Error) Error

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

func (*OptError) Reset

func (o *OptError) Reset()

Reset unsets value.

func (*OptError) SetTo

func (o *OptError) SetTo(v Error)

SetTo sets value to v.

func (*OptError) UnmarshalJSON

func (s *OptError) 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) Decode

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

Decode decodes int from json.

func (OptInt) Encode

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

Encode encodes int as json.

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) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

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.

func (*OptInt) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptQueryStatusAnnotations

type OptQueryStatusAnnotations struct {
	Value QueryStatusAnnotations
	Set   bool
}

OptQueryStatusAnnotations is optional QueryStatusAnnotations.

func NewOptQueryStatusAnnotations

func NewOptQueryStatusAnnotations(v QueryStatusAnnotations) OptQueryStatusAnnotations

NewOptQueryStatusAnnotations returns new OptQueryStatusAnnotations with value set to v.

func (*OptQueryStatusAnnotations) Decode

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

Decode decodes QueryStatusAnnotations from json.

func (OptQueryStatusAnnotations) Encode

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

Encode encodes QueryStatusAnnotations as json.

func (OptQueryStatusAnnotations) Get

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

func (OptQueryStatusAnnotations) IsSet

func (o OptQueryStatusAnnotations) IsSet() bool

IsSet returns true if OptQueryStatusAnnotations was set.

func (OptQueryStatusAnnotations) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptQueryStatusAnnotations) Or

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

func (*OptQueryStatusAnnotations) Reset

func (o *OptQueryStatusAnnotations) Reset()

Reset unsets value.

func (*OptQueryStatusAnnotations) SetTo

SetTo sets value to v.

func (*OptQueryStatusAnnotations) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptQueryStatusProgress

type OptQueryStatusProgress struct {
	Value QueryStatusProgress
	Set   bool
}

OptQueryStatusProgress is optional QueryStatusProgress.

func NewOptQueryStatusProgress

func NewOptQueryStatusProgress(v QueryStatusProgress) OptQueryStatusProgress

NewOptQueryStatusProgress returns new OptQueryStatusProgress with value set to v.

func (*OptQueryStatusProgress) Decode

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

Decode decodes QueryStatusProgress from json.

func (OptQueryStatusProgress) Encode

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

Encode encodes QueryStatusProgress as json.

func (OptQueryStatusProgress) Get

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

func (OptQueryStatusProgress) IsSet

func (o OptQueryStatusProgress) IsSet() bool

IsSet returns true if OptQueryStatusProgress was set.

func (OptQueryStatusProgress) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptQueryStatusProgress) Or

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

func (*OptQueryStatusProgress) Reset

func (o *OptQueryStatusProgress) Reset()

Reset unsets value.

func (*OptQueryStatusProgress) SetTo

SetTo sets value to v.

func (*OptQueryStatusProgress) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type OptQueryStatusSettings

type OptQueryStatusSettings struct {
	Value QueryStatusSettings
	Set   bool
}

OptQueryStatusSettings is optional QueryStatusSettings.

func NewOptQueryStatusSettings

func NewOptQueryStatusSettings(v QueryStatusSettings) OptQueryStatusSettings

NewOptQueryStatusSettings returns new OptQueryStatusSettings with value set to v.

func (*OptQueryStatusSettings) Decode

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

Decode decodes QueryStatusSettings from json.

func (OptQueryStatusSettings) Encode

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

Encode encodes QueryStatusSettings as json.

func (OptQueryStatusSettings) Get

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

func (OptQueryStatusSettings) IsSet

func (o OptQueryStatusSettings) IsSet() bool

IsSet returns true if OptQueryStatusSettings was set.

func (OptQueryStatusSettings) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (OptQueryStatusSettings) Or

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

func (*OptQueryStatusSettings) Reset

func (o *OptQueryStatusSettings) Reset()

Reset unsets value.

func (*OptQueryStatusSettings) SetTo

SetTo sets value to v.

func (*OptQueryStatusSettings) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

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) 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 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) 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 OutputFormat

type OutputFormat string

Ref: #/components/schemas/OutputFormat

const (
	OutputFormatJSON         OutputFormat = "json"
	OutputFormatYson         OutputFormat = "yson"
	OutputFormatDsv          OutputFormat = "dsv"
	OutputFormatSchemafulDsv OutputFormat = "schemaful_dsv"
	OutputFormatProtobuf     OutputFormat = "protobuf"
)

func (OutputFormat) MarshalText

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

MarshalText implements encoding.TextMarshaler.

func (*OutputFormat) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

func (OutputFormat) Validate

func (s OutputFormat) Validate() error

type QueryID

type QueryID string

func (*QueryID) Decode

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

Decode decodes QueryID from json.

func (QueryID) Encode

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

Encode encodes QueryID as json.

func (QueryID) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryID) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type QueryResult

type QueryResult struct {
	Data io.Reader
}

func (QueryResult) Read

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

Read reads data from the Data reader.

Kept to satisfy the io.Reader interface.

type QueryStatus

type QueryStatus struct {
	ID          QueryID                   `json:"id"`
	Engine      Engine                    `json:"engine"`
	StartTime   time.Time                 `json:"start_time"`
	FinishTime  OptDateTime               `json:"finish_time"`
	PingTime    OptDateTime               `json:"ping_time"`
	Settings    OptQueryStatusSettings    `json:"settings"`
	User        OptString                 `json:"user"`
	State       OperationState            `json:"state"`
	ResultCount OptInt                    `json:"result_count"`
	Progress    OptQueryStatusProgress    `json:"progress"`
	Annotations OptQueryStatusAnnotations `json:"annotations"`
	Incarnation OptInt                    `json:"incarnation"`
	Error       OptError                  `json:"error"`
}

Note that error is could be present even if query is successful. Successful query error code is 0. Ref: #/components/schemas/QueryStatus

func (*QueryStatus) Decode

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

Decode decodes QueryStatus from json.

func (*QueryStatus) Encode

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

Encode implements json.Marshaler.

func (*QueryStatus) GetAnnotations

func (s *QueryStatus) GetAnnotations() OptQueryStatusAnnotations

GetAnnotations returns the value of Annotations.

func (*QueryStatus) GetEngine

func (s *QueryStatus) GetEngine() Engine

GetEngine returns the value of Engine.

func (*QueryStatus) GetError

func (s *QueryStatus) GetError() OptError

GetError returns the value of Error.

func (*QueryStatus) GetFinishTime

func (s *QueryStatus) GetFinishTime() OptDateTime

GetFinishTime returns the value of FinishTime.

func (*QueryStatus) GetID

func (s *QueryStatus) GetID() QueryID

GetID returns the value of ID.

func (*QueryStatus) GetIncarnation

func (s *QueryStatus) GetIncarnation() OptInt

GetIncarnation returns the value of Incarnation.

func (*QueryStatus) GetPingTime

func (s *QueryStatus) GetPingTime() OptDateTime

GetPingTime returns the value of PingTime.

func (*QueryStatus) GetProgress

func (s *QueryStatus) GetProgress() OptQueryStatusProgress

GetProgress returns the value of Progress.

func (*QueryStatus) GetResultCount

func (s *QueryStatus) GetResultCount() OptInt

GetResultCount returns the value of ResultCount.

func (*QueryStatus) GetSettings

func (s *QueryStatus) GetSettings() OptQueryStatusSettings

GetSettings returns the value of Settings.

func (*QueryStatus) GetStartTime

func (s *QueryStatus) GetStartTime() time.Time

GetStartTime returns the value of StartTime.

func (*QueryStatus) GetState

func (s *QueryStatus) GetState() OperationState

GetState returns the value of State.

func (*QueryStatus) GetUser

func (s *QueryStatus) GetUser() OptString

GetUser returns the value of User.

func (*QueryStatus) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryStatus) SetAnnotations

func (s *QueryStatus) SetAnnotations(val OptQueryStatusAnnotations)

SetAnnotations sets the value of Annotations.

func (*QueryStatus) SetEngine

func (s *QueryStatus) SetEngine(val Engine)

SetEngine sets the value of Engine.

func (*QueryStatus) SetError

func (s *QueryStatus) SetError(val OptError)

SetError sets the value of Error.

func (*QueryStatus) SetFinishTime

func (s *QueryStatus) SetFinishTime(val OptDateTime)

SetFinishTime sets the value of FinishTime.

func (*QueryStatus) SetID

func (s *QueryStatus) SetID(val QueryID)

SetID sets the value of ID.

func (*QueryStatus) SetIncarnation

func (s *QueryStatus) SetIncarnation(val OptInt)

SetIncarnation sets the value of Incarnation.

func (*QueryStatus) SetPingTime

func (s *QueryStatus) SetPingTime(val OptDateTime)

SetPingTime sets the value of PingTime.

func (*QueryStatus) SetProgress

func (s *QueryStatus) SetProgress(val OptQueryStatusProgress)

SetProgress sets the value of Progress.

func (*QueryStatus) SetResultCount

func (s *QueryStatus) SetResultCount(val OptInt)

SetResultCount sets the value of ResultCount.

func (*QueryStatus) SetSettings

func (s *QueryStatus) SetSettings(val OptQueryStatusSettings)

SetSettings sets the value of Settings.

func (*QueryStatus) SetStartTime

func (s *QueryStatus) SetStartTime(val time.Time)

SetStartTime sets the value of StartTime.

func (*QueryStatus) SetState

func (s *QueryStatus) SetState(val OperationState)

SetState sets the value of State.

func (*QueryStatus) SetUser

func (s *QueryStatus) SetUser(val OptString)

SetUser sets the value of User.

func (*QueryStatus) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

func (*QueryStatus) Validate

func (s *QueryStatus) Validate() error

type QueryStatusAnnotations

type QueryStatusAnnotations map[string]jx.Raw

func (*QueryStatusAnnotations) Decode

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

Decode decodes QueryStatusAnnotations from json.

func (QueryStatusAnnotations) Encode

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

Encode implements json.Marshaler.

func (QueryStatusAnnotations) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryStatusAnnotations) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type QueryStatusProgress

type QueryStatusProgress map[string]jx.Raw

func (*QueryStatusProgress) Decode

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

Decode decodes QueryStatusProgress from json.

func (QueryStatusProgress) Encode

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

Encode implements json.Marshaler.

func (QueryStatusProgress) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryStatusProgress) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type QueryStatusSettings

type QueryStatusSettings map[string]jx.Raw

func (*QueryStatusSettings) Decode

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

Decode decodes QueryStatusSettings from json.

func (QueryStatusSettings) Encode

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

Encode implements json.Marshaler.

func (QueryStatusSettings) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*QueryStatusSettings) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type ReadQueryResultParams

type ReadQueryResultParams struct {
	// Query ID to get result.
	QueryID QueryID
	// Index of a result to read, defaults to 0.
	ResultIndex OptInt
	// Output format.
	OutputFormat OutputFormat
	// Stage.
	Stage OptString
}

ReadQueryResultParams is parameters of readQueryResult 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.

type SecurityHandler

type SecurityHandler interface {
	// HandleYTToken handles YTToken security.
	HandleYTToken(ctx context.Context, operationName string, t YTToken) (context.Context, error)
}

SecurityHandler is handler for security parameters.

type SecuritySource

type SecuritySource interface {
	// YTToken provides YTToken security value.
	YTToken(ctx context.Context, operationName string) (YTToken, error)
}

SecuritySource is provider of security values (tokens, passwords, etc.).

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, sec SecurityHandler, 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 StartQueryParams

type StartQueryParams struct {
	// Query.
	Query string
	// Query engine to run.
	Engine Engine
	// Stage.
	Stage OptString
}

StartQueryParams is parameters of startQuery operation.

type StartedQuery

type StartedQuery struct {
	QueryID QueryID `json:"query_id"`
}

Ref: #/components/schemas/StartedQuery

func (*StartedQuery) Decode

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

Decode decodes StartedQuery from json.

func (*StartedQuery) Encode

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

Encode implements json.Marshaler.

func (*StartedQuery) GetQueryID

func (s *StartedQuery) GetQueryID() QueryID

GetQueryID returns the value of QueryID.

func (*StartedQuery) MarshalJSON

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

MarshalJSON implements stdjson.Marshaler.

func (*StartedQuery) SetQueryID

func (s *StartedQuery) SetQueryID(val QueryID)

SetQueryID sets the value of QueryID.

func (*StartedQuery) UnmarshalJSON

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

UnmarshalJSON implements stdjson.Unmarshaler.

type UnimplementedHandler

type UnimplementedHandler struct{}

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

func (UnimplementedHandler) AbortQuery

func (UnimplementedHandler) AbortQuery(ctx context.Context, params AbortQueryParams) error

AbortQuery implements abortQuery operation.

Abort running query.

POST /api/v4/abort_query

func (UnimplementedHandler) GetQuery

func (UnimplementedHandler) GetQuery(ctx context.Context, params GetQueryParams) (r *QueryStatus, _ error)

GetQuery implements getQuery operation.

Gets query status.

POST /api/v4/get_query

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) ReadQueryResult

func (UnimplementedHandler) ReadQueryResult(ctx context.Context, params ReadQueryResultParams) (r QueryResult, _ error)

ReadQueryResult implements readQueryResult operation.

Read query result.

POST /api/v4/read_query_result

func (UnimplementedHandler) StartQuery

func (UnimplementedHandler) StartQuery(ctx context.Context, params StartQueryParams) (r *StartedQuery, _ error)

StartQuery implements startQuery operation.

Start a new query.

POST /api/v4/start_query

type YTToken

type YTToken struct {
	APIKey string
}

func (*YTToken) GetAPIKey

func (s *YTToken) GetAPIKey() string

GetAPIKey returns the value of APIKey.

func (*YTToken) SetAPIKey

func (s *YTToken) SetAPIKey(val string)

SetAPIKey sets the value of APIKey.

Jump to

Keyboard shortcuts

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