python

package
v0.0.0-...-ce83e3f Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChildProperties

func ChildProperties(Properties map[string]interface{}) []raml.Property

ChildProperties returns child properties of a property

func GenerateAllClasses

func GenerateAllClasses(apiDef *raml.APIDefinition, dir string, capnp bool) ([]string, error)

generate all python classes from a RAML document

func GeneratePythonCapnpClasses

func GeneratePythonCapnpClasses(apiDef *raml.APIDefinition, dir string) error

GeneratePythonCapnpClasses generates python classes from a raml definition along with function to load binaries from/to capnp and generates the needed capnp schemas

func NewServer

func NewServer(kind string, apiDef *raml.APIDefinition, apiDocsDir, targetDir string,
	withMain bool, libRootURLs []string, name string) generator.Server

NewServer creates a new python server

Types

type Client

type Client struct {
	Name               string
	APIDef             *raml.APIDefinition
	BaseURI            string
	Classes            []string
	Services           map[string]*service
	Kind               string
	Template           clientTemplate
	UnmarshallResponse bool // true if response body should be unmarshalled into python class
	Securities         []pythonSecurity
}

Client represents a python client

func NewClient

func NewClient(apiDef *raml.APIDefinition, kind string, unmarshallResponse bool) Client

NewClient creates a python Client

func (Client) ClientKind

func (c Client) ClientKind() string

func (Client) Generate

func (c Client) Generate(dir string) error

Generate generates python client library files

type FlaskServer

type FlaskServer struct {
	APIDef       *raml.APIDefinition
	Title        string
	ResourcesDef []pythonResource
	WithMain     bool

	Gevent   bool
	Template serverTemplate

	Name string
	// contains filtered or unexported fields
}

FlaskServer represents a flask server

func NewFlaskServer

func NewFlaskServer(apiDef *raml.APIDefinition, apiDocsDir, targetDir string,
	withMain bool, libRootURLs []string, gevent bool, name string) *FlaskServer

NewFlaskServer creates new flask server from an RAML file

func (*FlaskServer) APIDocsDir

func (ps *FlaskServer) APIDocsDir() string

APIDocsDir implements generator.Server.APIDocsDir interface

func (*FlaskServer) Generate

func (ps *FlaskServer) Generate() error

Generate implements generator.Server.Generate interface

func (*FlaskServer) ShowAPIDocsAndIndex

func (ps *FlaskServer) ShowAPIDocsAndIndex() bool

type SanicServer

type SanicServer struct {
	APIDef       *raml.APIDefinition
	Title        string
	ResourcesDef []pythonResource

	Template serverTemplate
	// contains filtered or unexported fields
}

SanicServer represents a sanic asyncio server

func NewSanicServer

func NewSanicServer(apiDef *raml.APIDefinition, apiDocsDir, targetDir string, withMain bool,
	libRootURLs []string) *SanicServer

NewSanicServer creates new sanic server from an RAML file

func (*SanicServer) APIDocsDir

func (s *SanicServer) APIDocsDir() string

APIDocsDir implements generator.Server.APIDocsDir interface

func (*SanicServer) Generate

func (s *SanicServer) Generate() error

Generate implements generator.Server.Generate interface

func (*SanicServer) ShowAPIDocsAndIndex

func (s *SanicServer) ShowAPIDocsAndIndex() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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