sta

package
v28.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 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

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

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

func Command

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

func (c Cmd) Command() []string

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

type Option

type Option func(*configs)

Option configures Generate configs.

func WithCommand

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