Documentation
¶
Index ¶
- Constants
- Variables
- func AllTypeRefs(model *sadl.Model) map[string]bool
- func EnsureNamespaced(ns, name string) string
- func Export(model *sadl.Model, out string, conf *sadl.Data, exportAst bool) error
- func Import(paths []string, conf *sadl.Data) (*sadl.Model, error)
- func IsValidFile(path string) bool
- func WithAnnotation(annos map[string]string, key string, value string) map[string]string
- type AST
- type ErrorTrait
- type ExampleTrait
- type HttpErrorTrait
- type HttpTrait
- type IdlWriter
- func (w *IdlWriter) Begin()
- func (w *IdlWriter) Emit(format string, args ...interface{})
- func (w *IdlWriter) EmitBlobShape(name string, shape *Shape)
- func (w *IdlWriter) EmitBooleanShape(name string, shape *Shape)
- func (w *IdlWriter) EmitBooleanTrait(b bool, tname, indent string)
- func (w *IdlWriter) EmitCollectionShape(shapeName, name string, shape *Shape)
- func (w *IdlWriter) EmitDeprecatedTrait(v interface{}, indent string)
- func (w *IdlWriter) EmitDocumentation(doc, indent string)
- func (w *IdlWriter) EmitEnumTrait(v interface{}, indent string)
- func (w *IdlWriter) EmitExamplesTrait(opname string, raw interface{})
- func (w *IdlWriter) EmitHttpErrorTrait(rv interface{}, indent string)
- func (w *IdlWriter) EmitHttpTrait(rv interface{}, indent string)
- func (w *IdlWriter) EmitLengthTrait(v interface{}, indent string)
- func (w *IdlWriter) EmitMapShape(name string, shape *Shape)
- func (w *IdlWriter) EmitNumericShape(shapeName, name string, shape *Shape)
- func (w *IdlWriter) EmitOperationShape(name string, shape *Shape)
- func (w *IdlWriter) EmitRangeTrait(v interface{}, indent string)
- func (w *IdlWriter) EmitResourceShape(name string, shape *Shape)
- func (w *IdlWriter) EmitServiceShape(name string, shape *Shape)
- func (w *IdlWriter) EmitShape(name string, shape *Shape)
- func (w *IdlWriter) EmitSimpleShape(shapeName, name string)
- func (w *IdlWriter) EmitStringShape(name string, shape *Shape)
- func (w *IdlWriter) EmitStringTrait(v, tname, indent string)
- func (w *IdlWriter) EmitStructureShape(name string, shape *Shape)
- func (w *IdlWriter) EmitTagsTrait(v interface{}, indent string)
- func (w *IdlWriter) EmitTimestampShape(name string, shape *Shape)
- func (w *IdlWriter) EmitTraits(traits map[string]interface{}, indent string)
- func (w *IdlWriter) EmitUnionShape(name string, shape *Shape)
- func (w *IdlWriter) End() string
- type Member
- type Model
- type Parser
- func (p *Parser) EndOfFileError() error
- func (p *Parser) Error(msg string) error
- func (p *Parser) ExpectIdentifier() (string, error)
- func (p *Parser) ExpectIdentifierArray() ([]string, error)
- func (p *Parser) ExpectIdentifierMap() (map[string]string, error)
- func (p *Parser) ExpectInt() (int, error)
- func (p *Parser) ExpectNumber() (*sadl.Decimal, error)
- func (p *Parser) ExpectString() (string, error)
- func (p *Parser) ExpectStringArray() ([]string, error)
- func (p *Parser) GetToken() *sadl.Token
- func (p *Parser) MergeComment(comment1 string, comment2 string) string
- func (p *Parser) Parse() error
- func (p *Parser) SyntaxError() error
- func (p *Parser) UngetToken()
- type Shape
- type ShapeRef
Constants ¶
View Source
const SmithyVersion = "1.0"
View Source
const UnspecifiedNamespace = "example"
View Source
const UnspecifiedVersion = "0.0"
Variables ¶
View Source
var StringValuesNeverEnum bool = false
set to true to prevent enum traits that have only values from ever becoming actul enum objects.
Functions ¶
func EnsureNamespaced ¶
func IsValidFile ¶
Types ¶
type AST ¶
type AST struct {
Version string `json:"smithy"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Shapes map[string]*Shape `json:"shapes,omitempty"`
}
type ErrorTrait ¶
type ErrorTrait int
Type Refinement traits - https://awslabs.github.io/smithy/1.0/spec/core/type-refinement-traits.html box error
type ExampleTrait ¶ added in v1.4.2
type HttpTrait ¶
type HttpTrait struct {
Method string `json:"method"`
Uri string `json:"uri"`
Code int `json:"code,omitempty"` //default to 200
}
-------------- HTTP protocol binding traits - https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html
type IdlWriter ¶
type IdlWriter struct {
// contains filtered or unexported fields
}
func (*IdlWriter) EmitBlobShape ¶
func (*IdlWriter) EmitBooleanShape ¶
func (*IdlWriter) EmitBooleanTrait ¶
func (*IdlWriter) EmitCollectionShape ¶
func (*IdlWriter) EmitDeprecatedTrait ¶
func (*IdlWriter) EmitDocumentation ¶
func (*IdlWriter) EmitEnumTrait ¶
func (*IdlWriter) EmitExamplesTrait ¶ added in v1.4.2
func (*IdlWriter) EmitHttpErrorTrait ¶
func (*IdlWriter) EmitHttpTrait ¶
func (*IdlWriter) EmitLengthTrait ¶
func (*IdlWriter) EmitMapShape ¶
func (*IdlWriter) EmitNumericShape ¶
func (*IdlWriter) EmitOperationShape ¶
func (*IdlWriter) EmitRangeTrait ¶
func (*IdlWriter) EmitResourceShape ¶
func (*IdlWriter) EmitServiceShape ¶
func (*IdlWriter) EmitSimpleShape ¶
func (*IdlWriter) EmitStringShape ¶
func (*IdlWriter) EmitStringTrait ¶
func (*IdlWriter) EmitStructureShape ¶
func (*IdlWriter) EmitTagsTrait ¶
func (*IdlWriter) EmitTimestampShape ¶
func (*IdlWriter) EmitTraits ¶
func (*IdlWriter) EmitUnionShape ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) EndOfFileError ¶
func (*Parser) ExpectIdentifier ¶
func (*Parser) ExpectIdentifierArray ¶
func (*Parser) ExpectIdentifierMap ¶
func (*Parser) ExpectString ¶
func (*Parser) ExpectStringArray ¶
func (*Parser) MergeComment ¶
func (*Parser) SyntaxError ¶
func (*Parser) UngetToken ¶
func (p *Parser) UngetToken()
type Shape ¶
type Shape struct {
Type string `json:"type"`
Traits map[string]interface{} `json:"traits,omitempty"` //service, resource, operation, apply
//List and Set
Member *Member `json:"member,omitempty"`
//Map
Key *Member `json:"key,omitempty"`
Value *Member `json:"value,omitempty"`
//Structure and Union
Members map[string]*Member `json:"members,omitempty"` //keys must be case-insensitively unique. For union, len(Members) > 0,
//Resource
Identifiers map[string]*ShapeRef `json:"identifiers,omitempty"`
Create *ShapeRef `json:"create,omitempty"`
Put *ShapeRef `json:"put,omitempty"`
Read *ShapeRef `json:"read,omitempty"`
Update *ShapeRef `json:"update,omitempty"`
Delete *ShapeRef `json:"delete,omitempty"`
List *ShapeRef `json:"list,omitempty"`
CollectionOperations []*ShapeRef `json:"collectionOperations,omitempty"`
//Resource and Service
Operations []*ShapeRef `json:"operations,omitempty"`
Resources []*ShapeRef `json:"resources,omitempty"`
//Operation
Input *ShapeRef `json:"input,omitempty"`
Output *ShapeRef `json:"output,omitempty"`
// Errors []*Member `json:"errors,omitempty"`
Errors []*ShapeRef `json:"errors,omitempty"`
//Service
Version string `json:"version,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.