codegen

package
v0.0.0-...-594fbdb Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ValidGenerationTargets = map[string]func(*Data) error{
	"collections": AddCollectionsToParams,
	"jobs":        AddJobItemsToParams,
	"links":       AddLinkFollowersToParams,
}

Functions

func AddCollectionsToParams

func AddCollectionsToParams(d *Data) (err error)

func AddJobItemsToParams

func AddJobItemsToParams(d *Data) (err error)

func AddLinkFollowersToParams

func AddLinkFollowersToParams(d *Data) error

func AddValuesToParams

func AddValuesToParams(d *Data, getValues func(*openapi3.T) (interface{}, error), generationType string) (err error)

func CopyStaticFiles

func CopyStaticFiles(ctx context.Context, clientName string, destination string) (err error)

func GenerateTemplateFile

func GenerateTemplateFile(ctx context.Context, d *Data) (err error)

Types

type APIServiceFollowFunc

type APIServiceFollowFunc struct {
	Name           string
	FirstParamName string
	FirstParamType string
	ReturnList     string
	Src            string
}

type Collection

type Collection struct {
	CollectionRef string
	ItemRef       string
	ModelRef      string
	IteratorRef   string
}

type CollectionParams

func GetCollections

func GetCollections(swagger *openapi3.T) (collections CollectionParams, err error)

type Collections

type Collections = []Collection

type Data

type Data struct {
	Params            any
	SpecPath          string
	TemplatePath      string
	DestinationPath   string
	ClientPackagePath string
	PackageName       string
}

func GenerateDataStruct

func GenerateDataStruct(cfg ExtensionsConfig) (d *Data, err error)

type ExtensionsConfig

type ExtensionsConfig struct {
	Input             string `mapstructure:"input"`
	Output            string `mapstructure:"output"`
	Template          string `mapstructure:"template"`
	GenerateType      string `mapstructure:"generate_type"`
	ClientPackagePath string `mapstructure:"client_path"`
}

func DefaultExtensionsConfig

func DefaultExtensionsConfig() *ExtensionsConfig

func (*ExtensionsConfig) Validate

func (cfg *ExtensionsConfig) Validate() error

type Follower

type Follower struct {
	APIService    string
	APIRequest    string
	APIFollowFunc APIServiceFollowFunc
}

type Followers

type Followers = []Follower

type FollowersParams

type FollowersParams = struct {
	Followers
}

type JobItem

type JobItem struct {
	JobItemSchema string
}

type JobItems

type JobItems = []JobItem

type JobItemsParams

type JobItemsParams = struct {
	JobItems
}

func GetJobItems

func GetJobItems(swagger *openapi3.T) (jobItems JobItemsParams, err error)

type MessageCollection

type MessageCollection struct {
	ItemRef     string
	IteratorRef string
}

type MessageCollections

type MessageCollections []MessageCollection

type NotificationFeedCollection

type NotificationFeedCollection struct {
	ItemRef     string
	IteratorRef string
}

type NotificationFeedCollections

type NotificationFeedCollections []NotificationFeedCollection

Jump to

Keyboard shortcuts

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