Documentation
¶
Index ¶
- type Action
- type Codegen
- type Entity
- type EntityReference
- type Enum
- type Field
- type Method
- type Model
- func (m *Model) Entity(name string) (*Entity, error)
- func (m *Model) Enum(name string) (*Enum, error)
- func (m *Model) IsEntity(name string) bool
- func (m *Model) IsEnum(name string) bool
- func (m *Model) IsOperation(name string) bool
- func (m *Model) Operation(name string) (*Operation, error)
- func (m *Model) OperationEntities() ([]*Entity, error)
- func (m *Model) OperationParameters() map[*Operation][]*Parameter
- func (m *Model) OperationsByAction(actions ...Action) []*Operation
- func (m *Model) PluralName() string
- type Operation
- type Parameter
- type PathVariable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codegen ¶ added in v0.2.0
type Codegen struct {
// contains filtered or unexported fields
}
type Entity ¶
type Entity struct { Name string `hcl:"name,label"` Description *string `hcl:"description,optional"` Fields []*Field `hcl:"field,block"` }
func (*Entity) PluralName ¶
type EntityReference ¶
type Enum ¶
type Field ¶
type Method ¶
type Method string
const ( MethodConnect Method = http.MethodConnect MethodDelete Method = http.MethodDelete MethodGet Method = http.MethodGet MethodHead Method = http.MethodHead MethodOptions Method = http.MethodOptions MethodPatch Method = http.MethodPatch MethodPost Method = http.MethodPost MethodPut Method = http.MethodPut MethodTrace Method = http.MethodTrace )
type Model ¶
type Model struct { Package string `hcl:"package"` Name string `hcl:"name"` Entities []*Entity `hcl:"entity,block"` Enums []*Enum `hcl:"enum,block"` Operations []*Operation `hcl:"operation,block"` }
func (*Model) IsOperation ¶
func (*Model) OperationEntities ¶
func (*Model) OperationParameters ¶
func (*Model) OperationsByAction ¶ added in v0.3.0
func (*Model) PluralName ¶
type Operation ¶
type Operation struct { Name string `hcl:"name,label"` Description *string `hcl:"description,optional"` Action Action `hcl:"action,optional"` Method Method `hcl:"method"` Path string `hcl:"path"` Example *string `hcl:"example,optional"` Parameters []*Parameter `hcl:"parameter,block"` PathVariables []*PathVariable `hcl:"path_variable,block"` Request *EntityReference `hcl:"request,block"` Response *EntityReference `hcl:"response,block"` }
Click to show internal directories.
Click to hide internal directories.