Movatterモバイル変換


[0]ホーム

URL:


types

package
v0.0.1Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License:AGPL-3.0Imports:12Imported by:2

Details

Repository

github.com/coder/preview

Links

Documentation

Index

Constants

View Source
const (BlockTypeParameter    = "coder_parameter"BlockTypeWorkspaceTag = "coder_workspace_tag"ValidationMonotonicIncreasing = "increasing"ValidationMonotonicDecreasing = "decreasing")

@typescript-ignore BlockTypeParameter@typescript-ignore BlockTypeWorkspaceTag

View Source
const (UnknownStringValue = "??")

Variables

This section is empty.

Functions

funcCtyValueString

func CtyValueString(valcty.Value) (string,error)

CtyValueString converts a cty.Value to a string.It supports only primitive types - bool, number, and string.As a special case, it also supports map[string]interface{} with key "value".

funcSortParameters

func SortParameters(lists []Parameter)

Types

typeDiagnosticSeverityString

type DiagnosticSeverityStringstring
const (DiagnosticSeverityErrorDiagnosticSeverityString = "error"DiagnosticSeverityWarningDiagnosticSeverityString = "warning")

typeDiagnostics

type Diagnostics hcl.Diagnostics

Diagnostics is a JSON friendly form of hcl.Diagnostics.Data is lost when doing a json marshal.

func (Diagnostics)MarshalJSON

func (dDiagnostics) MarshalJSON() ([]byte,error)

typeFriendlyDiagnostic

type FriendlyDiagnostic struct {SeverityDiagnosticSeverityString `json:"severity"`Summarystring                   `json:"summary"`Detailstring                   `json:"detail"`}

typeHCLString

type HCLString struct {Valuecty.Value// ValueDiags are any diagnostics that occurred// while evaluating the valueValueDiags hcl.Diagnostics// ValueExp is the underlying source expressionValueExpr hcl.Expression// Source is the literal hcl text that was parsed.// This is a best effort, it may not be available.Source *string}

@typescript-ignore HCLString

funcStringLiteral

func StringLiteral(sstring)HCLString

funcToHCLString

func ToHCLString(block *terraform.Block, attr *terraform.Attribute)HCLString

func (HCLString)AsString

func (sHCLString) AsString()string

AsString is a safe function. It will always return a string.The caller should check if this value is Valid and known beforecalling this function.

func (HCLString)IsKnown

func (sHCLString) IsKnown()bool

func (HCLString)MarshalJSON

func (sHCLString) MarshalJSON() ([]byte,error)

func (*HCLString)UnmarshalJSON

func (s *HCLString) UnmarshalJSON(data []byte)error

func (HCLString)Valid

func (sHCLString) Valid()bool

typeNullHCLString

type NullHCLString struct {Valuestring `json:"value"`Validbool   `json:"valid"`}

typeParameter

type Parameter struct {ParameterData// Value is not immediately cast into a string.// Value is not required at template import, so defer// casting to a string until it is absolutely necessary.ValueHCLString `json:"value"`// Diagnostics is used to store any errors that occur during parsing// of the parameter.DiagnosticsDiagnostics `json:"diagnostics"`}

typeParameterData

type ParameterData struct {Namestring                     `json:"name"`DisplayNamestring                     `json:"display_name"`Descriptionstring                     `json:"description"`TypeParameterType              `json:"type"`FormTypeprovider.ParameterFormType `json:"form_type"`Stylingany                        `json:"styling"`Mutablebool                       `json:"mutable"`DefaultValueHCLString                  `json:"default_value"`Iconstring                     `json:"icon"`Options      []*ParameterOption         `json:"options"`Validations  []*ParameterValidation     `json:"validations"`Requiredbool                       `json:"required"`// legacy_variable_name was removed (= 14)Orderint64 `json:"order"`Ephemeralbool  `json:"ephemeral"`// Unexported fields, not always available.Source *terraform.Block `json:"-"`}

func (*ParameterData)CtyType

func (r *ParameterData) CtyType() (cty.Type,error)

CtyType returns the cty.Type for the ParameterData.A fixed set of types are supported.

typeParameterOption

type ParameterOption struct {Namestring    `json:"name"`Descriptionstring    `json:"description"`ValueHCLString `json:"value"`Iconstring    `json:"icon"`}

typeParameterType

type ParameterTypestring
const (ParameterTypeStringParameterType = "string"ParameterTypeNumberParameterType = "number"ParameterTypeBooleanParameterType = "bool"ParameterTypeListStringParameterType = "list(string)")

func (ParameterType)Valid

func (tParameterType) Valid()error

typeParameterValidation

type ParameterValidation struct {Errorstring `json:"validation_error"`// All validation attributes are optional.Regex     *string `json:"validation_regex"`Min       *int64  `json:"validation_min"`Max       *int64  `json:"validation_max"`Monotonic *string `json:"validation_monotonic"`Invalid   *bool   `json:"validation_invalid"`}

func (ParameterValidation)Valid

func (vParameterValidation) Valid(typstring, valuestring)error

Valid takes the type of the value and the value itself and returns an errorif the value is invalid.

typeTag

type Tag struct {KeyHCLStringValueHCLString}

@typescript-ignore Tag

func (Tag)AsStrings

func (tTag) AsStrings() (string,string)

func (Tag)IsKnown

func (tTag) IsKnown()bool

func (Tag)KeyString

func (tTag) KeyString()string

func (Tag)References

func (tTag) References() []string

func (Tag)Valid

func (tTag) Valid()bool

typeTagBlock

type TagBlock struct {TagsTagsBlock *terraform.Block}

@typescript-ignore TagBlock

func (TagBlock)UnusableTags

func (bTagBlock) UnusableTags()Tags

func (TagBlock)ValidTags

func (bTagBlock) ValidTags() map[string]string

typeTagBlocks

type TagBlocks []TagBlock

@typescript-ignore TagBlocks

func (TagBlocks)Tags

func (bTagBlocks) Tags() map[string]string

func (TagBlocks)UnusableTags

func (bTagBlocks) UnusableTags()Tags

typeTags

type Tags []Tag

@typescript-ignore Tags

func (Tags)SafeNames

func (tTags) SafeNames() []string

typeWorkspaceOwner

type WorkspaceOwner struct {IDstring `json:"id" cty:"id"`Namestring `json:"name" cty:"name"`FullNamestring `json:"full_name" cty:"full_name"`Emailstring `json:"email" cty:"email"`SSHPublicKeystring `json:"ssh_public_key" cty:"ssh_public_key"`// SSHPrivateKey is intentionally omitted for now, due to the security risk// that exposing it poses.// SSHPrivateKey string `json:"ssh_private_key" cty:"ssh_private_key"`Groups []string `json:"groups" cty:"groups"`// SessionToken is intentionally omitted for now, due to the security risk// that exposing it poses.// SessionToken string `json:"session_token" cty:"session_token"`// OIDCAccessToken is intentionally omitted for now, due to the security risk// that exposing it poses.// OIDCAccessToken string `json:"oidc_access_token" cty:"oidc_access_token"`LoginTypestring                   `json:"login_type" cty:"login_type"`RBACRoles []WorkspaceOwnerRBACRole `json:"rbac_roles" cty:"rbac_roles"`}

Based onhttps://github.com/coder/terraform-provider-coder/blob/9a745586b23a9cb5de2f65a2dcac12e48b134ffa/provider/workspace_owner.go#L72

func (*WorkspaceOwner)ToCtyValue

func (o *WorkspaceOwner) ToCtyValue() (cty.Value,error)

typeWorkspaceOwnerRBACRole

type WorkspaceOwnerRBACRole struct {Namestring `json:"name" cty:"name"`OrgIDstring `json:"org_id" cty:"org_id"`}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp