Documentation ¶
Index ¶
- func WithServerURL(ctx context.Context, u *url.URL) context.Context
- type AcquireTelegramAccountOK
- func (s *AcquireTelegramAccountOK) Decode(d *jx.Decoder) error
- func (s *AcquireTelegramAccountOK) Encode(e *jx.Encoder)
- func (s *AcquireTelegramAccountOK) GetAccountID() TelegramAccountID
- func (s *AcquireTelegramAccountOK) GetToken() uuid.UUID
- func (s *AcquireTelegramAccountOK) MarshalJSON() ([]byte, error)
- func (s *AcquireTelegramAccountOK) SetAccountID(val TelegramAccountID)
- func (s *AcquireTelegramAccountOK) SetToken(val uuid.UUID)
- func (s *AcquireTelegramAccountOK) UnmarshalJSON(data []byte) error
- func (s *AcquireTelegramAccountOK) Validate() error
- type AcquireTelegramAccountReq
- func (s *AcquireTelegramAccountReq) Decode(d *jx.Decoder) error
- func (s *AcquireTelegramAccountReq) Encode(e *jx.Encoder)
- func (s *AcquireTelegramAccountReq) GetJob() string
- func (s *AcquireTelegramAccountReq) GetRepoName() string
- func (s *AcquireTelegramAccountReq) GetRepoOwner() string
- func (s *AcquireTelegramAccountReq) GetRunAttempt() int
- func (s *AcquireTelegramAccountReq) GetRunID() int64
- func (s *AcquireTelegramAccountReq) MarshalJSON() ([]byte, error)
- func (s *AcquireTelegramAccountReq) SetJob(val string)
- func (s *AcquireTelegramAccountReq) SetRepoName(val string)
- func (s *AcquireTelegramAccountReq) SetRepoOwner(val string)
- func (s *AcquireTelegramAccountReq) SetRunAttempt(val int)
- func (s *AcquireTelegramAccountReq) SetRunID(val int64)
- func (s *AcquireTelegramAccountReq) UnmarshalJSON(data []byte) error
- type Client
- func (c *Client) AcquireTelegramAccount(ctx context.Context, request *AcquireTelegramAccountReq) (*AcquireTelegramAccountOK, error)
- func (c *Client) GetHealth(ctx context.Context) (*Health, error)
- func (c *Client) HeartbeatTelegramAccount(ctx context.Context, params HeartbeatTelegramAccountParams) error
- func (c *Client) ReceiveTelegramCode(ctx context.Context, params ReceiveTelegramCodeParams) (*ReceiveTelegramCodeOK, error)
- type ClientOption
- type Error
- func (s *Error) Decode(d *jx.Decoder) error
- func (s *Error) Encode(e *jx.Encoder)
- func (s *Error) GetErrorMessage() string
- func (s *Error) GetSpanID() OptSpanID
- func (s *Error) GetTraceID() OptTraceID
- func (s *Error) MarshalJSON() ([]byte, error)
- func (s *Error) SetErrorMessage(val string)
- func (s *Error) SetSpanID(val OptSpanID)
- func (s *Error) SetTraceID(val OptTraceID)
- func (s *Error) UnmarshalJSON(data []byte) error
- func (s *Error) Validate() error
- type ErrorStatusCode
- type Health
- func (s *Health) Decode(d *jx.Decoder) error
- func (s *Health) Encode(e *jx.Encoder)
- func (s *Health) GetBuildDate() time.Time
- func (s *Health) GetCommit() string
- func (s *Health) GetStatus() string
- func (s *Health) GetVersion() string
- func (s *Health) MarshalJSON() ([]byte, error)
- func (s *Health) SetBuildDate(val time.Time)
- func (s *Health) SetCommit(val string)
- func (s *Health) SetStatus(val string)
- func (s *Health) SetVersion(val string)
- func (s *Health) UnmarshalJSON(data []byte) error
- type HeartbeatTelegramAccountOK
- type HeartbeatTelegramAccountParams
- type Invoker
- type OperationName
- type OptBool
- type OptSpanID
- func (o *OptSpanID) Decode(d *jx.Decoder) error
- func (o OptSpanID) Encode(e *jx.Encoder)
- func (o OptSpanID) Get() (v SpanID, ok bool)
- func (o OptSpanID) IsSet() bool
- func (s OptSpanID) MarshalJSON() ([]byte, error)
- func (o OptSpanID) Or(d SpanID) SpanID
- func (o *OptSpanID) Reset()
- func (o *OptSpanID) SetTo(v SpanID)
- func (s *OptSpanID) UnmarshalJSON(data []byte) error
- type OptString
- func (o *OptString) Decode(d *jx.Decoder) error
- func (o OptString) Encode(e *jx.Encoder)
- func (o OptString) Get() (v string, ok bool)
- func (o OptString) IsSet() bool
- func (s OptString) MarshalJSON() ([]byte, error)
- func (o OptString) Or(d string) string
- func (o *OptString) Reset()
- func (o *OptString) SetTo(v string)
- func (s *OptString) UnmarshalJSON(data []byte) error
- type OptTraceID
- func (o *OptTraceID) Decode(d *jx.Decoder) error
- func (o OptTraceID) Encode(e *jx.Encoder)
- func (o OptTraceID) Get() (v TraceID, ok bool)
- func (o OptTraceID) IsSet() bool
- func (s OptTraceID) MarshalJSON() ([]byte, error)
- func (o OptTraceID) Or(d TraceID) TraceID
- func (o *OptTraceID) Reset()
- func (o *OptTraceID) SetTo(v TraceID)
- func (s *OptTraceID) UnmarshalJSON(data []byte) error
- type Option
- type ReceiveTelegramCodeOK
- func (s *ReceiveTelegramCodeOK) Decode(d *jx.Decoder) error
- func (s *ReceiveTelegramCodeOK) Encode(e *jx.Encoder)
- func (s *ReceiveTelegramCodeOK) GetCode() OptString
- func (s *ReceiveTelegramCodeOK) MarshalJSON() ([]byte, error)
- func (s *ReceiveTelegramCodeOK) SetCode(val OptString)
- func (s *ReceiveTelegramCodeOK) UnmarshalJSON(data []byte) error
- func (s *ReceiveTelegramCodeOK) Validate() error
- type ReceiveTelegramCodeParams
- type SecuritySource
- type SpanID
- type TelegramAccountID
- type TokenAuth
- type TraceID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AcquireTelegramAccountOK ¶
type AcquireTelegramAccountOK struct { AccountID TelegramAccountID `json:"account_id"` // Access token. Token uuid.UUID `json:"token"` }
func (*AcquireTelegramAccountOK) Decode ¶
func (s *AcquireTelegramAccountOK) Decode(d *jx.Decoder) error
Decode decodes AcquireTelegramAccountOK from json.
func (*AcquireTelegramAccountOK) Encode ¶
func (s *AcquireTelegramAccountOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AcquireTelegramAccountOK) GetAccountID ¶
func (s *AcquireTelegramAccountOK) GetAccountID() TelegramAccountID
GetAccountID returns the value of AccountID.
func (*AcquireTelegramAccountOK) GetToken ¶
func (s *AcquireTelegramAccountOK) GetToken() uuid.UUID
GetToken returns the value of Token.
func (*AcquireTelegramAccountOK) MarshalJSON ¶
func (s *AcquireTelegramAccountOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AcquireTelegramAccountOK) SetAccountID ¶
func (s *AcquireTelegramAccountOK) SetAccountID(val TelegramAccountID)
SetAccountID sets the value of AccountID.
func (*AcquireTelegramAccountOK) SetToken ¶
func (s *AcquireTelegramAccountOK) SetToken(val uuid.UUID)
SetToken sets the value of Token.
func (*AcquireTelegramAccountOK) UnmarshalJSON ¶
func (s *AcquireTelegramAccountOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*AcquireTelegramAccountOK) Validate ¶
func (s *AcquireTelegramAccountOK) Validate() error
type AcquireTelegramAccountReq ¶
type AcquireTelegramAccountReq struct { // Repository owner. RepoOwner string `json:"repo_owner"` // Repository name. RepoName string `json:"repo_name"` // Job ID. Job string `json:"job"` RunID int64 `json:"run_id"` RunAttempt int `json:"run_attempt"` }
func (*AcquireTelegramAccountReq) Decode ¶
func (s *AcquireTelegramAccountReq) Decode(d *jx.Decoder) error
Decode decodes AcquireTelegramAccountReq from json.
func (*AcquireTelegramAccountReq) Encode ¶
func (s *AcquireTelegramAccountReq) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*AcquireTelegramAccountReq) GetJob ¶
func (s *AcquireTelegramAccountReq) GetJob() string
GetJob returns the value of Job.
func (*AcquireTelegramAccountReq) GetRepoName ¶
func (s *AcquireTelegramAccountReq) GetRepoName() string
GetRepoName returns the value of RepoName.
func (*AcquireTelegramAccountReq) GetRepoOwner ¶
func (s *AcquireTelegramAccountReq) GetRepoOwner() string
GetRepoOwner returns the value of RepoOwner.
func (*AcquireTelegramAccountReq) GetRunAttempt ¶
func (s *AcquireTelegramAccountReq) GetRunAttempt() int
GetRunAttempt returns the value of RunAttempt.
func (*AcquireTelegramAccountReq) GetRunID ¶
func (s *AcquireTelegramAccountReq) GetRunID() int64
GetRunID returns the value of RunID.
func (*AcquireTelegramAccountReq) MarshalJSON ¶
func (s *AcquireTelegramAccountReq) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*AcquireTelegramAccountReq) SetJob ¶
func (s *AcquireTelegramAccountReq) SetJob(val string)
SetJob sets the value of Job.
func (*AcquireTelegramAccountReq) SetRepoName ¶
func (s *AcquireTelegramAccountReq) SetRepoName(val string)
SetRepoName sets the value of RepoName.
func (*AcquireTelegramAccountReq) SetRepoOwner ¶
func (s *AcquireTelegramAccountReq) SetRepoOwner(val string)
SetRepoOwner sets the value of RepoOwner.
func (*AcquireTelegramAccountReq) SetRunAttempt ¶
func (s *AcquireTelegramAccountReq) SetRunAttempt(val int)
SetRunAttempt sets the value of RunAttempt.
func (*AcquireTelegramAccountReq) SetRunID ¶
func (s *AcquireTelegramAccountReq) SetRunID(val int64)
SetRunID sets the value of RunID.
func (*AcquireTelegramAccountReq) UnmarshalJSON ¶
func (s *AcquireTelegramAccountReq) 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) AcquireTelegramAccount ¶
func (c *Client) AcquireTelegramAccount(ctx context.Context, request *AcquireTelegramAccountReq) (*AcquireTelegramAccountOK, error)
AcquireTelegramAccount invokes acquireTelegramAccount operation.
Acquire telegram account.
POST /api/telegram/account/acquire
func (*Client) HeartbeatTelegramAccount ¶
func (c *Client) HeartbeatTelegramAccount(ctx context.Context, params HeartbeatTelegramAccountParams) error
HeartbeatTelegramAccount invokes heartbeatTelegramAccount operation.
Heartbeat telegram account.
GET /api/telegram/account/heartbeat/{token}
func (*Client) ReceiveTelegramCode ¶
func (c *Client) ReceiveTelegramCode(ctx context.Context, params ReceiveTelegramCodeParams) (*ReceiveTelegramCodeOK, error)
ReceiveTelegramCode invokes receiveTelegramCode operation.
Receive telegram code.
GET /api/telegram/code/receive/{token}
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 struct { // Human-readable error message. ErrorMessage string `json:"error_message"` TraceID OptTraceID `json:"trace_id"` SpanID OptSpanID `json:"span_id"` }
Error occurred while processing request. Ref: #/components/schemas/Error
func (*Error) GetErrorMessage ¶
GetErrorMessage returns the value of ErrorMessage.
func (*Error) GetTraceID ¶
func (s *Error) GetTraceID() OptTraceID
GetTraceID returns the value of TraceID.
func (*Error) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Error) SetErrorMessage ¶
SetErrorMessage sets the value of ErrorMessage.
func (*Error) SetTraceID ¶
func (s *Error) SetTraceID(val OptTraceID)
SetTraceID sets the value of TraceID.
func (*Error) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type ErrorStatusCode ¶
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.
func (*ErrorStatusCode) Validate ¶
func (s *ErrorStatusCode) Validate() error
type Health ¶
type Health struct { // Health status. Status string `json:"status"` // Service version. Version string `json:"version"` // Service commit. Commit string `json:"commit"` // Service build date. BuildDate time.Time `json:"build_date"` }
Ref: #/components/schemas/Health
func (*Health) GetBuildDate ¶
GetBuildDate returns the value of BuildDate.
func (*Health) GetVersion ¶
GetVersion returns the value of Version.
func (*Health) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*Health) SetBuildDate ¶
SetBuildDate sets the value of BuildDate.
func (*Health) SetVersion ¶
SetVersion sets the value of Version.
func (*Health) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type HeartbeatTelegramAccountOK ¶
type HeartbeatTelegramAccountOK struct{}
HeartbeatTelegramAccountOK is response for HeartbeatTelegramAccount operation.
type HeartbeatTelegramAccountParams ¶
HeartbeatTelegramAccountParams is parameters of heartbeatTelegramAccount operation.
type Invoker ¶
type Invoker interface { // AcquireTelegramAccount invokes acquireTelegramAccount operation. // // Acquire telegram account. // // POST /api/telegram/account/acquire AcquireTelegramAccount(ctx context.Context, request *AcquireTelegramAccountReq) (*AcquireTelegramAccountOK, error) // GetHealth invokes getHealth operation. // // Get health. // // GET /api/health GetHealth(ctx context.Context) (*Health, error) // HeartbeatTelegramAccount invokes heartbeatTelegramAccount operation. // // Heartbeat telegram account. // // GET /api/telegram/account/heartbeat/{token} HeartbeatTelegramAccount(ctx context.Context, params HeartbeatTelegramAccountParams) error // ReceiveTelegramCode invokes receiveTelegramCode operation. // // Receive telegram code. // // GET /api/telegram/code/receive/{token} ReceiveTelegramCode(ctx context.Context, params ReceiveTelegramCodeParams) (*ReceiveTelegramCodeOK, error) }
Invoker invokes operations described by OpenAPI v3 specification.
type OperationName ¶
type OperationName = string
OperationName is the ogen operation name
const ( AcquireTelegramAccountOperation OperationName = "AcquireTelegramAccount" GetHealthOperation OperationName = "GetHealth" HeartbeatTelegramAccountOperation OperationName = "HeartbeatTelegramAccount" ReceiveTelegramCodeOperation OperationName = "ReceiveTelegramCode" )
type OptBool ¶
OptBool is optional bool.
func NewOptBool ¶
NewOptBool returns new OptBool with value set to v.
type OptSpanID ¶
OptSpanID is optional SpanID.
func NewOptSpanID ¶
NewOptSpanID returns new OptSpanID with value set to v.
func (OptSpanID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptSpanID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptString ¶
OptString is optional string.
func NewOptString ¶
NewOptString returns new OptString with value set to v.
func (OptString) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*OptString) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type OptTraceID ¶
OptTraceID is optional TraceID.
func NewOptTraceID ¶
func NewOptTraceID(v TraceID) OptTraceID
NewOptTraceID returns new OptTraceID with value set to v.
func (*OptTraceID) Decode ¶
func (o *OptTraceID) Decode(d *jx.Decoder) error
Decode decodes TraceID from json.
func (OptTraceID) Encode ¶
func (o OptTraceID) Encode(e *jx.Encoder)
Encode encodes TraceID as json.
func (OptTraceID) Get ¶
func (o OptTraceID) Get() (v TraceID, ok bool)
Get returns value and boolean that denotes whether value was set.
func (OptTraceID) IsSet ¶
func (o OptTraceID) IsSet() bool
IsSet returns true if OptTraceID was set.
func (OptTraceID) MarshalJSON ¶
func (s OptTraceID) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (OptTraceID) Or ¶
func (o OptTraceID) Or(d TraceID) TraceID
Or returns value if set, or given parameter if does not.
func (*OptTraceID) UnmarshalJSON ¶
func (s *OptTraceID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
type Option ¶
type Option interface { 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 ReceiveTelegramCodeOK ¶
type ReceiveTelegramCodeOK struct { // Code. Code OptString `json:"code"` }
func (*ReceiveTelegramCodeOK) Decode ¶
func (s *ReceiveTelegramCodeOK) Decode(d *jx.Decoder) error
Decode decodes ReceiveTelegramCodeOK from json.
func (*ReceiveTelegramCodeOK) Encode ¶
func (s *ReceiveTelegramCodeOK) Encode(e *jx.Encoder)
Encode implements json.Marshaler.
func (*ReceiveTelegramCodeOK) GetCode ¶
func (s *ReceiveTelegramCodeOK) GetCode() OptString
GetCode returns the value of Code.
func (*ReceiveTelegramCodeOK) MarshalJSON ¶
func (s *ReceiveTelegramCodeOK) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*ReceiveTelegramCodeOK) SetCode ¶
func (s *ReceiveTelegramCodeOK) SetCode(val OptString)
SetCode sets the value of Code.
func (*ReceiveTelegramCodeOK) UnmarshalJSON ¶
func (s *ReceiveTelegramCodeOK) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (*ReceiveTelegramCodeOK) Validate ¶
func (s *ReceiveTelegramCodeOK) Validate() error
type ReceiveTelegramCodeParams ¶
ReceiveTelegramCodeParams is parameters of receiveTelegramCode operation.
type SecuritySource ¶
type SecuritySource interface { // TokenAuth provides tokenAuth security value. TokenAuth(ctx context.Context, operationName OperationName) (TokenAuth, error) }
SecuritySource is provider of security values (tokens, passwords, etc.).
type SpanID ¶
type SpanID string
func (SpanID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*SpanID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.
type TelegramAccountID ¶
type TelegramAccountID string
func (*TelegramAccountID) Decode ¶
func (s *TelegramAccountID) Decode(d *jx.Decoder) error
Decode decodes TelegramAccountID from json.
func (TelegramAccountID) Encode ¶
func (s TelegramAccountID) Encode(e *jx.Encoder)
Encode encodes TelegramAccountID as json.
func (TelegramAccountID) MarshalJSON ¶
func (s TelegramAccountID) MarshalJSON() ([]byte, error)
MarshalJSON implements stdjson.Marshaler.
func (*TelegramAccountID) UnmarshalJSON ¶
func (s *TelegramAccountID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements stdjson.Unmarshaler.
func (TelegramAccountID) Validate ¶
func (s TelegramAccountID) Validate() error
type TokenAuth ¶
type TokenAuth struct {
APIKey string
}
type TraceID ¶
type TraceID string
func (TraceID) MarshalJSON ¶
MarshalJSON implements stdjson.Marshaler.
func (*TraceID) UnmarshalJSON ¶
UnmarshalJSON implements stdjson.Unmarshaler.