model

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// bit
	StoreStatusEnableBit = 31
	StoreStatusReadBit   = 0
	StoreStatusWriteBit  = 1
	StoreStatusSyncBit   = 2
	// status
	StoreStatusInit   = 0                                              // 0
	StoreStatusEnable = (1 << StoreStatusEnableBit)                    // 2147483648
	StoreStatusRead   = StoreStatusEnable | (1 << StoreStatusReadBit)  // 2147483649
	StoreStatusWrite  = StoreStatusEnable | (1 << StoreStatusWriteBit) // 2147483650
	StoreStatusHealth = StoreStatusRead | StoreStatusWrite             // 2147483651
	StoreStatusSync   = StoreStatusEnable | (1 << StoreStatusSyncBit)  // 2147483652
	StoreStatusFail   = StoreStatusEnable                              // 2147483648
)

Store status const.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgAddFreeVolume

type ArgAddFreeVolume struct {
	Group string `form:"group" validate:"required"`
	Dir   string `form:"dir" validate:"required"`
	Num   int64  `form:"num" validate:"required"`
}

ArgAddFreeVolume add free volume

type ArgAddVolume

type ArgAddVolume struct {
	Group string `form:"group" validate:"required"`
	Num   int64  `form:"num" validate:"required"`
}

ArgAddVolume add volume

type ArgCluster

type ArgCluster struct {
	Cluster string `form:"cluster" validate:"required"`
}

ArgCluster .

type ArgCompact

type ArgCompact struct {
	Group string `form:"group" validate:"required"`
	Vid   int64  `form:"vid"`
}

ArgCompact group compact

type ArgGroupStatus

type ArgGroupStatus struct {
	Group  string `form:"group" validate:"required"`
	Status string `form:"status" validate:"required"`
}

ArgGroupStatus group status

type Group

type Group struct {
	Stores     []string          `json:"stores"`
	StoreDatas map[string]*Store `json:"store_datas"`
	Total      struct {
		Space     int64 `json:"space"`
		FreeSpace int64 `json:"free_space"`
		Volumes   int64 `json:"volumes"`
	} `json:"total"`
}

Group .

type Rack

type Rack struct {
	Stores map[string]*Store `json:"stores"`
}

Rack get all store and volume.

type RespGroup

type RespGroup struct {
	Groups map[string]*Group `json:"groups"`
}

RespGroup .

type RespRack

type RespRack struct {
	Racks map[string]*Rack `json:"racks"`
}

RespRack .

type RespTotal

type RespTotal struct {
	Space     int64 `json:"space"`
	FreeSpace int64 `json:"free_space"`
	Groups    int64 `json:"groups"`
	Stores    int64 `json:"stores"`
	Volumes   int64 `json:"volumes"`
}

RespTotal .

type RespVolume

type RespVolume struct {
	Volumes map[string]*VolumeState `json:"volumes"`
}

RespVolume .

type Store

type Store struct {
	Stat   string `json:"stat"`
	Admin  string `json:"admin"`
	API    string `json:"api"`
	ID     string `json:"id"`
	Rack   string `json:"rack"`
	Status int    `json:"status"`
	States struct {
		Init   bool `json:"init"`
		Enable bool `json:"enable"`
		Read   bool `json:"read"`
		Write  bool `json:"write"`
		Sync   bool `json:"sync"`
		Fail   bool `json:"fail"`
	} `json:"states"`
	Volumes []string `json:"volumes"`
}

Store meta data.

func (*Store) ParseStates

func (s *Store) ParseStates()

ParseStates parse states.

type VolumeState

type VolumeState struct {
	TotalWriteProcessed uint64 `json:"total_write_processed"`
	TotalWriteDelay     uint64 `json:"total_write_delay"`
	FreeSpace           uint32 `json:"free_space"`
	Dir                 string `json:"dir"`
}

VolumeState for zk /volume stat

Jump to

Keyboard shortcuts

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