restclient

package
v2.4.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() *resty.Client

NewClient creates new resty Client instance

Types

type RestClient

type RestClient interface {
	SetProvider(provider registry.IServiceProvider)
	SetClient(client *resty.Client)
	SetRootPath(rootPath string)
}

RestClient defines service client interface

type RestClientOption

type RestClientOption func(RestClient)

RestClientOption defines configure function type

func WithClient

func WithClient(client *resty.Client) RestClientOption

WithClient sets http client

func WithProvider

func WithProvider(provider registry.IServiceProvider) RestClientOption

WithProvider sets service provider

func WithRootPath

func WithRootPath(rootPath string) RestClientOption

WithRootPath sets root path for sending http requests

type ServiceProvider

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

ServiceProvider defines an implementation for IServiceProvider

func NewServiceProvider

func NewServiceProvider(env string) *ServiceProvider

NewServiceProvider creates new ServiceProvider instance

func (*ServiceProvider) Close added in v2.0.6

func (s *ServiceProvider) Close()

func (*ServiceProvider) SelectServer

func (s *ServiceProvider) SelectServer() string

SelectServer return service address from environment variable

Jump to

Keyboard shortcuts

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