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.
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.
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.
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.
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.
Index ¶
Constants ¶
const ( ChinaSite = SiteType("china") InternationalSite = SiteType("international") JapanSite = SiteType("japan") )
Variables ¶
This section is empty.
Functions ¶
func ReadJsonFrom ¶
func ReadYamlFrom ¶
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 (*Api) FindParameter ¶
func (*Api) ForeachParameters ¶
Foreach parameter use recursion
func (*Api) GetDocumentLink ¶
func (*Api) GetProtocol ¶
type FileReader ¶
type FileReader struct { }
type InvalidEndpointError ¶
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 (*Product) GetDocumentLink ¶
func (*Product) GetEndpoint ¶
func (*Product) GetLowerCode ¶
type ProductSet ¶
type ProductSet struct {
Products []Product `json:"products"`
}
type Repository ¶
type Repository struct { Products []Product Names []string // contains filtered or unexported fields }
func LoadRepository ¶
func LoadRepository(reader Reader) *Repository
func (*Repository) GetProduct ¶
func (a *Repository) GetProduct(code string) (Product, bool)