app

package
v0.0.0-...-04bc821 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrateGeneralLayout

func CrateGeneralLayout(t *tcell.Terminal) (*container.Container, error)

func LogsPoller

func LogsPoller(flags *rootFlags) (func(cs ...chan Logs), func(), error)

func NewLayoutButtons

func NewLayoutButtons(c *container.Container) (*layoutButtons, error)

newLayoutButtons returns buttons that dynamically switch the layouts.

func NewRootCommand

func NewRootCommand() *cobra.Command

func PoolsDefaultPoller

func PoolsDefaultPoller(flags *rootFlags) (func(cs ...chan PoolsDefault), func(), error)

func RangePoller

func RangePoller(flags *rootFlags, payload []byte) (func(cs ...chan RangeResponse), func(), error)

func RebalanceWidget

func RebalanceWidget(progress int) (*donut.Donut, error)

func TasksPoller

func TasksPoller(flags *rootFlags) (func(cs ...chan TasksResponse), func(), chan PoolsDefault, error)

func UpdateButtonsLayout

func UpdateButtonsLayout(buttons *layoutButtons, c *container.Container) error

func UpdateKvOpsLayout

func UpdateKvOpsLayout(ctx context.Context, t *tcell.Terminal, c *container.Container) (pdChannel chan RangeResponse)

func UpdateLogsLayout

func UpdateLogsLayout(ctx context.Context, t *tcell.Terminal, c *container.Container) (logsChannel chan Logs)

func UpdateNodesLayout

func UpdateNodesLayout(ctx context.Context, t *tcell.Terminal, c *container.Container) (pdChannel chan PoolsDefault)

func UpdateNodesServiceCountLayout

func UpdateNodesServiceCountLayout(ctx context.Context, t *tcell.Terminal, c *container.Container) (pdChannel chan PoolsDefault)

func UpdateRebalanceLayout

func UpdateRebalanceLayout(ctx context.Context, t *tcell.Terminal, c *container.Container) (pdChannel chan TasksResponse)

Types

type AddNode

type AddNode struct {
	URI string `json:"uri"`
}

type Analytics

type Analytics struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type AutoCompactionSettings

type AutoCompactionSettings struct {
	DatabaseFragmentationThreshold DatabaseFragmentationThreshold `json:"databaseFragmentationThreshold"`
	ParallelDBAndViewCompaction    bool                           `json:"parallelDBAndViewCompaction"`
	ViewFragmentationThreshold     ViewFragmentationThreshold     `json:"viewFragmentationThreshold"`
}

type Backfill

type Backfill struct {
	AverageTime float64 `json:"averageTime"`
}

type Backup

type Backup struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type Buckets

type Buckets struct {
	TerseBucketsBase          string `json:"terseBucketsBase"`
	TerseStreamingBucketsBase string `json:"terseStreamingBucketsBase"`
	URI                       string `json:"uri"`
}

type ClusterLogsCollection

type ClusterLogsCollection struct {
	CancelURI string `json:"cancelURI"`
	StartURI  string `json:"startURI"`
}

type ComponentsVersion

type ComponentsVersion struct {
	Esaml     string `json:"esaml"`
	Xmerl     string `json:"xmerl"`
	Inets     string `json:"inets"`
	OsMon     string `json:"os_mon"`
	Sasl      string `json:"sasl"`
	Ale       string `json:"ale"`
	Stdlib    string `json:"stdlib"`
	Asn1      string `json:"asn1"`
	Crypto    string `json:"crypto"`
	PublicKey string `json:"public_key"`
	Chronicle string `json:"chronicle"`
	Kernel    string `json:"kernel"`
	NsServer  string `json:"ns_server"`
	Ssl       string `json:"ssl"`
	Lhttpc    string `json:"lhttpc"`
}

type Controllers

type Controllers struct {
	AddNode               AddNode               `json:"addNode"`
	ClusterLogsCollection ClusterLogsCollection `json:"clusterLogsCollection"`
	EjectNode             EjectNode             `json:"ejectNode"`
	FailOver              FailOver              `json:"failOver"`
	ReAddNode             ReAddNode             `json:"reAddNode"`
	ReFailOver            ReFailOver            `json:"reFailOver"`
	Rebalance             Rebalance             `json:"rebalance"`
	Replication           Replication           `json:"replication"`
	SetAutoCompaction     SetAutoCompaction     `json:"setAutoCompaction"`
	SetFastWarmup         SetFastWarmup         `json:"setFastWarmup"`
	SetRecoveryType       SetRecoveryType       `json:"setRecoveryType"`
	StartGracefulFailover StartGracefulFailover `json:"startGracefulFailover"`
}

type Counters

type Counters struct {
}

type Data

type Data struct {
	TotalProgress   float64         `json:"totalProgress"`
	PerNodeProgress PerNodeProgress `json:"perNodeProgress"`
	StartTime       time.Time       `json:"startTime"`
	CompletedTime   bool            `json:"completedTime"`
	TimeTaken       int             `json:"timeTaken"`
	Details         Details         `json:"details"`
}

type DatabaseFragmentationThreshold

type DatabaseFragmentationThreshold struct {
	Percentage int    `json:"percentage"`
	Size       string `json:"size"`
}

type DetailedProgress

type DetailedProgress struct {
	Bucket       string  `json:"bucket"`
	BucketNumber int     `json:"bucketNumber"`
	BucketsCount int     `json:"bucketsCount"`
	PerNode      PerNode `json:"perNode"`
}

type Details

type Details struct {
	TravelSample TravelSample `json:"travel-sample"`
}

type EjectNode

type EjectNode struct {
	URI string `json:"uri"`
}

type Eventing

type Eventing struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type FailOver

type FailOver struct {
	URI string `json:"uri"`
}

type FastWarmupSettings

type FastWarmupSettings struct {
	FastWarmupEnabled  bool `json:"fastWarmupEnabled"`
	MinItemsThreshold  int  `json:"minItemsThreshold"`
	MinMemoryThreshold int  `json:"minMemoryThreshold"`
}

type Hdd

type Hdd struct {
	Free       int64 `json:"free"`
	QuotaTotal int64 `json:"quotaTotal"`
	Total      int64 `json:"total"`
	Used       int64 `json:"used"`
	UsedByData int   `json:"usedByData"`
}

type Index

type Index struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type InterestingStats

type InterestingStats struct {
	CmdGet                   int `json:"cmd_get"`
	CouchDocsActualDiskSize  int `json:"couch_docs_actual_disk_size"`
	CouchDocsDataSize        int `json:"couch_docs_data_size"`
	CouchViewsActualDiskSize int `json:"couch_views_actual_disk_size"`
	CouchViewsDataSize       int `json:"couch_views_data_size"`
	CurrItems                int `json:"curr_items"`
	CurrItemsTot             int `json:"curr_items_tot"`
	EpBgFetched              int `json:"ep_bg_fetched"`
	GetHits                  int `json:"get_hits"`
	MemUsed                  int `json:"mem_used"`
	Ops                      int `json:"ops"`
	VbReplicaCurrItems       int `json:"vb_replica_curr_items"`
}

type Log

type Log struct {
	Node       string `json:"node"`
	Type       string `json:"type"`
	Code       int    `json:"code"`
	Module     string `json:"module"`
	Tstamp     int64  `json:"tstamp"`
	ShortText  string `json:"shortText"`
	Text       string `json:"text"`
	ServerTime string `json:"serverTime"`
}

type Logs

type Logs struct {
	List []Log `json:"list"`
}

type Move

type Move struct {
	AverageTime    float64 `json:"averageTime"`
	TotalCount     int     `json:"totalCount"`
	RemainingCount int     `json:"remainingCount"`
}

type Node

type Node struct {
	ClusterCompatibility int              `json:"clusterCompatibility"`
	ClusterMembership    string           `json:"clusterMembership"`
	CouchAPIBase         string           `json:"couchApiBase"`
	Hostname             string           `json:"hostname"`
	InterestingStats     InterestingStats `json:"interestingStats"`
	McdMemoryAllocated   int              `json:"mcdMemoryAllocated"`
	McdMemoryReserved    int              `json:"mcdMemoryReserved"`
	MemoryFree           int64            `json:"memoryFree"`
	MemoryTotal          int64            `json:"memoryTotal"`
	Os                   string           `json:"os"`
	OtpCookie            string           `json:"otpCookie"`
	OtpNode              string           `json:"otpNode"`
	Ports                Ports            `json:"ports"`
	RecoveryType         string           `json:"recoveryType"`
	Status               string           `json:"status"`
	SystemStats          SystemStats      `json:"systemStats"`
	ThisNode             bool             `json:"thisNode"`
	Uptime               string           `json:"uptime"`
	Version              string           `json:"version"`
}

type NodesInfo

type NodesInfo struct {
	ActiveNodes []string `json:"active_nodes"`
	KeepNodes   []string `json:"keep_nodes"`
	EjectNodes  []string `json:"eject_nodes"`
	DeltaNodes  []any    `json:"delta_nodes"`
	FailedNodes []any    `json:"failed_nodes"`
}

type PerNode

type PerNode map[string]PerNodeDetails

type PerNodeDetails

type PerNodeDetails struct {
	Progress float64 `json:"progress"`
}

type PerNodeProgress

type PerNodeProgress map[string]float64

type PerNodeReplicationInfo

type PerNodeReplicationInfo struct {
	InDocsTotal  int `json:"inDocsTotal"`
	InDocsLeft   int `json:"inDocsLeft"`
	OutDocsTotal int `json:"outDocsTotal"`
	OutDocsLeft  int `json:"outDocsLeft"`
}

type Persistence

type Persistence struct {
	AverageTime float64 `json:"averageTime"`
}

type Pools

type Pools struct {
	IsAdminCreds          bool              `json:"isAdminCreds"`
	IsROAdminCreds        bool              `json:"isROAdminCreds"`
	IsEnterprise          bool              `json:"isEnterprise"`
	ConfigProfile         string            `json:"configProfile"`
	AllowedServices       []string          `json:"allowedServices"`
	IsDeveloperPreview    bool              `json:"isDeveloperPreview"`
	PackageVariant        string            `json:"packageVariant"`
	Pools                 []PoolsPools      `json:"pools"`
	Settings              Settings          `json:"settings"`
	UUID                  string            `json:"uuid"`
	ImplementationVersion string            `json:"implementationVersion"`
	ComponentsVersion     ComponentsVersion `json:"componentsVersion"`
}

type PoolsDefault

type PoolsDefault struct {
	Etag                   string                 `json:"etag"`
	Alerts                 []any                  `json:"alerts"`
	AlertsSilenceURL       string                 `json:"alertsSilenceURL"`
	AutoCompactionSettings AutoCompactionSettings `json:"autoCompactionSettings"`
	Buckets                Buckets                `json:"buckets"`
	Controllers            Controllers            `json:"controllers"`
	Counters               Counters               `json:"counters"`
	FastWarmupSettings     FastWarmupSettings     `json:"fastWarmupSettings"`
	MaxBucketCount         int                    `json:"maxBucketCount"`
	Name                   string                 `json:"name"`
	NodeStatusesURI        string                 `json:"nodeStatusesUri"`
	Nodes                  []Node                 `json:"nodes"`
	RebalanceProgressURI   string                 `json:"rebalanceProgressUri"`
	RebalanceStatus        string                 `json:"rebalanceStatus"`
	RemoteClusters         RemoteClusters         `json:"remoteClusters"`
	ServerGroupsURI        string                 `json:"serverGroupsUri"`
	StopRebalanceURI       string                 `json:"stopRebalanceUri"`
	StorageTotals          StorageTotals          `json:"storageTotals"`
	Tasks                  Tasks                  `json:"tasks"`
	VisualSettingsURI      string                 `json:"visualSettingsUri"`
}

type PoolsPools

type PoolsPools struct {
	Name         string `json:"name"`
	URI          string `json:"uri"`
	StreamingURI string `json:"streamingUri"`
}

type Ports

type Ports struct {
	Direct    int `json:"direct"`
	HTTPSCAPI int `json:"httpsCAPI"`
	HTTPSMgmt int `json:"httpsMgmt"`
	Proxy     int `json:"proxy"`
	SslProxy  int `json:"sslProxy"`
}

type Query

type Query struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type RAM

type RAM struct {
	QuotaTotal        int   `json:"quotaTotal"`
	QuotaTotalPerNode int   `json:"quotaTotalPerNode"`
	QuotaUsed         int   `json:"quotaUsed"`
	QuotaUsedPerNode  int   `json:"quotaUsedPerNode"`
	Total             int64 `json:"total"`
	Used              int64 `json:"used"`
	UsedByData        int   `json:"usedByData"`
}

type RangeResponse

type RangeResponse []struct {
	Data []struct {
		Metric struct {
			Nodes []string `json:"nodes"`
		} `json:"metric"`
		Values [][]any `json:"values"`
	} `json:"data"`
	Errors         []interface{} `json:"errors"`
	StartTimestamp int           `json:"startTimestamp"`
	EndTimestamp   int           `json:"endTimestamp"`
}

type ReAddNode

type ReAddNode struct {
	URI string `json:"uri"`
}

type ReFailOver

type ReFailOver struct {
	URI string `json:"uri"`
}

type Rebalance

type Rebalance struct {
	URI string `json:"uri"`
}

type RemoteClusters

type RemoteClusters struct {
	URI         string `json:"uri"`
	ValidateURI string `json:"validateURI"`
}

type Replication

type Replication struct {
	CreateURI   string `json:"createURI"`
	ValidateURI string `json:"validateURI"`
}

type ReplicationInfo

type ReplicationInfo map[string]PerNodeReplicationInfo

type Request

type Request struct {
	// contains filtered or unexported fields
}
type Search struct {
	StartTime     bool `json:"startTime"`
	CompletedTime bool `json:"completedTime"`
	TimeTaken     bool `json:"timeTaken"`
}

type SetAutoCompaction

type SetAutoCompaction struct {
	URI         string `json:"uri"`
	ValidateURI string `json:"validateURI"`
}

type SetFastWarmup

type SetFastWarmup struct {
	URI         string `json:"uri"`
	ValidateURI string `json:"validateURI"`
}

type SetRecoveryType

type SetRecoveryType struct {
	URI string `json:"uri"`
}

type Settings

type Settings struct {
	MaxParallelIndexers string `json:"maxParallelIndexers"`
	ViewUpdateDaemon    string `json:"viewUpdateDaemon"`
}

type StageInfo

type StageInfo struct {
	Backup    Backup    `json:"backup"`
	Analytics Analytics `json:"analytics"`
	Eventing  Eventing  `json:"eventing"`
	Search    Search    `json:"search"`
	Index     Index     `json:"index"`
	Data      Data      `json:"data"`
	Query     Query     `json:"query"`
}

type StartGracefulFailover

type StartGracefulFailover struct {
	URI string `json:"uri"`
}

type StorageTotals

type StorageTotals struct {
	Hdd Hdd `json:"hdd"`
	RAM RAM `json:"ram"`
}

type SystemStats

type SystemStats struct {
	CPUUtilizationRate float64 `json:"cpu_utilization_rate"`
	MemFree            int64   `json:"mem_free"`
	MemTotal           int64   `json:"mem_total"`
	SwapTotal          int64   `json:"swap_total"`
	SwapUsed           int     `json:"swap_used"`
}

type Takeover

type Takeover struct {
	AverageTime float64 `json:"averageTime"`
}

type Tasks

type Tasks struct {
	URI string `json:"uri"`
}

type TasksItem

type TasksItem struct {
	StatusID                 string           `json:"statusId"`
	Type                     string           `json:"type"`
	Subtype                  string           `json:"subtype"`
	RecommendedRefreshPeriod float64          `json:"recommendedRefreshPeriod"`
	Status                   string           `json:"status"`
	Progress                 float64          `json:"progress"`
	PerNode                  PerNode          `json:"perNode"`
	DetailedProgress         DetailedProgress `json:"detailedProgress"`
	StageInfo                StageInfo        `json:"stageInfo"`
	RebalanceID              string           `json:"rebalanceId"`
	NodesInfo                NodesInfo        `json:"nodesInfo"`
	MasterNode               string           `json:"masterNode"`
}

type TasksResponse

type TasksResponse []TasksItem

type TravelSample

type TravelSample struct {
	VbucketLevelInfo VbucketLevelInfo `json:"vbucketLevelInfo"`
	ReplicationInfo  ReplicationInfo  `json:"replicationInfo"`
	StartTime        time.Time        `json:"startTime"`
	CompletedTime    bool             `json:"completedTime"`
	TimeTaken        int              `json:"timeTaken"`
}

type VbucketLevelInfo

type VbucketLevelInfo struct {
	Move        Move        `json:"move"`
	Backfill    Backfill    `json:"backfill"`
	Takeover    Takeover    `json:"takeover"`
	Persistence Persistence `json:"persistence"`
}

type ViewFragmentationThreshold

type ViewFragmentationThreshold struct {
	Percentage int    `json:"percentage"`
	Size       string `json:"size"`
}

Jump to

Keyboard shortcuts

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