openapi

package
v4.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	Name     string   `json:"env"`
	Clusters []string `json:"clusters"`
}

type Error

type Error struct {
	Msg  string  `json:"message"`
	Code float64 `json:"status"`
}

func (Error) Error

func (e Error) Error() string

type KVItem

type KVItem struct {
	Key            string `json:"key"`
	Value          string `json:"value"`
	CreateBy       string `json:"dataChangeCreatedBy"`
	LastModifyBy   string `json:"dataChangeLastModifiedBy"`
	CreateTime     string `json:"dataChangeCreatedTime"`
	LastModifyTime string `json:"dataChangeLastModifiedTime"`
}

type Lock

type Lock struct {
	NamespaceName string `json:"namespaceName"`
	Locked        bool   `json:"isLocked"`
	LockedBy      string `json:"lockedBy"`
}

type NamespaceInfo

type NamespaceInfo struct {
	AppID          string   `json:"appId"`
	ClusterName    string   `json:"clusterName"`
	NamespaceName  string   `json:"namespaceName"`
	Comment        string   `json:"comment"`
	Format         string   `json:"format"`
	IsPublic       bool     `json:"isPublic"`
	Items          []KVItem `json:"items"`
	CreateBy       string   `json:"dataChangeCreatedBy"`
	LastModifyBy   string   `json:"dataChangeLastModifiedBy"`
	CreateTime     string   `json:"dataChangeCreatedTime"`
	LastModifyTime string   `json:"dataChangeLastModifiedTime"`
}

type OpenAPI

type OpenAPI interface {
	Envs() ([]*Env, error)
	Namespaces() ([]*NamespaceInfo, error)
	NamespaceInfo(namespaceName string) (*NamespaceInfo, error)
	CreateNamespace(namespaceName string, format string, public bool, comment string, dataChangeCreatedBy string) error
	GetLock(namespaceName string) (*Lock, error)
	AddConfig(namespaceName string, key, value string, comment string, dataChangeCreatedBy string) error
	UpdateConfig(namespaceName string, key, value string, comment string, dataChangeLastModifiedBy string) error
	DeleteConfig(namespaceName string, key, operator string) error
	Release(namnespaceName string, releaseTitle string, releaseComment string, releaseBy string) error
	GetRelease(namespaceName string) (*Release, error)
}

OpenAPI contains api to manage configs

func New

func New(portal_address string, appid string, env string, cluster string, token string) OpenAPI

New create an OpenAPI instance

type Release

type Release struct {
	AppId                      string            `json:"appId"`
	ClusterName                string            `json:"clusterName"`
	NamespaceName              string            `json:"namespaceName"`
	Name                       string            `json:"name"`
	Configurations             map[string]string `json:"configurations"`
	Comment                    string            `json:"comment"`
	DataChangeCreatedBy        string            `json:"dataChangeCreatedBy"`
	DataChangeLastModifiedBy   string            `json:"dataChangeLastModifiedBy"`
	DataChangeCreatedTime      string            `json:"dataChangeCreatedTime"`
	DataChangeLastModifiedTime string            `json:"dataChangeLastModifiedTime"`
}

Jump to

Keyboard shortcuts

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