component

package
v0.7.76 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	GetNextErrorCode() string
	Write() error
}

type Info

type Info struct {
	Name          string `yaml:"name" json:"name"`                       // the name of the component, e.g. "kuma"
	Type          string `yaml:"type" json:"type"`                       // the type of the component, e.g. "adapter"
	NextErrorCode int    `yaml:"next_error_code" json:"next_error_code"` // the next error code to use. this value will be updated automatically.
	// contains filtered or unexported fields
}

Info specifies type, name, and the next error code of the current component. Refer to the corresponding design document for valid types and names, extend if necessary.

func New

func New(dir string) (*Info, error)

New reads the file component_info.json from dir and returns an info struct

func (*Info) GetNextErrorCode

func (i *Info) GetNextErrorCode() string

GetNextErrorCode returns the next error code (an int) as a string, and increments to the next error code.

func (*Info) Write

func (i *Info) Write() error

Write writes the component info back to file.

Jump to

Keyboard shortcuts

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