ukargparse

package
v0.6.7-365-gf92f5b2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Param

type Param interface {
	// The canonical name of the parameter which is understood by Unikraft.
	Name() string

	// Set the value of the parameter.
	Set(any)

	// Get the value of the parameter.
	Value() any

	// String returns the fully qualified parameter ready to be accepted by
	// Unikraft.
	String() string

	// A method-chain mechanism for both setting and getting the Param with the
	// newly embedded value.
	WithValue(any) Param
}

func NewParamStrSlice added in v0.6.5

func NewParamStrSlice(lib string, name string, values any) Param

NewParamStrSlice instantiates a new Param based on a slice of strings.

func ParamStr

func ParamStr(lib string, name string, value any) Param

ParamStr instantiates a new Param based on a string value.

func ParamStrMap added in v0.6.5

func ParamStrMap(lib string, name string, values any) Param

ParamStr instantiates a new Param based on a string value.

type ParamStrSlice added in v0.6.5

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

func (*ParamStrSlice) Name added in v0.6.5

func (param *ParamStrSlice) Name() string

Name implements Param

func (*ParamStrSlice) Set added in v0.6.5

func (param *ParamStrSlice) Set(value any)

Set implements Param

func (*ParamStrSlice) String added in v0.6.5

func (param *ParamStrSlice) String() string

String implements Param

func (*ParamStrSlice) Value added in v0.6.5

func (param *ParamStrSlice) Value() any

Value implements Param

func (*ParamStrSlice) WithValue added in v0.6.5

func (param *ParamStrSlice) WithValue(value any) Param

WithValue implements Param

type Params

type Params []Param

func Parse

func Parse(args ...string) (Params, error)

Parse accepts varadic length position argument args which represent Unikraft command-line arguments and returns structured Params.

func (Params) Contains

func (params Params) Contains(needle Param) bool

Contains checks whether the provided needle exists within the existing set of Params.

func (Params) Strings

func (params Params) Strings() []string

Strings returns all parameters and their string representation which is ready to be accepted by Unikraft.

Jump to

Keyboard shortcuts

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