-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Go implementation for manifestYamlDoc and escapeStringJson (#742)
* Builtins for escapeStringJson and manifestYamlDoc * Benchmark and tests
- Loading branch information
Showing
10 changed files
with
453 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
std.escapeStringJson("Lorem ipsum dolor sit amet, consectetur \"adipiscing\" elit. Nullam \\nec sagittis \\u0065lit, sed do \\teiusmod tempor incididunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco \flaboris nisi ut aliquip ex ea commodo consequat.\rDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n\tExcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit \\anim id est laborum.\nCurabitur pretium tincidunt lacus. Nulla gravida orci a odio. \\Nullam varius, turpis et commodo pharetra, est eros bibendum elit, nec luctus magna felis sollicitudin mauris.\nInteger in mauris eu nibh euismod gravida. Duis ac tellus et risus vulputate vehicula. Donec lobortis risus a elit. Etiam tempor. Ut ullamcorper, ligula eu tempor congue, eros est euismod turpis, id tincidunt sapien risus a quam. Maecenas fermentum consequat mi. Donec fermentum. Pellentesque malesuada nulla a mi. Duis sapien sem, aliquet nec, commodo eget, consequat quis, neque. Aliquam faucibus, elit ut dictum aliquet, felis nisl adipiscing sapien, sed malesuada diam lacus eget erat. Cras mollis scelerisque nunc. Nullam arcu. Aliquam consequat. Curabitur augue lorem, dapibus quis, laoreet et, pretium ac, nisi. Aenean magna nisl, mollis quis, molestie eu, feugiat in, orci. In hac habitasse platea dictumst.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{ | ||
bar: { | ||
prometheusOperator+: { | ||
service+: { | ||
spec+: { | ||
ports: [ | ||
{ | ||
name: 'https', | ||
port: 8443, | ||
targetPort: 'https', | ||
}, | ||
], | ||
}, | ||
}, | ||
serviceMonitor+: { | ||
spec+: { | ||
endpoints: [ | ||
{ | ||
port: 'https', | ||
scheme: 'https', | ||
honorLabels: true, | ||
bearerTokenFile: '/var/run/secrets/kubernetes.io/serviceaccount/token', | ||
tlsConfig: { | ||
insecureSkipVerify: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
clusterRole+: { | ||
rules+: [ | ||
{ | ||
apiGroups: ['authentication.k8s.io'], | ||
resources: ['tokenreviews'], | ||
verbs: ['create'], | ||
}, | ||
{ | ||
apiGroups: ['authorization.k8s.io'], | ||
resources: ['subjectaccessreviews'], | ||
verbs: ['create'], | ||
}, | ||
], | ||
}, | ||
}, | ||
additional+: { | ||
'$schema': "http://json-schema.org/draft-07/schema#", | ||
'09': ['no', 'yes'], | ||
}, | ||
}, | ||
nothing: std.manifestYamlDoc(self.bar, indent_array_in_object=true, quote_keys=true), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.