resource

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "resource"

Variables

This section is empty.

Functions

func GetAllKind

func GetAllKind() []string

GetAllKind 获取所有的资源类型

func GetByKind

func GetByKind(kind string) map[string]Resource

GetByKind 通过资源类型获取资源列表

func Has

func Has(kind string, name string) bool

Has 检查资源是否存在

func Remove

func Remove(kind string, name string)

Remove 删除资源

func Update

func Update(name string, srv Resource)

Update 更新资源

Types

type Base

type Base struct{}

func (Base) Close

func (Base) Close() error

func (Base) Kind

func (s Base) Kind() string

func (Base) UpdateResObj

func (s Base) UpdateResObj(val interface{})

type Resource

type Resource interface {
	Close() error
	UpdateResObj(val interface{})
	Kind() string
}

func Get

func Get(kind string, name string) Resource

Get 根据类型和名字获取一个资源

func GetOne

func GetOne(kind string) Resource

GetOne 根据类型获取一个资源

Jump to

Keyboard shortcuts

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