apolloapi

package module
v0.0.0-...-428f5dc Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 1 module, 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.

README

apolloapi-go license

apolloapi

apollo 开放平台接口,其接口包含了增删改查等基本功能,另外还有创建cluster,namespace等等。

Installation

go version >= 1.14 GO111MODULE=on
go get -u github.com/feichenxue/apolloapi

如何使用?

简单示例

package main

import (
	"fmt"
	"github.com/feichenxue/apolloapi"
)

func main() {

	url := "http://x.x.x.x:8080" //你的apollo port 地址
	user := "apollo"     //apollo 用户名, 默认为 apollo
	passwds := "xxxxx"  //apollo 密码

	apollo := apolloapi.NewApollo(url, user, passwds)

	ok, err := apollo.ReleaseApollo("go-test-project", "prd", "comment-test", "default", "application")
	if err != nil {
		fmt.Println(err)
	}

	if ok {
		fmt.Println("发布成功!!!")
	}
}

接口列表

  • NewApollo
func NewApollo(apollourl, username, passwd string) *apolloApi

新建apollo一个对象,用以调用此包内的其它方法

  • CreateApolloProject
func (apollo *apolloApi) CreateApolloProject(appId, name, orgId, orgName, ownerName string) (bool, error)

新建apollo一个项目

  • ReleaseApollo
func (apollo *apolloApi) ReleaseApollo(appid, env, comment, clustersName, namespaceName string) (bool, error)

发布配置接口

  • GetappIDList
func (apollo *apolloApi) GetappIdList() []string

获取apollos所有appid详细信息,其返回值类型为字符串切片

  • CreateCluster
func (apollo *apolloApi) CreateCluster(appId, env, clusterName string) (bool, error)

创建Cluster

  • GetConfigData
func (apollo *apolloApi) GetConfigData(appId, env, clusters, namespaces string) (data map[string]string, err error)

获取相应appid的相应集群下相应namespaces下的配置

未完待续······

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApollo

func NewApollo(apollourl, username, passwd string) *apolloApi

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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