sta

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package sta provides access to swagger-typescript-api CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(ctx context.Context, outPath, specPath string, options ...Option) error

Generate generates client code and TS types to outPath from an OpenAPI spec that resides at specPath.

Types

type Cmd added in v0.24.0

type Cmd struct {
	// contains filtered or unexported fields
}

Cmd contains the information necessary to execute the typescript API generator command.

func Command added in v0.24.0

func Command() (command Cmd, cleanup func(), err error)

Command sets the typescript API generator binary up and returns the command needed to execute it.

func (Cmd) Command added in v0.24.0

func (c Cmd) Command() []string

Command returns the strings to execute the typescript API generator command.

type Option added in v0.24.0

type Option func(*configs)

Option configures Generate configs.

func WithCommand added in v0.24.0

func WithCommand(command Cmd) Option

WithCommand assigns a typescript API generator command to use for code generation. This allows to use a single nodetime STA generator binary in multiple code generation calls. Otherwise, `Generate` creates a new generator binary each time it is called.

Jump to

Keyboard shortcuts

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