host

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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