_id stringlengths 2 7 | title stringlengths 1 118 | partition stringclasses 3
values | text stringlengths 52 85.5k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q34800 | checkOptions | train | func checkOptions(options map[string]interface{}) (tokenAccessOptions, error) {
var opts tokenAccessOptions
keys := []string{"realm", "issuer", "service", "rootcertbundle"}
vals := make([]string, 0, len(keys))
for _, key := range keys {
val, ok := options[key].(string)
if !ok {
return opts, fmt.Errorf("toke... | go | {
"resource": ""
} |
q34801 | newAccessController | train | func newAccessController(options map[string]interface{}) (auth.AccessController, error) {
config, err := checkOptions(options)
if err != nil {
return nil, err
}
fp, err := os.Open(config.rootCertBundle)
if err != nil {
return nil, fmt.Errorf("unable to open token auth root certificate bundle file %q: %s", con... | go | {
"resource": ""
} |
q34802 | Authorized | train | func (ac *accessController) Authorized(ctx context.Context, accessItems ...auth.Access) (context.Context, error) {
challenge := &authChallenge{
realm: ac.realm,
autoRedirect: ac.autoRedirect,
service: ac.service,
accessSet: newAccessSet(accessItems...),
}
req, err := dcontext.GetRequest(ctx)
... | go | {
"resource": ""
} |
q34803 | NewManifestBuilder | train | func NewManifestBuilder(bs distribution.BlobService, configJSON []byte, annotations map[string]string) distribution.ManifestBuilder {
mb := &Builder{
bs: bs,
configJSON: make([]byte, len(configJSON)),
annotations: annotations,
mediaType: v1.MediaTypeImageManifest,
}
copy(mb.configJSON, configJSON... | go | {
"resource": ""
} |
q34804 | newSafeMetrics | train | func newSafeMetrics() *safeMetrics {
var sm safeMetrics
sm.Statuses = make(map[string]int)
return &sm
} | go | {
"resource": ""
} |
q34805 | register | train | func register(e *Endpoint) {
endpoints.mu.Lock()
defer endpoints.mu.Unlock()
endpoints.registered = append(endpoints.registered, e)
} | go | {
"resource": ""
} |
q34806 | NewGaugeVec | train | func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec {
desc := NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
labelNames,
opts.ConstLabels,
)
return &GaugeVec{
metricVec: newMetricVec(desc, func(lvs ...string) Metric {
if len(lvs) != len(desc.variableLabels) {
... | go | {
"resource": ""
} |
q34807 | NewGaugeFunc | train | func NewGaugeFunc(opts GaugeOpts, function func() float64) GaugeFunc {
return newValueFunc(NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
nil,
opts.ConstLabels,
), GaugeValue, function)
} | go | {
"resource": ""
} |
q34808 | Describe | train | func (e *expvarCollector) Describe(ch chan<- *Desc) {
for _, desc := range e.exports {
ch <- desc
}
} | go | {
"resource": ""
} |
q34809 | gzipAccepted | train | func gzipAccepted(header http.Header) bool {
a := header.Get(acceptEncodingHeader)
parts := strings.Split(a, ",")
for _, part := range parts {
part = strings.TrimSpace(part)
if part == "gzip" || strings.HasPrefix(part, "gzip;") {
return true
}
}
return false
} | go | {
"resource": ""
} |
q34810 | httpError | train | func httpError(rsp http.ResponseWriter, err error) {
rsp.Header().Del(contentEncodingHeader)
http.Error(
rsp,
"An error has occurred while serving metrics:\n\n"+err.Error(),
http.StatusInternalServerError,
)
} | go | {
"resource": ""
} |
q34811 | ObserveDuration | train | func (t *Timer) ObserveDuration() time.Duration {
d := time.Since(t.begin)
if t.observer != nil {
t.observer.Observe(d.Seconds())
}
return d
} | go | {
"resource": ""
} |
q34812 | InstrumentHandlerInFlight | train | func InstrumentHandlerInFlight(g prometheus.Gauge, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
g.Inc()
defer g.Dec()
next.ServeHTTP(w, r)
})
} | go | {
"resource": ""
} |
q34813 | newMetricVec | train | func newMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *metricVec {
return &metricVec{
metricMap: &metricMap{
metrics: map[uint64][]metricWithLabelValues{},
desc: desc,
newMetric: newMetric,
},
hashAdd: hashAdd,
hashAddByte: hashAddByte,
}
} | go | {
"resource": ""
} |
q34814 | Reset | train | func (m *metricMap) Reset() {
m.mtx.Lock()
defer m.mtx.Unlock()
for h := range m.metrics {
delete(m.metrics, h)
}
} | go | {
"resource": ""
} |
q34815 | deleteByHashWithLabelValues | train | func (m *metricMap) deleteByHashWithLabelValues(
h uint64, lvs []string, curry []curriedLabelValue,
) bool {
m.mtx.Lock()
defer m.mtx.Unlock()
metrics, ok := m.metrics[h]
if !ok {
return false
}
i := findMetricWithLabelValues(metrics, lvs, curry)
if i >= len(metrics) {
return false
}
if len(metrics) > ... | go | {
"resource": ""
} |
q34816 | deleteByHashWithLabels | train | func (m *metricMap) deleteByHashWithLabels(
h uint64, labels Labels, curry []curriedLabelValue,
) bool {
m.mtx.Lock()
defer m.mtx.Unlock()
metrics, ok := m.metrics[h]
if !ok {
return false
}
i := findMetricWithLabels(m.desc, metrics, labels, curry)
if i >= len(metrics) {
return false
}
if len(metrics) >... | go | {
"resource": ""
} |
q34817 | getMetricWithHashAndLabelValues | train | func (m *metricMap) getMetricWithHashAndLabelValues(
h uint64, lvs []string, curry []curriedLabelValue,
) (Metric, bool) {
metrics, ok := m.metrics[h]
if ok {
if i := findMetricWithLabelValues(metrics, lvs, curry); i < len(metrics) {
return metrics[i].metric, true
}
}
return nil, false
} | go | {
"resource": ""
} |
q34818 | getMetricWithHashAndLabels | train | func (m *metricMap) getMetricWithHashAndLabels(
h uint64, labels Labels, curry []curriedLabelValue,
) (Metric, bool) {
metrics, ok := m.metrics[h]
if ok {
if i := findMetricWithLabels(m.desc, metrics, labels, curry); i < len(metrics) {
return metrics[i].metric, true
}
}
return nil, false
} | go | {
"resource": ""
} |
q34819 | asyncFlush | train | func (s *summary) asyncFlush(now time.Time) {
s.mtx.Lock()
s.swapBufs(now)
// Unblock the original goroutine that was responsible for the mutation
// that triggered the compaction. But hold onto the global non-buffer
// state mutex until the operation finishes.
go func() {
s.flushColdBuf()
s.mtx.Unlock()
}... | go | {
"resource": ""
} |
q34820 | maybeRotateStreams | train | func (s *summary) maybeRotateStreams() {
for !s.hotBufExpTime.Equal(s.headStreamExpTime) {
s.headStream.Reset()
s.headStreamIdx++
if s.headStreamIdx >= len(s.streams) {
s.headStreamIdx = 0
}
s.headStream = s.streams[s.headStreamIdx]
s.headStreamExpTime = s.headStreamExpTime.Add(s.streamDuration)
}
} | go | {
"resource": ""
} |
q34821 | flushColdBuf | train | func (s *summary) flushColdBuf() {
for _, v := range s.coldBuf {
for _, stream := range s.streams {
stream.Insert(v)
}
s.cnt++
s.sum += v
}
s.coldBuf = s.coldBuf[0:0]
s.maybeRotateStreams()
} | go | {
"resource": ""
} |
q34822 | swapBufs | train | func (s *summary) swapBufs(now time.Time) {
if len(s.coldBuf) != 0 {
panic("coldBuf is not empty")
}
s.hotBuf, s.coldBuf = s.coldBuf, s.hotBuf
// hotBuf is now empty and gets new expiration set.
for now.After(s.hotBufExpTime) {
s.hotBufExpTime = s.hotBufExpTime.Add(s.streamDuration)
}
} | go | {
"resource": ""
} |
q34823 | MustNewConstSummary | train | func MustNewConstSummary(
desc *Desc,
count uint64,
sum float64,
quantiles map[float64]float64,
labelValues ...string,
) Metric {
m, err := NewConstSummary(desc, count, sum, quantiles, labelValues...)
if err != nil {
panic(err)
}
return m
} | go | {
"resource": ""
} |
q34824 | InstrumentRoundTripperInFlight | train | func InstrumentRoundTripperInFlight(gauge prometheus.Gauge, next http.RoundTripper) RoundTripperFunc {
return RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
gauge.Inc()
defer gauge.Dec()
return next.RoundTrip(r)
})
} | go | {
"resource": ""
} |
q34825 | NewCounterVec | train | func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec {
desc := NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
labelNames,
opts.ConstLabels,
)
return &CounterVec{
metricVec: newMetricVec(desc, func(lvs ...string) Metric {
if len(lvs) != len(desc.variableLabel... | go | {
"resource": ""
} |
q34826 | DoGetFallback | train | func DoGetFallback(c Client, ctx context.Context, u *url.URL, args url.Values) (*http.Response, []byte, error) {
req, err := http.NewRequest(http.MethodPost, u.String(), strings.NewReader(args.Encode()))
if err != nil {
return nil, nil, err
}
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
r... | go | {
"resource": ""
} |
q34827 | NewClient | train | func NewClient(cfg Config) (Client, error) {
u, err := url.Parse(cfg.Address)
if err != nil {
return nil, err
}
u.Path = strings.TrimRight(u.Path, "/")
return &httpClient{
endpoint: u,
client: http.Client{Transport: cfg.roundTripper()},
}, nil
} | go | {
"resource": ""
} |
q34828 | hashAdd | train | func hashAdd(h uint64, s string) uint64 {
for i := 0; i < len(s); i++ {
h ^= uint64(s[i])
h *= prime64
}
return h
} | go | {
"resource": ""
} |
q34829 | hashAddByte | train | func hashAddByte(h uint64, b byte) uint64 {
h ^= uint64(b)
h *= prime64
return h
} | go | {
"resource": ""
} |
q34830 | Gatherer | train | func (p *Pusher) Gatherer(g prometheus.Gatherer) *Pusher {
p.gatherers = append(p.gatherers, g)
return p
} | go | {
"resource": ""
} |
q34831 | Collector | train | func (p *Pusher) Collector(c prometheus.Collector) *Pusher {
if p.error == nil {
p.error = p.registerer.Register(c)
}
return p
} | go | {
"resource": ""
} |
q34832 | Client | train | func (p *Pusher) Client(c *http.Client) *Pusher {
p.client = c
return p
} | go | {
"resource": ""
} |
q34833 | BasicAuth | train | func (p *Pusher) BasicAuth(username, password string) *Pusher {
p.useBasicAuth = true
p.username = username
p.password = password
return p
} | go | {
"resource": ""
} |
q34834 | Format | train | func (p *Pusher) Format(format expfmt.Format) *Pusher {
p.expfmt = format
return p
} | go | {
"resource": ""
} |
q34835 | NormalizeMetricFamilies | train | func NormalizeMetricFamilies(metricFamiliesByName map[string]*dto.MetricFamily) []*dto.MetricFamily {
for _, mf := range metricFamiliesByName {
sort.Sort(metricSorter(mf.Metric))
}
names := make([]string, 0, len(metricFamiliesByName))
for name, mf := range metricFamiliesByName {
if len(mf.Metric) > 0 {
names... | go | {
"resource": ""
} |
q34836 | LinearBuckets | train | func LinearBuckets(start, width float64, count int) []float64 {
if count < 1 {
panic("LinearBuckets needs a positive count")
}
buckets := make([]float64, count)
for i := range buckets {
buckets[i] = start
start += width
}
return buckets
} | go | {
"resource": ""
} |
q34837 | ExponentialBuckets | train | func ExponentialBuckets(start, factor float64, count int) []float64 {
if count < 1 {
panic("ExponentialBuckets needs a positive count")
}
if start <= 0 {
panic("ExponentialBuckets needs a positive start value")
}
if factor <= 1 {
panic("ExponentialBuckets needs a factor greater than 1")
}
buckets := make([... | go | {
"resource": ""
} |
q34838 | NewHistogram | train | func NewHistogram(opts HistogramOpts) Histogram {
return newHistogram(
NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
nil,
opts.ConstLabels,
),
opts,
)
} | go | {
"resource": ""
} |
q34839 | NewHistogramVec | train | func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec {
desc := NewDesc(
BuildFQName(opts.Namespace, opts.Subsystem, opts.Name),
opts.Help,
labelNames,
opts.ConstLabels,
)
return &HistogramVec{
metricVec: newMetricVec(desc, func(lvs ...string) Metric {
return newHistogram(desc, opt... | go | {
"resource": ""
} |
q34840 | MustNewConstHistogram | train | func MustNewConstHistogram(
desc *Desc,
count uint64,
sum float64,
buckets map[float64]uint64,
labelValues ...string,
) Metric {
m, err := NewConstHistogram(desc, count, sum, buckets, labelValues...)
if err != nil {
panic(err)
}
return m
} | go | {
"resource": ""
} |
q34841 | Push | train | func (b *Bridge) Push() error {
mfs, err := b.g.Gather()
if err != nil || len(mfs) == 0 {
switch b.errorHandling {
case AbortOnError:
return err
case ContinueOnError:
if b.logger != nil {
b.logger.Println("continue on error:", err)
}
default:
panic("unrecognized error handling value")
}
}
... | go | {
"resource": ""
} |
q34842 | NewCounter | train | func NewCounter(opts prometheus.CounterOpts) prometheus.Counter {
c := prometheus.NewCounter(opts)
prometheus.MustRegister(c)
return c
} | go | {
"resource": ""
} |
q34843 | NewCounterVec | train | func NewCounterVec(opts prometheus.CounterOpts, labelNames []string) *prometheus.CounterVec {
c := prometheus.NewCounterVec(opts, labelNames)
prometheus.MustRegister(c)
return c
} | go | {
"resource": ""
} |
q34844 | NewCounterFunc | train | func NewCounterFunc(opts prometheus.CounterOpts, function func() float64) prometheus.CounterFunc {
g := prometheus.NewCounterFunc(opts, function)
prometheus.MustRegister(g)
return g
} | go | {
"resource": ""
} |
q34845 | NewGauge | train | func NewGauge(opts prometheus.GaugeOpts) prometheus.Gauge {
g := prometheus.NewGauge(opts)
prometheus.MustRegister(g)
return g
} | go | {
"resource": ""
} |
q34846 | NewGaugeVec | train | func NewGaugeVec(opts prometheus.GaugeOpts, labelNames []string) *prometheus.GaugeVec {
g := prometheus.NewGaugeVec(opts, labelNames)
prometheus.MustRegister(g)
return g
} | go | {
"resource": ""
} |
q34847 | NewGaugeFunc | train | func NewGaugeFunc(opts prometheus.GaugeOpts, function func() float64) prometheus.GaugeFunc {
g := prometheus.NewGaugeFunc(opts, function)
prometheus.MustRegister(g)
return g
} | go | {
"resource": ""
} |
q34848 | NewSummary | train | func NewSummary(opts prometheus.SummaryOpts) prometheus.Summary {
s := prometheus.NewSummary(opts)
prometheus.MustRegister(s)
return s
} | go | {
"resource": ""
} |
q34849 | NewSummaryVec | train | func NewSummaryVec(opts prometheus.SummaryOpts, labelNames []string) *prometheus.SummaryVec {
s := prometheus.NewSummaryVec(opts, labelNames)
prometheus.MustRegister(s)
return s
} | go | {
"resource": ""
} |
q34850 | NewHistogram | train | func NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram {
h := prometheus.NewHistogram(opts)
prometheus.MustRegister(h)
return h
} | go | {
"resource": ""
} |
q34851 | NewHistogramVec | train | func NewHistogramVec(opts prometheus.HistogramOpts, labelNames []string) *prometheus.HistogramVec {
h := prometheus.NewHistogramVec(opts, labelNames)
prometheus.MustRegister(h)
return h
} | go | {
"resource": ""
} |
q34852 | NewRegistry | train | func NewRegistry() *Registry {
return &Registry{
collectorsByID: map[uint64]Collector{},
descIDs: map[uint64]struct{}{},
dimHashesByName: map[string]uint64{},
}
} | go | {
"resource": ""
} |
q34853 | Append | train | func (errs *MultiError) Append(err error) {
if err != nil {
*errs = append(*errs, err)
}
} | go | {
"resource": ""
} |
q34854 | Register | train | func (r *Registry) Register(c Collector) error {
var (
descChan = make(chan *Desc, capDescChan)
newDescIDs = map[uint64]struct{}{}
newDimHashesByName = map[string]uint64{}
collectorID uint64 // Just a sum of all desc IDs.
duplicateDescErr error
)
go func() {
c.Describe(descChan... | go | {
"resource": ""
} |
q34855 | Unregister | train | func (r *Registry) Unregister(c Collector) bool {
var (
descChan = make(chan *Desc, capDescChan)
descIDs = map[uint64]struct{}{}
collectorID uint64 // Just a sum of the desc IDs.
)
go func() {
c.Describe(descChan)
close(descChan)
}()
for desc := range descChan {
if _, exists := descIDs[desc.id];... | go | {
"resource": ""
} |
q34856 | MustRegister | train | func (r *Registry) MustRegister(cs ...Collector) {
for _, c := range cs {
if err := r.Register(c); err != nil {
panic(err)
}
}
} | go | {
"resource": ""
} |
q34857 | WriteToTextfile | train | func WriteToTextfile(filename string, g Gatherer) error {
tmp, err := ioutil.TempFile(filepath.Dir(filename), filepath.Base(filename))
if err != nil {
return err
}
defer os.Remove(tmp.Name())
mfs, err := g.Gather()
if err != nil {
return err
}
for _, mf := range mfs {
if _, err := expfmt.MetricFamilyToTe... | go | {
"resource": ""
} |
q34858 | checkMetricConsistency | train | func checkMetricConsistency(
metricFamily *dto.MetricFamily,
dtoMetric *dto.Metric,
metricHashes map[uint64]struct{},
) error {
name := metricFamily.GetName()
// Type consistency with metric family.
if metricFamily.GetType() == dto.MetricType_GAUGE && dtoMetric.Gauge == nil ||
metricFamily.GetType() == dto.Met... | go | {
"resource": ""
} |
q34859 | NewMetricWithTimestamp | train | func NewMetricWithTimestamp(t time.Time, m Metric) Metric {
return timestampedMetric{Metric: m, t: t}
} | go | {
"resource": ""
} |
q34860 | newValueFunc | train | func newValueFunc(desc *Desc, valueType ValueType, function func() float64) *valueFunc {
result := &valueFunc{
desc: desc,
valType: valueType,
function: function,
labelPairs: makeLabelPairs(desc, nil),
}
result.init(result)
return result
} | go | {
"resource": ""
} |
q34861 | NewConstMetric | train | func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) (Metric, error) {
if desc.err != nil {
return nil, desc.err
}
if err := validateLabelValues(labelValues, len(desc.variableLabels)); err != nil {
return nil, err
}
return &constMetric{
desc: desc,
valType: va... | go | {
"resource": ""
} |
q34862 | MustNewConstMetric | train | func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) Metric {
m, err := NewConstMetric(desc, valueType, value, labelValues...)
if err != nil {
panic(err)
}
return m
} | go | {
"resource": ""
} |
q34863 | name | train | func (f Frame) name() string {
fn := runtime.FuncForPC(f.pc())
if fn == nil {
return "unknown"
}
return fn.Name()
} | go | {
"resource": ""
} |
q34864 | formatSlice | train | func (st StackTrace) formatSlice(s fmt.State, verb rune) {
io.WriteString(s, "[")
for i, f := range st {
if i > 0 {
io.WriteString(s, " ")
}
f.Format(s, verb)
}
io.WriteString(s, "]")
} | go | {
"resource": ""
} |
q34865 | WithMessage | train | func WithMessage(err error, message string) error {
if err == nil {
return nil
}
return &withMessage{
cause: err,
msg: message,
}
} | go | {
"resource": ""
} |
q34866 | WithMessagef | train | func WithMessagef(err error, format string, args ...interface{}) error {
if err == nil {
return nil
}
return &withMessage{
cause: err,
msg: fmt.Sprintf(format, args...),
}
} | go | {
"resource": ""
} |
q34867 | Required | train | func (r Resource) Required() string {
required := []string{}
for name, property := range r.Properties {
if property.Required {
required = append(required, `"`+name+`"`)
}
}
// As Go doesn't provide ordering guarentees for maps, we should
// sort the required property names by alphabetical order so that
/... | go | {
"resource": ""
} |
q34868 | overrideParameters | train | func overrideParameters(input interface{}, options *ProcessorOptions) {
if options == nil || len(options.ParameterOverrides) == 0 {
return
}
// Check the template is a map
if template, ok := input.(map[string]interface{}); ok {
// Check there is a parameters section
if uparameters, ok := template["Parameters... | go | {
"resource": ""
} |
q34869 | applyGlobals | train | func applyGlobals(input interface{}, options *ProcessorOptions) {
if template, ok := input.(map[string]interface{}); ok {
if uglobals, ok := template["Globals"]; ok {
if globals, ok := uglobals.(map[string]interface{}); ok {
for name, globalValues := range globals {
for supportedGlobalName, supportedGlob... | go | {
"resource": ""
} |
q34870 | evaluateConditions | train | func evaluateConditions(input interface{}, options *ProcessorOptions) {
if template, ok := input.(map[string]interface{}); ok {
// Check there is a conditions section
if uconditions, ok := template["Conditions"]; ok {
// Check the conditions section is a map
if conditions, ok := uconditions.(map[string]inter... | go | {
"resource": ""
} |
q34871 | handler | train | func handler(name string, options *ProcessorOptions) (IntrinsicHandler, bool) {
// Check if we have a handler for this intrinsic type in the instrinsic handler
// overrides in the options provided to Process()
if options != nil {
if h, ok := options.IntrinsicHandlerOverrides[name]; ok {
return h, true
}
}
... | go | {
"resource": ""
} |
q34872 | NewTemplate | train | func NewTemplate() *Template {
return &Template{
AWSTemplateFormatVersion: "2010-09-09",
Description: "",
Metadata: map[string]interface{}{},
Parameters: map[string]interface{}{},
Mappings: map[string]interface{}{},
Conditions: map[st... | go | {
"resource": ""
} |
q34873 | JSON | train | func (t *Template) JSON() ([]byte, error) {
j, err := json.MarshalIndent(t, "", " ")
if err != nil {
return nil, err
}
return intrinsics.ProcessJSON(j, nil)
} | go | {
"resource": ""
} |
q34874 | YAML | train | func (t *Template) YAML() ([]byte, error) {
j, err := t.JSON()
if err != nil {
return nil, err
}
return yaml.JSONToYAML(j)
} | go | {
"resource": ""
} |
q34875 | IsPolymorphic | train | func (p Property) IsPolymorphic() bool {
return len(p.PrimitiveTypes) > 0 || len(p.PrimitiveItemTypes) > 0 || len(p.PrimitiveItemTypes) > 0 || len(p.ItemTypes) > 0 || len(p.Types) > 0
} | go | {
"resource": ""
} |
q34876 | IsCustomType | train | func (p Property) IsCustomType() bool {
return p.PrimitiveType == "" && p.ItemType == "" && p.PrimitiveItemType == ""
} | go | {
"resource": ""
} |
q34877 | GetAllAWSAmazonMQBrokerResources | train | func (t *Template) GetAllAWSAmazonMQBrokerResources() map[string]*resources.AWSAmazonMQBroker {
results := map[string]*resources.AWSAmazonMQBroker{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQBroker:
results[name] = resource
}
}
return results
} | go | {
"resource": ""
} |
q34878 | GetAWSAmazonMQBrokerWithName | train | func (t *Template) GetAWSAmazonMQBrokerWithName(name string) (*resources.AWSAmazonMQBroker, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQBroker:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSAmazonMQBroker not fou... | go | {
"resource": ""
} |
q34879 | GetAllAWSAmazonMQConfigurationResources | train | func (t *Template) GetAllAWSAmazonMQConfigurationResources() map[string]*resources.AWSAmazonMQConfiguration {
results := map[string]*resources.AWSAmazonMQConfiguration{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQConfiguration:
results[name] = resour... | go | {
"resource": ""
} |
q34880 | GetAWSAmazonMQConfigurationWithName | train | func (t *Template) GetAWSAmazonMQConfigurationWithName(name string) (*resources.AWSAmazonMQConfiguration, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQConfiguration:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSA... | go | {
"resource": ""
} |
q34881 | GetAllAWSAmazonMQConfigurationAssociationResources | train | func (t *Template) GetAllAWSAmazonMQConfigurationAssociationResources() map[string]*resources.AWSAmazonMQConfigurationAssociation {
results := map[string]*resources.AWSAmazonMQConfigurationAssociation{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQConfigu... | go | {
"resource": ""
} |
q34882 | GetAWSAmazonMQConfigurationAssociationWithName | train | func (t *Template) GetAWSAmazonMQConfigurationAssociationWithName(name string) (*resources.AWSAmazonMQConfigurationAssociation, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSAmazonMQConfigurationAssociation:
return resource, nil
}
}
return nil, fmt... | go | {
"resource": ""
} |
q34883 | GetAllAWSApiGatewayAccountResources | train | func (t *Template) GetAllAWSApiGatewayAccountResources() map[string]*resources.AWSApiGatewayAccount {
results := map[string]*resources.AWSApiGatewayAccount{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayAccount:
results[name] = resource
}
}
retur... | go | {
"resource": ""
} |
q34884 | GetAWSApiGatewayAccountWithName | train | func (t *Template) GetAWSApiGatewayAccountWithName(name string) (*resources.AWSApiGatewayAccount, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayAccount:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSApiGatewayAcc... | go | {
"resource": ""
} |
q34885 | GetAllAWSApiGatewayApiKeyResources | train | func (t *Template) GetAllAWSApiGatewayApiKeyResources() map[string]*resources.AWSApiGatewayApiKey {
results := map[string]*resources.AWSApiGatewayApiKey{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayApiKey:
results[name] = resource
}
}
return re... | go | {
"resource": ""
} |
q34886 | GetAWSApiGatewayApiKeyWithName | train | func (t *Template) GetAWSApiGatewayApiKeyWithName(name string) (*resources.AWSApiGatewayApiKey, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayApiKey:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSApiGatewayApiKey... | go | {
"resource": ""
} |
q34887 | GetAllAWSApiGatewayAuthorizerResources | train | func (t *Template) GetAllAWSApiGatewayAuthorizerResources() map[string]*resources.AWSApiGatewayAuthorizer {
results := map[string]*resources.AWSApiGatewayAuthorizer{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayAuthorizer:
results[name] = resource
... | go | {
"resource": ""
} |
q34888 | GetAWSApiGatewayAuthorizerWithName | train | func (t *Template) GetAWSApiGatewayAuthorizerWithName(name string) (*resources.AWSApiGatewayAuthorizer, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayAuthorizer:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSApiG... | go | {
"resource": ""
} |
q34889 | GetAllAWSApiGatewayBasePathMappingResources | train | func (t *Template) GetAllAWSApiGatewayBasePathMappingResources() map[string]*resources.AWSApiGatewayBasePathMapping {
results := map[string]*resources.AWSApiGatewayBasePathMapping{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayBasePathMapping:
result... | go | {
"resource": ""
} |
q34890 | GetAWSApiGatewayBasePathMappingWithName | train | func (t *Template) GetAWSApiGatewayBasePathMappingWithName(name string) (*resources.AWSApiGatewayBasePathMapping, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayBasePathMapping:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q ... | go | {
"resource": ""
} |
q34891 | GetAllAWSApiGatewayClientCertificateResources | train | func (t *Template) GetAllAWSApiGatewayClientCertificateResources() map[string]*resources.AWSApiGatewayClientCertificate {
results := map[string]*resources.AWSApiGatewayClientCertificate{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayClientCertificate:
... | go | {
"resource": ""
} |
q34892 | GetAWSApiGatewayClientCertificateWithName | train | func (t *Template) GetAWSApiGatewayClientCertificateWithName(name string) (*resources.AWSApiGatewayClientCertificate, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayClientCertificate:
return resource, nil
}
}
return nil, fmt.Errorf("resour... | go | {
"resource": ""
} |
q34893 | GetAllAWSApiGatewayDeploymentResources | train | func (t *Template) GetAllAWSApiGatewayDeploymentResources() map[string]*resources.AWSApiGatewayDeployment {
results := map[string]*resources.AWSApiGatewayDeployment{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDeployment:
results[name] = resource
... | go | {
"resource": ""
} |
q34894 | GetAWSApiGatewayDeploymentWithName | train | func (t *Template) GetAWSApiGatewayDeploymentWithName(name string) (*resources.AWSApiGatewayDeployment, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDeployment:
return resource, nil
}
}
return nil, fmt.Errorf("resource %q of type AWSApiG... | go | {
"resource": ""
} |
q34895 | GetAllAWSApiGatewayDocumentationPartResources | train | func (t *Template) GetAllAWSApiGatewayDocumentationPartResources() map[string]*resources.AWSApiGatewayDocumentationPart {
results := map[string]*resources.AWSApiGatewayDocumentationPart{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDocumentationPart:
... | go | {
"resource": ""
} |
q34896 | GetAWSApiGatewayDocumentationPartWithName | train | func (t *Template) GetAWSApiGatewayDocumentationPartWithName(name string) (*resources.AWSApiGatewayDocumentationPart, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDocumentationPart:
return resource, nil
}
}
return nil, fmt.Errorf("resour... | go | {
"resource": ""
} |
q34897 | GetAllAWSApiGatewayDocumentationVersionResources | train | func (t *Template) GetAllAWSApiGatewayDocumentationVersionResources() map[string]*resources.AWSApiGatewayDocumentationVersion {
results := map[string]*resources.AWSApiGatewayDocumentationVersion{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDocumentati... | go | {
"resource": ""
} |
q34898 | GetAWSApiGatewayDocumentationVersionWithName | train | func (t *Template) GetAWSApiGatewayDocumentationVersionWithName(name string) (*resources.AWSApiGatewayDocumentationVersion, error) {
if untyped, ok := t.Resources[name]; ok {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDocumentationVersion:
return resource, nil
}
}
return nil, fmt.Error... | go | {
"resource": ""
} |
q34899 | GetAllAWSApiGatewayDomainNameResources | train | func (t *Template) GetAllAWSApiGatewayDomainNameResources() map[string]*resources.AWSApiGatewayDomainName {
results := map[string]*resources.AWSApiGatewayDomainName{}
for name, untyped := range t.Resources {
switch resource := untyped.(type) {
case *resources.AWSApiGatewayDomainName:
results[name] = resource
... | go | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.