pkg

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pkg of mkpipsrv utility provides data schema for generator input and generation logic itself.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	Args []string

	Result string
	// contains filtered or unexported fields
}

Endpoint defines input arguments for request and result of response. All arguments are required.

type Schema

type Schema struct {
	Package   string
	Endpoints map[string]*Endpoint
}

Schema is a root data structure for generator input. It holds name of package to generate and set of endpoints for data handlers. Currently, only single endpoint with "*" key accepted. The endpoint is responsible for processing of any request.

func NewSchemaFromFile

func NewSchemaFromFile(path string) (s *Schema, err error)

NewSchemaFromFile reads schema from given YAML file.

func (*Schema) Generate

func (s *Schema) Generate(root string) error

Generate creates a package according to the schema inside given directory. It makes a subdirectory with name of the package in the given directory and places code to the subdirectory.

Jump to

Keyboard shortcuts

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