config

package
v0.0.0-...-eead4ef Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const Root = "github.com/Azure/azure-sdk-for-go"

Variables

This section is empty.

Functions

func FromReader

func FromReader(reader io.Reader) *parser

func GetTypeSpecProjectsFromConfig

func GetTypeSpecProjectsFromConfig(config *Config, specRoot string) (tspProjects map[string][]TypeSpecPakcageInfo, errResult error)

func ParseTrack2

func ParseTrack2(config *Config, specRoot string) (armServices map[string][]common.PackageInfo, errResult error)

Types

type ArgumentOption

type ArgumentOption interface {
	Option
	Argument() string
}

ArgumentOption is an option not starting with '--' or '-'

type Config

type Config struct {
	Track2Requests   Track2ReleaseRequests   `json:"track2Requests,omitempty"`
	TypeSpecRequests TypeSpecReleaseRequests `json:"typespecRequests,omitempty"`
	RefreshInfo      RefreshInfo             `json:"refresh,omitempty"`
	AdditionalFlags  []string                `json:"additionalOptions,omitempty"`
}

func ParseConfig

func ParseConfig(path string) (*Config, error)

func (Config) AdditionalOptions

func (c Config) AdditionalOptions() ([]Option, error)

func (Config) String

func (c Config) String() string

type FlagOption

type FlagOption interface {
	Option
	Flag() string
}

FlagOption is an option that starts with '--' but do not have a value

type KeyValueOption

type KeyValueOption interface {
	Option
	Key() string
	Value() string
}

KeyValueOption is an option that starts with '--' and have a value

type Option

type Option interface {
	// Type returns the type of this option
	Type() OptionType
	// Format returns the actual option in string
	Format() string
}

Option describes an option of a autorest command line

func NewArgument

func NewArgument(value string) Option

NewArgument returns a new argument option (without "--")

func NewFlagOption

func NewFlagOption(flag string) Option

NewFlagOption returns a flag option (with "--", without value)

func NewKeyValueOption

func NewKeyValueOption(key, value string) Option

NewKeyValueOption returns a key-value option like "--tag=something"

func NewOption

func NewOption(input string) (Option, error)

NewOption returns an Option from a formatted string. We should hold this result using this function: input == result.Format()

type OptionType

type OptionType string

OptionType describes the type of the option, possible values are 'Argument', 'Flag' or 'KeyValue'

const (
	// Argument ...
	Argument OptionType = "Argument"
	// Flag ...
	Flag OptionType = "Flag"
	// KeyValue ...
	KeyValue OptionType = "KeyValue"
)

type Options

type Options interface {
	// Arguments returns the argument defined in this options
	Arguments() []Option
	// CodeGeneratorVersion returns the code generator version defined in this options
	CodeGeneratorVersion() string
	// MergeOptions merges the current options with the given options
	MergeOptions(other ...Option) Options
}

Options ...

func MergeOptions

func MergeOptions(options Options, other ...Option) Options

MergeOptions will merge the given options and new option slice, and return a new Options instance

func NewOptions

func NewOptions(options ...Option) Options

NewOptions returns a new instance of Options with the give slice of Option

func ParseOptions

func ParseOptions(raw []string) (Options, error)

ParseOptions returns an Options instance by parsing the given raw option strings

type RefreshInfo

type RefreshInfo struct {
	// AdditionalFlags are the additional options that will be used in the general refresh
	AdditionalFlags []string `json:"additionalOptions,omitempty"`
	// Packages are the full package identifier of the packages to refresh, eg 'github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight'
	Packages []string `json:"packages,omitempty"`
}

func (RefreshInfo) AdditionalOptions

func (r RefreshInfo) AdditionalOptions() ([]Option, error)

func (RefreshInfo) RelativePackages

func (r RefreshInfo) RelativePackages() []string

func (RefreshInfo) String

func (r RefreshInfo) String() string

type ReleaseRequestInfo

type ReleaseRequestInfo struct {
	TargetDate  *time.Time `json:"targetDate,omitempty"`
	RequestLink string     `json:"requestLink,omitempty"`
}

func (ReleaseRequestInfo) HasTargetDate

func (info ReleaseRequestInfo) HasTargetDate() bool

func (ReleaseRequestInfo) String

func (info ReleaseRequestInfo) String() string

type Track2ReleaseRequests

type Track2ReleaseRequests map[string][]Track2Request

func (Track2ReleaseRequests) Add

func (c Track2ReleaseRequests) Add(readme string, info Track2Request)

func (Track2ReleaseRequests) Contains

func (c Track2ReleaseRequests) Contains(readme string) bool

func (Track2ReleaseRequests) String

func (c Track2ReleaseRequests) String() string

type Track2Request

type Track2Request struct {
	ReleaseRequestInfo
	PackageFlag string `json:"packageFlag,omitempty"`
}

type TypeSpecPakcageInfo

type TypeSpecPakcageInfo struct {
	common.PackageInfo
	TspConfigPath string
}

type TypeSpecReleaseRequests

type TypeSpecReleaseRequests map[string][]Track2Request

func (TypeSpecReleaseRequests) Add

func (c TypeSpecReleaseRequests) Add(tspConfig string, info Track2Request)

func (TypeSpecReleaseRequests) Contains

func (c TypeSpecReleaseRequests) Contains(tspConfig string) bool

func (TypeSpecReleaseRequests) String

func (c TypeSpecReleaseRequests) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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