ir

package
v0.0.6-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package ir holds Intermediary Representations of Services, Methods and Responses.

It's higher level purpose is to ensure the stability of code generation.

The IR package is currently not exposed as a service definition to be directly used for service generation, in the future a subset of IR Service might be exposed in the future right now it doesn't make that much sense to do so.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder interface {
	Decode() (*Service, error)
}

Decoder is an interface that takes raw data bytes and converts them to a service definition

type Encoder

type Encoder interface {
	Encode(*Service) error
}

Encoder is an interface that takes a service definition and prints the code for a language.

type Method

type Method struct {
	ID             string              `json:"id"`
	Name           string              `json:"Name"`
	Path           string              `json:"path"`
	HTTPMethod     string              `json:"httpMethod"`
	Description    string              `json:"description"`
	Produces       []string            `json:"produces,omitempty"`
	Consumes       []string            `json:"consumes,omitempty"`
	Parameters     map[string]Schema   `json:"parameters"`
	ParameterOrder []string            `json:"parameterOrder"`
	Responses      map[string]Response `json:"responses,omitempty"`
	Scopes         []string            `json:"scopes,omitempty"`
	Backend        string              `json:"backend,omitempty"`
}

Method is the Intermediary representation of a Method

type Response

type Response struct {
	HTTPStatus int               `json:"http_status"`
	Returns    map[string]Schema `json:"returns,omitempty"`
	Default    bool              `json:"default"`
	Error      bool              `json:"error"`
}

Response is the Intermediary representation of a Service

type Schema

type Schema struct {
	ID               string            `json:"id"`
	Name             string            `json:"name"`
	CannonicalName   string            `json:"cannonical_name"`
	Type             string            `json:"type"`
	Required         bool              `json:"required"`
	Default          *string           `json:"default"`
	Order            int               `json:"order"`
	Format           *string           `json:"format,omitempty"`
	Description      *string           `json:"description,omitempty"`
	Location         *string           `json:"location,omitempty"`
	Enum             []string          `json:"enum,omitempty"`
	EnumDescriptions []string          `json:"enumDescriptions,omitempty"`
	Properties       map[string]Schema `json:"properties,omitempty"`
	Item             *Schema           `json:"items,omitempty"`
}

Schema is the Intermediary representation of a Schema

type Service

type Service struct {
	Kind              string            `json:"kind"`
	Etag              string            `json:"etag"`
	DiscoveryVersion  string            `json:"discoveryVersion"`
	ID                string            `json:"id"`
	Name              string            `json:"name"`
	CanonicalName     string            `json:"canonicalName"`
	Version           string            `json:"version"`
	Revision          string            `json:"revision"`
	Title             string            `json:"title"`
	Description       string            `json:"description"`
	OwnerDomain       string            `json:"ownerDomain"`
	OwnerName         string            `json:"ownerName"`
	DocumentationLink string            `json:"documentationLink"`
	Protocol          string            `json:"protocol"`
	BaseURL           string            `json:"baseUrl"`
	BasePath          string            `json:"basePath"`
	RootURL           string            `json:"rootUrl"`
	ServicePath       string            `json:"servicePath"`
	BatchPath         string            `json:"batchPath"`
	Parameters        map[string]Schema `json:"parameters"`
	Schemas           map[string]Schema `json:"schemas"`
	Resources         map[string]Method `json:"resources"`
}

Service is the Intermediary representation of a Service

type Type

type Type struct {
	Type     string  `json:"type"`
	Format   *string `json:"format,omitempty"`
	PointsTo *Type   `json:"ptr_to"`
	ArrayOf  *Type   `json:"arry_of"`
}

Type is the

Jump to

Keyboard shortcuts

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