endpoints

package
v1.63.57 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: 47

Documentation

Index

Constants

View Source
const (
	// EndpointCacheExpireTime ...
	EndpointCacheExpireTime = 3600 //Seconds
)
View Source
const (
	ResolveEndpointUserGuideLink = ""
)

Variables

This section is empty.

Functions

func AddEndpointMapping

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

AddEndpointMapping use productId and regionId as key to store the endpoint into inner map when using the same productId and regionId as key, the endpoint will be covered.

func CheckCacheIsExpire

func CheckCacheIsExpire(cacheKey string) bool

CheckCacheIsExpire ...

func GetEndpointFromMap

func GetEndpointFromMap(regionId, productId string) string

GetEndpointFromMap use Product and RegionId as key to find endpoint from inner map

func Resolve

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

Resolve resolve endpoint with params It will resolve with each supported resolver until anyone resolved

Types

type Cache

type Cache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Cache caches endpoint for specific product and region

func (*Cache) Get

func (c *Cache) Get(k string) (v interface{})

Get ...

func (*Cache) Set

func (c *Cache) Set(k string, v interface{})

Set ...

type EndpointMapping added in v1.60.275

type EndpointMapping struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

type EndpointObj

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

EndpointObj ...

type EndpointsObj

type EndpointsObj struct {
	Endpoint []EndpointObj
}

EndpointsObj ...

type GetEndpointResponse

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

GetEndpointResponse ...

type LocalGlobalResolver

type LocalGlobalResolver struct {
}

func (*LocalGlobalResolver) GetName

func (resolver *LocalGlobalResolver) GetName() (name string)

func (*LocalGlobalResolver) TryResolve

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

type LocalRegionalResolver

type LocalRegionalResolver struct {
}

func (*LocalRegionalResolver) GetName

func (resolver *LocalRegionalResolver) GetName() (name string)

func (*LocalRegionalResolver) TryResolve

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

type LocationResolver

type LocationResolver struct {
}

LocationResolver ...

func (*LocationResolver) GetName

func (resolver *LocationResolver) GetName() (name string)

func (*LocationResolver) TryResolve

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

TryResolve resolves endpoint giving product and region

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:"-"`
}

func (*ResolveParam) String

func (param *ResolveParam) String() string

type Resolver

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

Jump to

Keyboard shortcuts

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