Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitSealos ¶
FIXME: 如果获取余额能成功,但是消费永远失败,需要加一个失败次数限制,如果失败次数超过一定阈值,暂停服务
Types ¶
type GroupBalance ¶
type GroupBalance interface {
GetGroupRemainBalance(ctx context.Context, group string) (float64, PostGroupConsumer, error)
}
var Default GroupBalance = NewMockGroupBalance()
type MockGroupBalance ¶
type MockGroupBalance struct{}
func NewMockGroupBalance ¶
func NewMockGroupBalance() *MockGroupBalance
func (*MockGroupBalance) GetBalance ¶
func (q *MockGroupBalance) GetBalance(_ context.Context) (float64, error)
func (*MockGroupBalance) GetGroupRemainBalance ¶
func (q *MockGroupBalance) GetGroupRemainBalance(_ context.Context, _ string) (float64, PostGroupConsumer, error)
func (*MockGroupBalance) PostGroupConsume ¶
type PostGroupConsumer ¶
type Sealos ¶
type Sealos struct {
// contains filtered or unexported fields
}
func (*Sealos) GetGroupRemainBalance ¶
type SealosPostGroupConsumer ¶
type SealosPostGroupConsumer struct {
// contains filtered or unexported fields
}
func (*SealosPostGroupConsumer) GetBalance ¶
func (s *SealosPostGroupConsumer) GetBalance(_ context.Context) (float64, error)
func (*SealosPostGroupConsumer) PostGroupConsume ¶
Click to show internal directories.
Click to hide internal directories.