host

package
v1.0.0-rc Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host struct {
	// contains filtered or unexported fields
}

Host 资源对象操作封装

func New

func New(options ...Option) *Host

New 新建 Host 实例,通过 Host 实例操作主机资源

func (*Host) CreateOrUpdate

func (h *Host) CreateOrUpdate(host *model.Host) error

CreateOrUpdate 创建或更新主机信息

func (*Host) GetByClusterAndIP

func (h *Host) GetByClusterAndIP(clusterName, privateAddr string) (*apistructs.Host, error)

GetByClusterAndIP 根据 cluster & privateAddr获取主机信息

func (*Host) GetByClusterAndPrivateIP

func (h *Host) GetByClusterAndPrivateIP(clusterName, privateAddr string) (*model.Host, error)

GetByClusterAndPrivateIP 根据 cluster & privateAddr获取主机信息

func (*Host) GetHostNumber

func (h *Host) GetHostNumber() (uint64, error)

GetHostNumber 获取host数量

func (*Host) Update

func (h *Host) Update(host *model.Host) error

Update 更新主机信息

type Option

type Option func(*Host)

Option 定义 Host 对象的配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithContainer

func WithContainer(cs *container.Container) Option

WithContainer 配置 container service

func WithDBClient

func WithDBClient(db *dao.DBClient) Option

WithDBClient 配置 db client

func WithTicketService

func WithTicketService(t *ticket.Ticket) Option

WithTicketService 配置 ticket service

Jump to

Keyboard shortcuts

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