-
Notifications
You must be signed in to change notification settings - Fork 1
/
Names.go
88 lines (75 loc) · 2.49 KB
/
Names.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package cdk8s
import (
_jsii_ "github.com/aws/jsii-runtime-go/runtime"
_init_ "github.com/cdk8s-team/cdk8s-core-go/cdk8s/jsii"
"github.com/aws/constructs-go/constructs/v3"
)
// Utilities for generating unique and stable names.
type Names interface {
}
// The jsii proxy struct for Names
type jsiiProxy_Names struct {
_ byte // padding
}
// Generates a unique and stable name compatible DNS_LABEL from RFC-1123 from a path.
//
// The generated name will:
// - contain at most 63 characters
// - contain only lowercase alphanumeric characters or ‘-’
// - start with an alphanumeric character
// - end with an alphanumeric character
//
// The generated name will have the form:
// <comp0>-<comp1>-..-<compN>-<short-hash>
//
// Where <comp> are the path components (assuming they are is separated by
// "/").
//
// Note that if the total length is longer than 63 characters, we will trim
// the first components since the last components usually encode more meaning.
func Names_ToDnsLabel(scope constructs.Construct, options *NameOptions) *string {
_init_.Initialize()
if err := validateNames_ToDnsLabelParameters(scope, options); err != nil {
panic(err)
}
var returns *string
_jsii_.StaticInvoke(
"cdk8s.Names",
"toDnsLabel",
[]interface{}{scope, options},
&returns,
)
return returns
}
// Generates a unique and stable name compatible label key name segment and label value from a path.
//
// The name segment is required and must be 63 characters or less, beginning
// and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-),
// underscores (_), dots (.), and alphanumerics between.
//
// Valid label values must be 63 characters or less and must be empty or
// begin and end with an alphanumeric character ([a-z0-9A-Z]) with dashes
// (-), underscores (_), dots (.), and alphanumerics between.
//
// The generated name will have the form:
// <comp0><delim><comp1><delim>..<delim><compN><delim><short-hash>
//
// Where <comp> are the path components (assuming they are is separated by
// "/").
//
// Note that if the total length is longer than 63 characters, we will trim
// the first components since the last components usually encode more meaning.
func Names_ToLabelValue(scope constructs.Construct, options *NameOptions) *string {
_init_.Initialize()
if err := validateNames_ToLabelValueParameters(scope, options); err != nil {
panic(err)
}
var returns *string
_jsii_.StaticInvoke(
"cdk8s.Names",
"toLabelValue",
[]interface{}{scope, options},
&returns,
)
return returns
}