Giter Site home page Giter Site logo

cmdb's Introduction

cmdb

多云资产管理平台, 支持厂商:

  • 阿里云
  • 腾讯云
  • 华为云
  • AWS
  • VMware

SDK使用

package main

import (
	"context"
	"fmt"

	"github.com/infraboard/cmdb/client"
	"github.com/infraboard/cmdb/apps/resource"
)

func main() {
    // 配置cmdb grpc服务调用地址和凭证
	conf := client.NewConfig("localhost:18060")
	conf.WithClientCredentials("xx", "xx")

    // 创建CMDB客户端
	cmdb, err := client.NewClient(conf)
	if err != nil {
		panic(err)
	}

    // 服务调用
	rs, err := cmdb.Resource().Search(context.Background(), resource.NewSearchRequest())
	if err != nil {
		panic(err)
	}
	fmt.Println(rs)
}

开发环境

grpc 环境准备

# 1.安装protoc编译器,  项目使用版本: v3.19.1
# 下载预编译包安装: https://github.com/protocolbuffers/protobuf/releases

# 2.protoc-gen-go go语言查询, 项目使用版本: v1.27.1   
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# 3.安装protoc-gen-go-grpc插件, 项目使用版本: 1.1.0
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest

# 4.安装自定义proto tag插件
go install github.com/favadi/protoc-go-inject-tag@latest

运行程序:

make run

protobuf代码生成:

make gen

cmdb's People

Contributors

yumaojun03 avatar azure-sea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.