mns

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

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