_id
stringlengths 2
7
| title
stringlengths 1
118
| partition
stringclasses 3
values | text
stringlengths 52
85.5k
| language
stringclasses 1
value | meta_information
dict |
---|---|---|---|---|---|
q1500
|
SetHTTPCode4XXCount
|
train
|
func (s *BackendConnectionErrors) SetHTTPCode4XXCount(v int64) *BackendConnectionErrors {
s.HTTPCode4XXCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1501
|
SetHTTPCode5XXCount
|
train
|
func (s *BackendConnectionErrors) SetHTTPCode5XXCount(v int64) *BackendConnectionErrors {
s.HTTPCode5XXCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1502
|
SetTimeoutCount
|
train
|
func (s *BackendConnectionErrors) SetTimeoutCount(v int64) *BackendConnectionErrors {
s.TimeoutCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1503
|
SetUnknownHostCount
|
train
|
func (s *BackendConnectionErrors) SetUnknownHostCount(v int64) *BackendConnectionErrors {
s.UnknownHostCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1504
|
SetTraces
|
train
|
func (s *BatchGetTracesOutput) SetTraces(v []*Trace) *BatchGetTracesOutput {
s.Traces = v
return s
}
|
go
|
{
"resource": ""
}
|
q1505
|
SetUnprocessedTraceIds
|
train
|
func (s *BatchGetTracesOutput) SetUnprocessedTraceIds(v []*string) *BatchGetTracesOutput {
s.UnprocessedTraceIds = v
return s
}
|
go
|
{
"resource": ""
}
|
q1506
|
SetThrottleCount
|
train
|
func (s *ErrorStatistics) SetThrottleCount(v int64) *ErrorStatistics {
s.ThrottleCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1507
|
SetSamplingRuleRecords
|
train
|
func (s *GetSamplingRulesOutput) SetSamplingRuleRecords(v []*SamplingRuleRecord) *GetSamplingRulesOutput {
s.SamplingRuleRecords = v
return s
}
|
go
|
{
"resource": ""
}
|
q1508
|
SetSamplingStatisticSummaries
|
train
|
func (s *GetSamplingStatisticSummariesOutput) SetSamplingStatisticSummaries(v []*SamplingStatisticSummary) *GetSamplingStatisticSummariesOutput {
s.SamplingStatisticSummaries = v
return s
}
|
go
|
{
"resource": ""
}
|
q1509
|
SetSamplingStatisticsDocuments
|
train
|
func (s *GetSamplingTargetsInput) SetSamplingStatisticsDocuments(v []*SamplingStatisticsDocument) *GetSamplingTargetsInput {
s.SamplingStatisticsDocuments = v
return s
}
|
go
|
{
"resource": ""
}
|
q1510
|
SetLastRuleModification
|
train
|
func (s *GetSamplingTargetsOutput) SetLastRuleModification(v time.Time) *GetSamplingTargetsOutput {
s.LastRuleModification = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1511
|
SetSamplingTargetDocuments
|
train
|
func (s *GetSamplingTargetsOutput) SetSamplingTargetDocuments(v []*SamplingTargetDocument) *GetSamplingTargetsOutput {
s.SamplingTargetDocuments = v
return s
}
|
go
|
{
"resource": ""
}
|
q1512
|
SetUnprocessedStatistics
|
train
|
func (s *GetSamplingTargetsOutput) SetUnprocessedStatistics(v []*UnprocessedStatistics) *GetSamplingTargetsOutput {
s.UnprocessedStatistics = v
return s
}
|
go
|
{
"resource": ""
}
|
q1513
|
SetEntitySelectorExpression
|
train
|
func (s *GetTimeSeriesServiceStatisticsInput) SetEntitySelectorExpression(v string) *GetTimeSeriesServiceStatisticsInput {
s.EntitySelectorExpression = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1514
|
SetTimeSeriesServiceStatistics
|
train
|
func (s *GetTimeSeriesServiceStatisticsOutput) SetTimeSeriesServiceStatistics(v []*TimeSeriesServiceStatistics) *GetTimeSeriesServiceStatisticsOutput {
s.TimeSeriesServiceStatistics = v
return s
}
|
go
|
{
"resource": ""
}
|
q1515
|
SetSampling
|
train
|
func (s *GetTraceSummariesInput) SetSampling(v bool) *GetTraceSummariesInput {
s.Sampling = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1516
|
SetSamplingStrategy
|
train
|
func (s *GetTraceSummariesInput) SetSamplingStrategy(v *SamplingStrategy) *GetTraceSummariesInput {
s.SamplingStrategy = v
return s
}
|
go
|
{
"resource": ""
}
|
q1517
|
SetTimeRangeType
|
train
|
func (s *GetTraceSummariesInput) SetTimeRangeType(v string) *GetTraceSummariesInput {
s.TimeRangeType = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1518
|
SetApproximateTime
|
train
|
func (s *GetTraceSummariesOutput) SetApproximateTime(v time.Time) *GetTraceSummariesOutput {
s.ApproximateTime = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1519
|
SetTraceSummaries
|
train
|
func (s *GetTraceSummariesOutput) SetTraceSummaries(v []*TraceSummary) *GetTraceSummariesOutput {
s.TraceSummaries = v
return s
}
|
go
|
{
"resource": ""
}
|
q1520
|
SetTracesProcessedCount
|
train
|
func (s *GetTraceSummariesOutput) SetTracesProcessedCount(v int64) *GetTraceSummariesOutput {
s.TracesProcessedCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1521
|
SetClientIp
|
train
|
func (s *Http) SetClientIp(v string) *Http {
s.ClientIp = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1522
|
SetHttpStatus
|
train
|
func (s *Http) SetHttpStatus(v int64) *Http {
s.HttpStatus = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1523
|
SetHttpURL
|
train
|
func (s *Http) SetHttpURL(v string) *Http {
s.HttpURL = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1524
|
SetUserAgent
|
train
|
func (s *Http) SetUserAgent(v string) *Http {
s.UserAgent = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1525
|
SetEC2InstanceId
|
train
|
func (s *PutTelemetryRecordsInput) SetEC2InstanceId(v string) *PutTelemetryRecordsInput {
s.EC2InstanceId = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1526
|
SetTelemetryRecords
|
train
|
func (s *PutTelemetryRecordsInput) SetTelemetryRecords(v []*TelemetryRecord) *PutTelemetryRecordsInput {
s.TelemetryRecords = v
return s
}
|
go
|
{
"resource": ""
}
|
q1527
|
SetTraceSegmentDocuments
|
train
|
func (s *PutTraceSegmentsInput) SetTraceSegmentDocuments(v []*string) *PutTraceSegmentsInput {
s.TraceSegmentDocuments = v
return s
}
|
go
|
{
"resource": ""
}
|
q1528
|
SetUnprocessedTraceSegments
|
train
|
func (s *PutTraceSegmentsOutput) SetUnprocessedTraceSegments(v []*UnprocessedTraceSegment) *PutTraceSegmentsOutput {
s.UnprocessedTraceSegments = v
return s
}
|
go
|
{
"resource": ""
}
|
q1529
|
SetModifiedAt
|
train
|
func (s *SamplingRuleRecord) SetModifiedAt(v time.Time) *SamplingRuleRecord {
s.ModifiedAt = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1530
|
SetReservoirQuota
|
train
|
func (s *SamplingTargetDocument) SetReservoirQuota(v int64) *SamplingTargetDocument {
s.ReservoirQuota = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1531
|
SetReservoirQuotaTTL
|
train
|
func (s *SamplingTargetDocument) SetReservoirQuotaTTL(v time.Time) *SamplingTargetDocument {
s.ReservoirQuotaTTL = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1532
|
SetDurationHistogram
|
train
|
func (s *Service) SetDurationHistogram(v []*HistogramEntry) *Service {
s.DurationHistogram = v
return s
}
|
go
|
{
"resource": ""
}
|
q1533
|
SetEdges
|
train
|
func (s *Service) SetEdges(v []*Edge) *Service {
s.Edges = v
return s
}
|
go
|
{
"resource": ""
}
|
q1534
|
SetBackendConnectionErrors
|
train
|
func (s *TelemetryRecord) SetBackendConnectionErrors(v *BackendConnectionErrors) *TelemetryRecord {
s.BackendConnectionErrors = v
return s
}
|
go
|
{
"resource": ""
}
|
q1535
|
SetSegmentsReceivedCount
|
train
|
func (s *TelemetryRecord) SetSegmentsReceivedCount(v int64) *TelemetryRecord {
s.SegmentsReceivedCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1536
|
SetSegmentsRejectedCount
|
train
|
func (s *TelemetryRecord) SetSegmentsRejectedCount(v int64) *TelemetryRecord {
s.SegmentsRejectedCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1537
|
SetSegmentsSentCount
|
train
|
func (s *TelemetryRecord) SetSegmentsSentCount(v int64) *TelemetryRecord {
s.SegmentsSentCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1538
|
SetSegmentsSpilloverCount
|
train
|
func (s *TelemetryRecord) SetSegmentsSpilloverCount(v int64) *TelemetryRecord {
s.SegmentsSpilloverCount = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1539
|
SetEdgeSummaryStatistics
|
train
|
func (s *TimeSeriesServiceStatistics) SetEdgeSummaryStatistics(v *EdgeStatistics) *TimeSeriesServiceStatistics {
s.EdgeSummaryStatistics = v
return s
}
|
go
|
{
"resource": ""
}
|
q1540
|
SetServiceSummaryStatistics
|
train
|
func (s *TimeSeriesServiceStatistics) SetServiceSummaryStatistics(v *ServiceStatistics) *TimeSeriesServiceStatistics {
s.ServiceSummaryStatistics = v
return s
}
|
go
|
{
"resource": ""
}
|
q1541
|
SetSegments
|
train
|
func (s *Trace) SetSegments(v []*Segment) *Trace {
s.Segments = v
return s
}
|
go
|
{
"resource": ""
}
|
q1542
|
SetErrorRootCauses
|
train
|
func (s *TraceSummary) SetErrorRootCauses(v []*ErrorRootCause) *TraceSummary {
s.ErrorRootCauses = v
return s
}
|
go
|
{
"resource": ""
}
|
q1543
|
SetFaultRootCauses
|
train
|
func (s *TraceSummary) SetFaultRootCauses(v []*FaultRootCause) *TraceSummary {
s.FaultRootCauses = v
return s
}
|
go
|
{
"resource": ""
}
|
q1544
|
SetHasError
|
train
|
func (s *TraceSummary) SetHasError(v bool) *TraceSummary {
s.HasError = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1545
|
SetHasFault
|
train
|
func (s *TraceSummary) SetHasFault(v bool) *TraceSummary {
s.HasFault = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1546
|
SetHasThrottle
|
train
|
func (s *TraceSummary) SetHasThrottle(v bool) *TraceSummary {
s.HasThrottle = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1547
|
SetHttp
|
train
|
func (s *TraceSummary) SetHttp(v *Http) *TraceSummary {
s.Http = v
return s
}
|
go
|
{
"resource": ""
}
|
q1548
|
SetIsPartial
|
train
|
func (s *TraceSummary) SetIsPartial(v bool) *TraceSummary {
s.IsPartial = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1549
|
SetMatchedEventTime
|
train
|
func (s *TraceSummary) SetMatchedEventTime(v time.Time) *TraceSummary {
s.MatchedEventTime = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1550
|
SetResourceARNs
|
train
|
func (s *TraceSummary) SetResourceARNs(v []*ResourceARNDetail) *TraceSummary {
s.ResourceARNs = v
return s
}
|
go
|
{
"resource": ""
}
|
q1551
|
SetResponseTime
|
train
|
func (s *TraceSummary) SetResponseTime(v float64) *TraceSummary {
s.ResponseTime = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1552
|
SetResponseTimeRootCauses
|
train
|
func (s *TraceSummary) SetResponseTimeRootCauses(v []*ResponseTimeRootCause) *TraceSummary {
s.ResponseTimeRootCauses = v
return s
}
|
go
|
{
"resource": ""
}
|
q1553
|
SetSamplingRuleUpdate
|
train
|
func (s *UpdateSamplingRuleInput) SetSamplingRuleUpdate(v *SamplingRuleUpdate) *UpdateSamplingRuleInput {
s.SamplingRuleUpdate = v
return s
}
|
go
|
{
"resource": ""
}
|
q1554
|
SetAnnotationValue
|
train
|
func (s *ValueWithServiceIds) SetAnnotationValue(v *AnnotationValue) *ValueWithServiceIds {
s.AnnotationValue = v
return s
}
|
go
|
{
"resource": ""
}
|
q1555
|
ExpectedString
|
train
|
func (a *WaiterAcceptor) ExpectedString() string {
switch a.Expected.(type) {
case string:
return fmt.Sprintf("%q", a.Expected)
default:
return fmt.Sprintf("%v", a.Expected)
}
}
|
go
|
{
"resource": ""
}
|
q1556
|
WaitersGoCode
|
train
|
func (a *API) WaitersGoCode() string {
var buf bytes.Buffer
fmt.Fprintf(&buf, "import (\n%q\n\n%q\n%q\n)",
"time",
SDKImportRoot+"/aws",
SDKImportRoot+"/aws/request",
)
for _, w := range a.Waiters {
buf.WriteString(w.GoCode())
}
return buf.String()
}
|
go
|
{
"resource": ""
}
|
q1557
|
AttachWaiters
|
train
|
func (a *API) AttachWaiters(filename string) {
p := waiterDefinitions{API: a}
f, err := os.Open(filename)
defer f.Close()
if err != nil {
panic(err)
}
err = json.NewDecoder(f).Decode(&p)
if err != nil {
panic(err)
}
p.setup()
}
|
go
|
{
"resource": ""
}
|
q1558
|
InterfaceSignature
|
train
|
func (w *Waiter) InterfaceSignature() string {
var buf bytes.Buffer
if err := waiterTmpls.ExecuteTemplate(&buf, "waiter interface", w); err != nil {
panic(err)
}
return strings.TrimSpace(buf.String())
}
|
go
|
{
"resource": ""
}
|
q1559
|
GoCode
|
train
|
func (w *Waiter) GoCode() string {
var buf bytes.Buffer
if err := waiterTmpls.ExecuteTemplate(&buf, "waiter", w); err != nil {
panic(err)
}
return buf.String()
}
|
go
|
{
"resource": ""
}
|
q1560
|
Encrypt
|
train
|
func (c *aesGCM) Encrypt(src io.Reader) io.Reader {
reader := &gcmEncryptReader{
encrypter: c.aead,
nonce: c.nonce,
src: src,
}
return reader
}
|
go
|
{
"resource": ""
}
|
q1561
|
Decrypt
|
train
|
func (c *aesGCM) Decrypt(src io.Reader) io.Reader {
return &gcmDecryptReader{
decrypter: c.aead,
nonce: c.nonce,
src: src,
}
}
|
go
|
{
"resource": ""
}
|
q1562
|
WaitUntilEndpointDeleted
|
train
|
func (c *DatabaseMigrationService) WaitUntilEndpointDeleted(input *DescribeEndpointsInput) error {
return c.WaitUntilEndpointDeletedWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1563
|
WaitUntilReplicationInstanceAvailable
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationInstanceAvailable(input *DescribeReplicationInstancesInput) error {
return c.WaitUntilReplicationInstanceAvailableWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1564
|
WaitUntilReplicationInstanceDeleted
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationInstanceDeleted(input *DescribeReplicationInstancesInput) error {
return c.WaitUntilReplicationInstanceDeletedWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1565
|
WaitUntilReplicationTaskDeleted
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationTaskDeleted(input *DescribeReplicationTasksInput) error {
return c.WaitUntilReplicationTaskDeletedWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1566
|
WaitUntilReplicationTaskReady
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationTaskReady(input *DescribeReplicationTasksInput) error {
return c.WaitUntilReplicationTaskReadyWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1567
|
WaitUntilReplicationTaskRunning
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationTaskRunning(input *DescribeReplicationTasksInput) error {
return c.WaitUntilReplicationTaskRunningWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1568
|
WaitUntilReplicationTaskStopped
|
train
|
func (c *DatabaseMigrationService) WaitUntilReplicationTaskStopped(input *DescribeReplicationTasksInput) error {
return c.WaitUntilReplicationTaskStoppedWithContext(aws.BackgroundContext(), input)
}
|
go
|
{
"resource": ""
}
|
q1569
|
ClientConfigNoResolveEndpoint
|
train
|
func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config {
s = s.Copy(cfgs...)
var resolved endpoints.ResolvedEndpoint
region := aws.StringValue(s.Config.Region)
if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 {
resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL))
resolved.SigningRegion = region
}
return client.Config{
Config: s.Config,
Handlers: s.Handlers,
Endpoint: resolved.URL,
SigningRegion: resolved.SigningRegion,
SigningNameDerived: resolved.SigningNameDerived,
SigningName: resolved.SigningName,
}
}
|
go
|
{
"resource": ""
}
|
q1570
|
VisitExpr
|
train
|
func (v *DefaultVisitor) VisitExpr(expr AST) error {
t := v.Sections.container[v.scope]
if t.values == nil {
t.values = values{}
}
switch expr.Kind {
case ASTKindExprStatement:
opExpr := expr.GetRoot()
switch opExpr.Kind {
case ASTKindEqualExpr:
children := opExpr.GetChildren()
if len(children) <= 1 {
return NewParseError("unexpected token type")
}
rhs := children[1]
if rhs.Root.Type() != TokenLit {
return NewParseError("unexpected token type")
}
key := EqualExprKey(opExpr)
v, err := newValue(rhs.Root.ValueType, rhs.Root.base, rhs.Root.Raw())
if err != nil {
return err
}
t.values[key] = v
default:
return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
}
default:
return NewParseError(fmt.Sprintf("unsupported expression %v", expr))
}
v.Sections.container[v.scope] = t
return nil
}
|
go
|
{
"resource": ""
}
|
q1571
|
VisitStatement
|
train
|
func (v *DefaultVisitor) VisitStatement(stmt AST) error {
switch stmt.Kind {
case ASTKindCompletedSectionStatement:
child := stmt.GetRoot()
if child.Kind != ASTKindSectionStatement {
return NewParseError(fmt.Sprintf("unsupported child statement: %T", child))
}
name := string(child.Root.Raw())
v.Sections.container[name] = Section{}
v.scope = name
default:
return NewParseError(fmt.Sprintf("unsupported statement: %s", stmt.Kind))
}
return nil
}
|
go
|
{
"resource": ""
}
|
q1572
|
GetSection
|
train
|
func (t Sections) GetSection(p string) (Section, bool) {
v, ok := t.container[p]
return v, ok
}
|
go
|
{
"resource": ""
}
|
q1573
|
List
|
train
|
func (t Sections) List() []string {
keys := make([]string, len(t.container))
i := 0
for k := range t.container {
keys[i] = k
i++
}
sort.Strings(keys)
return keys
}
|
go
|
{
"resource": ""
}
|
q1574
|
Has
|
train
|
func (t Section) Has(k string) bool {
_, ok := t.values[k]
return ok
}
|
go
|
{
"resource": ""
}
|
q1575
|
ValueType
|
train
|
func (t Section) ValueType(k string) (ValueType, bool) {
v, ok := t.values[k]
return v.Type, ok
}
|
go
|
{
"resource": ""
}
|
q1576
|
Bool
|
train
|
func (t Section) Bool(k string) bool {
return t.values[k].BoolValue()
}
|
go
|
{
"resource": ""
}
|
q1577
|
Int
|
train
|
func (t Section) Int(k string) int64 {
return t.values[k].IntValue()
}
|
go
|
{
"resource": ""
}
|
q1578
|
Float64
|
train
|
func (t Section) Float64(k string) float64 {
return t.values[k].FloatValue()
}
|
go
|
{
"resource": ""
}
|
q1579
|
String
|
train
|
func (t Section) String(k string) string {
_, ok := t.values[k]
if !ok {
return ""
}
return t.values[k].StringValue()
}
|
go
|
{
"resource": ""
}
|
q1580
|
Matches
|
train
|
func (l *LogLevelType) Matches(v LogLevelType) bool {
c := l.Value()
return c&v == v
}
|
go
|
{
"resource": ""
}
|
q1581
|
AtLeast
|
train
|
func (l *LogLevelType) AtLeast(v LogLevelType) bool {
c := l.Value()
return c >= v
}
|
go
|
{
"resource": ""
}
|
q1582
|
NewDefaultLogger
|
train
|
func NewDefaultLogger() Logger {
return &defaultLogger{
logger: log.New(os.Stdout, "", log.LstdFlags),
}
}
|
go
|
{
"resource": ""
}
|
q1583
|
NewSigner
|
train
|
func NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer {
v4 := &Signer{
Credentials: credentials,
}
for _, option := range options {
option(v4)
}
return v4
}
|
go
|
{
"resource": ""
}
|
q1584
|
BuildNamedHandler
|
train
|
func BuildNamedHandler(name string, opts ...func(*Signer)) request.NamedHandler {
return request.NamedHandler{
Name: name,
Fn: func(req *request.Request) {
SignSDKRequestWithCurrentTime(req, time.Now, opts...)
},
}
}
|
go
|
{
"resource": ""
}
|
q1585
|
SignSDKRequestWithCurrentTime
|
train
|
func SignSDKRequestWithCurrentTime(req *request.Request, curTimeFn func() time.Time, opts ...func(*Signer)) {
// If the request does not need to be signed ignore the signing of the
// request if the AnonymousCredentials object is used.
if req.Config.Credentials == credentials.AnonymousCredentials {
return
}
region := req.ClientInfo.SigningRegion
if region == "" {
region = aws.StringValue(req.Config.Region)
}
name := req.ClientInfo.SigningName
if name == "" {
name = req.ClientInfo.ServiceName
}
v4 := NewSigner(req.Config.Credentials, func(v4 *Signer) {
v4.Debug = req.Config.LogLevel.Value()
v4.Logger = req.Config.Logger
v4.DisableHeaderHoisting = req.NotHoist
v4.currentTimeFn = curTimeFn
if name == "s3" {
// S3 service should not have any escaping applied
v4.DisableURIPathEscaping = true
}
// Prevents setting the HTTPRequest's Body. Since the Body could be
// wrapped in a custom io.Closer that we do not want to be stompped
// on top of by the signer.
v4.DisableRequestBodyOverwrite = true
})
for _, opt := range opts {
opt(v4)
}
curTime := curTimeFn()
signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(),
name, region, req.ExpireTime, req.ExpireTime > 0, curTime,
)
if err != nil {
req.Error = err
req.SignedHeaderVals = nil
return
}
req.SignedHeaderVals = signedHeaders
req.LastSignedAt = curTime
}
|
go
|
{
"resource": ""
}
|
q1586
|
isRequestSigned
|
train
|
func (ctx *signingCtx) isRequestSigned() bool {
if ctx.isPresign && ctx.Query.Get("X-Amz-Signature") != "" {
return true
}
if ctx.Request.Header.Get("Authorization") != "" {
return true
}
return false
}
|
go
|
{
"resource": ""
}
|
q1587
|
removePresign
|
train
|
func (ctx *signingCtx) removePresign() {
ctx.Query.Del("X-Amz-Algorithm")
ctx.Query.Del("X-Amz-Signature")
ctx.Query.Del("X-Amz-Security-Token")
ctx.Query.Del("X-Amz-Date")
ctx.Query.Del("X-Amz-Expires")
ctx.Query.Del("X-Amz-Credential")
ctx.Query.Del("X-Amz-SignedHeaders")
}
|
go
|
{
"resource": ""
}
|
q1588
|
stripExcessSpaces
|
train
|
func stripExcessSpaces(vals []string) {
var j, k, l, m, spaces int
for i, str := range vals {
// Trim trailing spaces
for j = len(str) - 1; j >= 0 && str[j] == ' '; j-- {
}
// Trim leading spaces
for k = 0; k < j && str[k] == ' '; k++ {
}
str = str[k : j+1]
// Strip multiple spaces.
j = strings.Index(str, doubleSpace)
if j < 0 {
vals[i] = str
continue
}
buf := []byte(str)
for k, m, l = j, j, len(buf); k < l; k++ {
if buf[k] == ' ' {
if spaces == 0 {
// First space.
buf[m] = buf[k]
m++
}
spaces++
} else {
// End of multiple spaces.
spaces = 0
buf[m] = buf[k]
m++
}
}
vals[i] = string(buf[:m])
}
}
|
go
|
{
"resource": ""
}
|
q1589
|
SetModificationState
|
train
|
func (s *AccountModification) SetModificationState(v string) *AccountModification {
s.ModificationState = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1590
|
SetReconnectEnabled
|
train
|
func (s *ClientProperties) SetReconnectEnabled(v string) *ClientProperties {
s.ReconnectEnabled = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1591
|
SetPendingRequests
|
train
|
func (s *CreateWorkspacesOutput) SetPendingRequests(v []*Workspace) *CreateWorkspacesOutput {
s.PendingRequests = v
return s
}
|
go
|
{
"resource": ""
}
|
q1592
|
SetCustomSecurityGroupId
|
train
|
func (s *DefaultWorkspaceCreationProperties) SetCustomSecurityGroupId(v string) *DefaultWorkspaceCreationProperties {
s.CustomSecurityGroupId = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1593
|
SetDefaultOu
|
train
|
func (s *DefaultWorkspaceCreationProperties) SetDefaultOu(v string) *DefaultWorkspaceCreationProperties {
s.DefaultOu = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1594
|
SetEnableInternetAccess
|
train
|
func (s *DefaultWorkspaceCreationProperties) SetEnableInternetAccess(v bool) *DefaultWorkspaceCreationProperties {
s.EnableInternetAccess = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1595
|
SetEnableWorkDocs
|
train
|
func (s *DefaultWorkspaceCreationProperties) SetEnableWorkDocs(v bool) *DefaultWorkspaceCreationProperties {
s.EnableWorkDocs = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1596
|
SetUserEnabledAsLocalAdministrator
|
train
|
func (s *DefaultWorkspaceCreationProperties) SetUserEnabledAsLocalAdministrator(v bool) *DefaultWorkspaceCreationProperties {
s.UserEnabledAsLocalAdministrator = &v
return s
}
|
go
|
{
"resource": ""
}
|
q1597
|
SetAccountModifications
|
train
|
func (s *DescribeAccountModificationsOutput) SetAccountModifications(v []*AccountModification) *DescribeAccountModificationsOutput {
s.AccountModifications = v
return s
}
|
go
|
{
"resource": ""
}
|
q1598
|
SetClientPropertiesList
|
train
|
func (s *DescribeClientPropertiesOutput) SetClientPropertiesList(v []*ClientPropertiesResult) *DescribeClientPropertiesOutput {
s.ClientPropertiesList = v
return s
}
|
go
|
{
"resource": ""
}
|
q1599
|
SetBundleIds
|
train
|
func (s *DescribeWorkspaceBundlesInput) SetBundleIds(v []*string) *DescribeWorkspaceBundlesInput {
s.BundleIds = v
return s
}
|
go
|
{
"resource": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.