format

package
v0.0.0-...-dc5593a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAME        = "Name"
	ARGUMENT    = "Argument"
	ATTRIBUTE   = "Attribute"
	OPTIONAL    = "Optional"
	FORCENEW    = "ForceNew"
	REQUIRED    = "Required"
	TYPE        = "Type"
	DESCRIPTION = "Description"
	PARAMS      = "params"
)
View Source
const (
	DATA     = "data"
	RESOURCE = "resource"
)

source and data

View Source
const (
	EMPTY = "nil"

	// accessKey and secretKey
	ACCESS_KEY     = "ALICLOUD_ACCESS_KEY"
	SECRET_KEY     = "ALICLOUD_SECRET_KEY"
	REGION         = "ALICLOUD_REGION"
	DEFAULT_REGION = "cn-hangzhou"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name        string   `json:"name"`
	Description []string `json:"description"` // description need to split by .
	Optional    bool     `json:"optional"`
	Required    bool     `json:"required"`
	ForceNew    bool     `json:"force_new"`
	Detail      string   `json:"detail"` // details url
}

type Resource

type Resource struct {
	Region string
	Names  []string

	// first key is resource name
	// second key is fields
	Fields map[string]map[string]interface{}
	// contains filtered or unexported fields
}

func NewResource

func NewResource(version string, rs []string) (*Resource, error)

func (*Resource) Cleanup

func (r *Resource) Cleanup()

func (*Resource) Format

func (r *Resource) Format() error

type SchemaMapping

type SchemaMapping struct {
	Type    string  `json:"type"`    // like data and resource
	Name    string  `json:"name"`    // like cs_kubernetes, cs_managed_kubernetes
	Version string  `json:"version"` // like 1.173.0
	Url     string  `json:"url"`     // doc url from hashicorp
	Fields  []Field `json:"fields"`  // schema
}

func NewSchemaMapping

func NewSchemaMapping(version string, typ string, name string) *SchemaMapping

NewSchemaMapping get SchemaMapping name like kubernetes

func (*SchemaMapping) Format

func (sm *SchemaMapping) Format() error

Jump to

Keyboard shortcuts

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