provider

package
v0.0.0-...-f4276bb Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 2 Imported by: 0

README

对资源提供商, 通过API获取资源, 并转换为标准的 接口数据(Resource)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostHandler

type HostHandler func(*resource.Resource)

http.Handler

type HostProvider

type HostProvider interface {
	// 获取Host 主机接口, 数据是分页批量拉取, 我们的接口是 单独一个一个创建资源的
	// resp = QueryHost()
	// for resp { CreateResource(item) }
	// 拉取一页数据: 10s, 一个一个往数据库里面写, 这接口是最基本的接口设计,自己厂商
	// QueryHost(context.Context, *QueryHostRequest) (*resource.ResourceSet, error)
	// 类比 Js ForEatch, 给一个回调函数
	// QueryHost() {for resources; fn(item)}
	// 通过回调把接口返回出去, Stream
	QueryHost(context.Context, *QueryHostRequest, HostHandler) error
}

客户端封装

type QueryHostRequest

type QueryHostRequest struct {
}

func NewQueryHostRequest

func NewQueryHostRequest() *QueryHostRequest

Directories

Path Synopsis
tencent
cvm

Jump to

Keyboard shortcuts

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