mns

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	AsgMnsQueuePrefix             = "asg-mns"
	AutoScaleLabel                = "autoscale"
	ScalingOutSuccess ScalingType = "AUTOSCALING:SCALE_OUT_SUCCESS"
	ScalingInSuccess  ScalingType = "AUTOSCALING:SCALE_IN_SUCCESS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	QueueName string

	AccountID string
	BathSize  int32
	// contains filtered or unexported fields
}

type Mns

type Mns struct {
	Config *Config
	// contains filtered or unexported fields
}

func New

func (*Mns) BathReceiveMsg

func (m *Mns) BathReceiveMsg() (*ali_mns.BatchMessageReceiveResponse, error)

func (*Mns) Consume

func (m *Mns) Consume(clusterInfo apistructs.ClusterInfo)

func (*Mns) CreateQueue

func (m *Mns) CreateQueue() error

func (*Mns) DeleteMsg

func (m *Mns) DeleteMsg(receiptHandle string, visibilityTimeout int64) error

func (*Mns) FetchValidClusterInfo

func (m *Mns) FetchValidClusterInfo() []apistructs.ClusterInfo

func (*Mns) GetAccountID

func (m *Mns) GetAccountID(req apistructs.BasicCloudConf) (string, error)

func (*Mns) GetEssActivityMsgs

func (m *Mns) GetEssActivityMsgs() ([]apistructs.EssActivityMsg, error)

func (*Mns) GetInstancesIDByPrivateIp

func (m *Mns) GetInstancesIDByPrivateIp(req apistructs.EcsInfoReq) (string, error)

func (*Mns) GetInstancesInfo

func (m *Mns) GetInstancesInfo(req apistructs.EcsInfoReq) (*ecs.DescribeInstancesResponse, error)

func (*Mns) GetInstancesPrivateIp

func (m *Mns) GetInstancesPrivateIp(req apistructs.EcsInfoReq) (map[string]string, error)

func (*Mns) GetScaleOutInfo

func (m *Mns) GetScaleOutInfo() (*apistructs.ScaleInfo, error)

get scale out instance info: map[instanceId]instanceIp

func (*Mns) InitConfig

func (m *Mns) InitConfig(req apistructs.MnsReq) error

func (*Mns) IsClusterLocked

func (m *Mns) IsClusterLocked(clusterName string) (bool, error)

return true: cluster locked, else unlocked

func (*Mns) LockCluster

func (m *Mns) LockCluster(clusterName string) error

func (*Mns) PeriodicallyFetchClusters

func (m *Mns) PeriodicallyFetchClusters() chan apistructs.ClusterInfo

periodically fetch cluster info from db

func (*Mns) PreProcess

func (m *Mns) PreProcess(info apistructs.ClusterInfo) error

check latest add nodes status, if failed, lock auto scale

func (*Mns) Process

func (m *Mns) Process(ctx context.Context)

func (*Mns) ReceiveMsg

func (m *Mns) ReceiveMsg() (*ali_mns.MessageReceiveResponse, error)

func (*Mns) Run

func (m *Mns) Run()

func (*Mns) UnlockCluster

func (m *Mns) UnlockCluster(clusterName string) error

type ScalingType

type ScalingType string

func (ScalingType) Sting

func (s ScalingType) Sting() string

Jump to

Keyboard shortcuts

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