codegen

package
v1.109.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 24 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

* Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. * SPDX-License-Identifier: Apache-2.0

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) (any, error), generationType string) (err error)

func CopyStaticFiles

func CopyStaticFiles(ctx context.Context, staticFileConfig *StaticFileConfig) (err error)

func GenerateTemplateFile

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

func ParseDeclarations

func ParseDeclarations(src string) ([]ast.Decl, error)

func ParseFile

func ParseFile(src string) (*ast.File, error)

func ParseStatements

func ParseStatements(src string, fset *token.FileSet) ([]ast.Stmt, 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
	NoPagination  bool
}

type CollectionOption

type CollectionOption interface {
	// contains filtered or unexported methods
}

func WithNoPagination

func WithNoPagination(n bool) CollectionOption

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
	DisableLinks      bool
}

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"`
	DisableLinks      bool   `mapstructure:"disable_links"`
}

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

type StaticFileConfig

type StaticFileConfig struct {
	ClientName  string
	Destination string
	Exclusions  []string
}

func GenerateStaticFileConfigStruct

func GenerateStaticFileConfigStruct(cfg ExtensionsConfig) (d *StaticFileConfig, err error)

Jump to

Keyboard shortcuts

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