openapi_go

package
v0.0.0-...-2acabb3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

README

OPENAPI GO 接口

Documentation

Index

Constants

View Source
const (
	// header
	V1Header = "X-Ys-Version"
	V1Value  = "2023-05-30"
	// DefaultBaseURL defaults gateway for Open-API
	DefaultBaseURL = "http://localhost:8899/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*apiv1.API
	// contains filtered or unexported fields
}

Client represents the Open-API client

func NewClient

func NewClient(cred *credential.Credential, options ...Option) (c *Client, err error)

NewClient creates new client for Open-YS

func (*Client) GetBaseUrl

func (c *Client) GetBaseUrl() string

func (*Client) PrintSign

func (c *Client) PrintSign(rb *xhttp.RequestBuilder)

func (*Client) SetBaseUrl

func (c *Client) SetBaseUrl(baseURL string)

func (*Client) SetCredential

func (c *Client) SetCredential(cred *credential.Credential) error

func (*Client) SetProxy

func (c *Client) SetProxy(proxy string) error

func (*Client) SetTimeout

func (c *Client) SetTimeout(timeout time.Duration)

type Option

type Option func(c *Client) error

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithProxy

func WithProxy(proxy string) Option

func WithRetryCondition

func WithRetryCondition(retryCondition func(resp *http.Response, err error) bool) Option

func WithRetryInterval

func WithRetryInterval(retryInterval time.Duration) Option

func WithRetryTimes

func WithRetryTimes(retryTimes int) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

Directories

Path Synopsis
tools
mysql2mongo command
ysadmin command
ysctl command
xio

Jump to

Keyboard shortcuts

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