apolloapi

package module
v0.0.0-...-23f62e9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 4 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.

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-test4", "prd", "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)

发布配置接口

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Apolloapi

type Apolloapi struct {
	Username  string
	Passwd    string
	ApolloURL string
	Req       *requests.Request
}

func NewApollo

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

func (*Apolloapi) CreateApolloProject

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

func (*Apolloapi) GetappIDList

func (apollo *Apolloapi) GetappIDList()

func (*Apolloapi) ReleaseApollo

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

Jump to

Keyboard shortcuts

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