lib

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2016 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCase

func CamelCase(src string) string

CamelCase converts strings like "space separated", "dash-separated", "snake_case" to "camelCase" but does not convert "TitleCase" to "camelCase"

func OptionCase

func OptionCase(s string) string

OptionCase converts strings like "space separated", "snake_case", "camelCase", "TitleCase" to "option-case"

func SnakeCase

func SnakeCase(s string) string

SnakeCase converts strings like "space separated", "dash-separated", "camelCase", "TitleCase" to "snake_case"

func TitleCase

func TitleCase(src string) string

TitleCase converts strings like "space separated", "dash-separated", "snake_case", "camelCase" to "TitleCase"

Types

type APIDefinitions

type APIDefinitions struct {
	Host       string
	Schemes    []string
	BasePath   string
	Methods    []APIMethod
	StructDefs map[string]StructDef
}

APIDefinitions holds all information about SORACOM API

func LoadAPIDef

func LoadAPIDef(apiDefYAMLFile string) (*APIDefinitions, error)

LoadAPIDef loads API definitions from the specified file

type APIMethod

type APIMethod struct {
	Path        string
	Method      string
	Use         string
	Tags        []string                 `yaml:"tags"`
	Summary     string                   `yaml:"summary"`
	Description string                   `yaml:"description"`
	OperationID string                   `yaml:"operationId"`
	Security    []map[string]interface{} `yaml:"security"`
	CLI         []string                 `yaml:"x-soracom-cli"`
	Parameters  []APIParam               `yaml:"parameters"`
	Responses   map[string]APIResponse   `yaml:"responses"`
}

APIMethod holds information about an API method

type APIParam

type APIParam struct {
	Name        string         `yaml:"name"`
	In          string         `yaml:"in"`
	Required    bool           `yaml:"required"`
	Description string         `yaml:"description"`
	Type        string         `yaml:"type"`
	Enum        []string       `yaml:"enum"`
	Schema      APIParamSchema `yaml:"schema"`
}

APIParam holds information about an API parameter

type APIParamSchema

type APIParamSchema struct {
	Type  string          `yaml:"type"`
	Items *APIParamSchema `yaml:"items"`
	Ref   string          `yaml:"$ref"`
}

APIParamSchema holds information about a Schema in an API parameter

type APIResponse

type APIResponse struct {
	Schema *APIParamSchema
}

APIResponse holds information about an API response

type StructDef

type StructDef struct {
	Properties []StructProperty
	References []StructReference
}

StructDef holds all information under /definitions in API definition file

type StructProperty

type StructProperty struct {
	Name        string
	Type        string
	Format      string
	Description string
	Required    bool
}

StructProperty holds information about an entry under /definitions/{StructName}/properties in API definition file

type StructReference

type StructReference struct {
	Name    string
	RefType string
}

StructReference holds information about a reference from a property in API definition file

Jump to

Keyboard shortcuts

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