meta

package
v3.0.25+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2019 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Overview

Copyright 1999-2019 Alibaba Group Holding Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ChinaSite         = SiteType("china")
	InternationalSite = SiteType("international")
	JapanSite         = SiteType("japan")
)

Variables

This section is empty.

Functions

func ReadJsonFrom

func ReadJsonFrom(r Reader, path string, v interface{}) error

func ReadYamlFrom

func ReadYamlFrom(r Reader, path string, v interface{}) error

Types

type Api

type Api struct {
	Name        string            `json:"name"`
	Protocol    string            `json:"protocol"`
	Method      string            `json:"method"`
	PathPattern string            `json:"pathPattern"`
	Description map[string]string `json:"descriptions,omitempty"`
	Parameters  []Parameter       `json:"parameters"`
	Product     *Product          `json:"-"`
}

func (*Api) CheckRequiredParameters

func (a *Api) CheckRequiredParameters(checker func(string) bool) error

func (*Api) FindParameter

func (a *Api) FindParameter(name string) *Parameter

func (*Api) ForeachParameters

func (a *Api) ForeachParameters(f func(s string, p Parameter))

Foreach parameter use recursion

func (a *Api) GetDocumentLink() string

func (*Api) GetMethod

func (a *Api) GetMethod() string

func (*Api) GetProtocol

func (a *Api) GetProtocol() string

type FileReader

type FileReader struct {
}

type InvalidEndpointError

type InvalidEndpointError struct {
	LocationError error
	Region        string
	Product       *Product
}

func (*InvalidEndpointError) Error

func (e *InvalidEndpointError) Error() string

type Parameter

type Parameter struct {
	Name          string            `json:"name"`
	Position      string            `json:"position"`
	Type          string            `json:"type"`
	Description   map[string]string `json:"description,omitempty"`
	Required      bool              `json:"required"`
	Hidden        bool              `json:"hidden"`
	Example       string            `json:"example,omitempty"`
	SubParameters []Parameter       `json:"sub_parameters,omitempty"`
}

type ParameterSlice

type ParameterSlice []Parameter

func (ParameterSlice) Len

func (p ParameterSlice) Len() int

func (ParameterSlice) Less

func (p ParameterSlice) Less(i, j int) bool

func (ParameterSlice) Swap

func (p ParameterSlice) Swap(i, j int)

type Product

type Product struct {
	Code     string            `json:"code"`
	Version  string            `json:"version"`
	Catalog1 map[string]string `json:"catalog1"`
	Catalog2 map[string]string `json:"catalog2"`
	Name     map[string]string `json:"name"`

	LocationServiceCode     string            `json:"location_service_code"`
	RegionalEndpoints       map[string]string `json:"regional_endpoints"`
	GlobalEndpoint          string            `json:"global_endpoint"`
	RegionalEndpointPattern string            `json:"regional_endpoint_patterns"`

	ApiStyle string   `json:"api_style"`
	ApiNames []string `json:"apis"`
	// contains filtered or unexported fields
}
func (a *Product) GetDocumentLink(lang string) string

func (*Product) GetEndpoint

func (a *Product) GetEndpoint(region string, client *sdk.Client) (string, error)

func (*Product) GetLowerCode

func (a *Product) GetLowerCode() string

func (*Product) TryGetEndpoints

func (a *Product) TryGetEndpoints(region string, client *sdk.Client) (endpoint string, lcEndpoint string)

type ProductSet

type ProductSet struct {
	Products []Product `json:"products"`
}

type Reader

type Reader interface {
	ReadFrom(path string) ([]byte, error)
}

type Repository

type Repository struct {
	Products []Product
	Names    []string
	// contains filtered or unexported fields
}

func LoadRepository

func LoadRepository(reader Reader) *Repository

func (*Repository) GetApi

func (a *Repository) GetApi(productCode string, version string, apiName string) (Api, bool)

func (*Repository) GetProduct

func (a *Repository) GetProduct(code string) (Product, bool)

func (*Repository) GetStyle

func (a *Repository) GetStyle(productCode, version string) (string, bool)

type SiteType

type SiteType string

Jump to

Keyboard shortcuts

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