endpoints

package
v0.0.0-...-66c13d8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// EndpointCacheExpireTime in seconds
	EndpointCacheExpireTime = 3600
)
View Source
const (
	// ResolveEndpointUserGuideLink returns guide link
	ResolveEndpointUserGuideLink = ""
)

Variables

This section is empty.

Functions

func AddEndpointMapping

func AddEndpointMapping(regionId, productId, endpoint string) (err error)

AddEndpointMapping adds endpoint to cache

func CheckCacheIsExpire

func CheckCacheIsExpire(cacheKey string) bool

CheckCacheIsExpire valid the cacheKey

func Resolve

func Resolve(param *ResolveParam) (endpoint string, err error)

Resolve returns endpoint

Types

type EndpointObj

type EndpointObj struct {
	Protocols   map[string]string
	Type        string
	Namespace   string
	Id          string
	ServiceCode string
	Endpoint    string
}

EndpointObj wrapper endpoint

type EndpointsObj

type EndpointsObj struct {
	Endpoint []EndpointObj
}

EndpointsObj wrapper Endpoint array

type GetEndpointResponse

type GetEndpointResponse struct {
	Endpoints *EndpointsObj
	RequestId string
	Success   bool
}

GetEndpointResponse returns Endpoints

type LocalGlobalResolver

type LocalGlobalResolver struct{}

LocalGlobalResolver is global resolver

func (*LocalGlobalResolver) TryResolve

func (resolver *LocalGlobalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error)

TryResolve returns endpoint

type LocalRegionalResolver

type LocalRegionalResolver struct{}

LocalRegionalResolver is regional resolver

func (*LocalRegionalResolver) TryResolve

func (resolver *LocalRegionalResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error)

TryResolve returns endpoint

type LocationResolver

type LocationResolver struct{}

LocationResolver is kind of resolver

func (*LocationResolver) TryResolve

func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error)

TryResolve return endpoint

type MappingResolver

type MappingResolver struct{}

MappingResolver is kind of resolver

func (*MappingResolver) TryResolve

func (resolver *MappingResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error)

TryResolve returns endpoint

type ResolveParam

type ResolveParam struct {
	Domain               string
	Product              string
	RegionId             string
	LocationProduct      string
	LocationEndpointType string
	CommonApi            func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"`
}

ResolveParam params to resolve endpoint

func (*ResolveParam) String

func (param *ResolveParam) String() string

String returns json string

type Resolver

type Resolver interface {
	TryResolve(param *ResolveParam) (endpoint string, support bool, err error)
}

Resolver interface

type SimpleHostResolver

type SimpleHostResolver struct{}

SimpleHostResolver is kind of resolver

func (*SimpleHostResolver) TryResolve

func (resolver *SimpleHostResolver) TryResolve(param *ResolveParam) (endpoint string, support bool, err error)

TryResolve returns endpoint

Jump to

Keyboard shortcuts

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