_id
stringlengths
2
7
title
stringlengths
1
118
partition
stringclasses
3 values
text
stringlengths
52
85.5k
language
stringclasses
1 value
meta_information
dict
q100
SetAssigning
train
func (s *InstancesCount) SetAssigning(v int64) *InstancesCount { s.Assigning = &v return s }
go
{ "resource": "" }
q101
SetBooting
train
func (s *InstancesCount) SetBooting(v int64) *InstancesCount { s.Booting = &v return s }
go
{ "resource": "" }
q102
SetConnectionLost
train
func (s *InstancesCount) SetConnectionLost(v int64) *InstancesCount { s.ConnectionLost = &v return s }
go
{ "resource": "" }
q103
SetDeregistering
train
func (s *InstancesCount) SetDeregistering(v int64) *InstancesCount { s.Deregistering = &v return s }
go
{ "resource": "" }
q104
SetOnline
train
func (s *InstancesCount) SetOnline(v int64) *InstancesCount { s.Online = &v return s }
go
{ "resource": "" }
q105
SetRebooting
train
func (s *InstancesCount) SetRebooting(v int64) *InstancesCount { s.Rebooting = &v return s }
go
{ "resource": "" }
q106
SetRegistered
train
func (s *InstancesCount) SetRegistered(v int64) *InstancesCount { s.Registered = &v return s }
go
{ "resource": "" }
q107
SetRegistering
train
func (s *InstancesCount) SetRegistering(v int64) *InstancesCount { s.Registering = &v return s }
go
{ "resource": "" }
q108
SetRequested
train
func (s *InstancesCount) SetRequested(v int64) *InstancesCount { s.Requested = &v return s }
go
{ "resource": "" }
q109
SetRunningSetup
train
func (s *InstancesCount) SetRunningSetup(v int64) *InstancesCount { s.RunningSetup = &v return s }
go
{ "resource": "" }
q110
SetSetupFailed
train
func (s *InstancesCount) SetSetupFailed(v int64) *InstancesCount { s.SetupFailed = &v return s }
go
{ "resource": "" }
q111
SetShuttingDown
train
func (s *InstancesCount) SetShuttingDown(v int64) *InstancesCount { s.ShuttingDown = &v return s }
go
{ "resource": "" }
q112
SetStartFailed
train
func (s *InstancesCount) SetStartFailed(v int64) *InstancesCount { s.StartFailed = &v return s }
go
{ "resource": "" }
q113
SetStopFailed
train
func (s *InstancesCount) SetStopFailed(v int64) *InstancesCount { s.StopFailed = &v return s }
go
{ "resource": "" }
q114
SetStopping
train
func (s *InstancesCount) SetStopping(v int64) *InstancesCount { s.Stopping = &v return s }
go
{ "resource": "" }
q115
SetTerminated
train
func (s *InstancesCount) SetTerminated(v int64) *InstancesCount { s.Terminated = &v return s }
go
{ "resource": "" }
q116
SetTerminating
train
func (s *InstancesCount) SetTerminating(v int64) *InstancesCount { s.Terminating = &v return s }
go
{ "resource": "" }
q117
SetUnassigning
train
func (s *InstancesCount) SetUnassigning(v int64) *InstancesCount { s.Unassigning = &v return s }
go
{ "resource": "" }
q118
SetDefaultRecipes
train
func (s *Layer) SetDefaultRecipes(v *Recipes) *Layer { s.DefaultRecipes = v return s }
go
{ "resource": "" }
q119
SetDefaultSecurityGroupNames
train
func (s *Layer) SetDefaultSecurityGroupNames(v []*string) *Layer { s.DefaultSecurityGroupNames = v return s }
go
{ "resource": "" }
q120
SetConfigurationManagers
train
func (s *OperatingSystem) SetConfigurationManagers(v []*OperatingSystemConfigurationManager) *OperatingSystem { s.ConfigurationManagers = v return s }
go
{ "resource": "" }
q121
SetReportedName
train
func (s *OperatingSystem) SetReportedName(v string) *OperatingSystem { s.ReportedName = &v return s }
go
{ "resource": "" }
q122
SetReportedVersion
train
func (s *OperatingSystem) SetReportedVersion(v string) *OperatingSystem { s.ReportedVersion = &v return s }
go
{ "resource": "" }
q123
SetSupported
train
func (s *OperatingSystem) SetSupported(v bool) *OperatingSystem { s.Supported = &v return s }
go
{ "resource": "" }
q124
SetDbInstanceIdentifier
train
func (s *RdsDbInstance) SetDbInstanceIdentifier(v string) *RdsDbInstance { s.DbInstanceIdentifier = &v return s }
go
{ "resource": "" }
q125
SetMissingOnRds
train
func (s *RdsDbInstance) SetMissingOnRds(v bool) *RdsDbInstance { s.MissingOnRds = &v return s }
go
{ "resource": "" }
q126
SetConfigure
train
func (s *Recipes) SetConfigure(v []*string) *Recipes { s.Configure = v return s }
go
{ "resource": "" }
q127
SetDeploy
train
func (s *Recipes) SetDeploy(v []*string) *Recipes { s.Deploy = v return s }
go
{ "resource": "" }
q128
SetSetup
train
func (s *Recipes) SetSetup(v []*string) *Recipes { s.Setup = v return s }
go
{ "resource": "" }
q129
SetUndeploy
train
func (s *Recipes) SetUndeploy(v []*string) *Recipes { s.Undeploy = v return s }
go
{ "resource": "" }
q130
SetRsaPublicKey
train
func (s *RegisterInstanceInput) SetRsaPublicKey(v string) *RegisterInstanceInput { s.RsaPublicKey = &v return s }
go
{ "resource": "" }
q131
SetRsaPublicKeyFingerprint
train
func (s *RegisterInstanceInput) SetRsaPublicKeyFingerprint(v string) *RegisterInstanceInput { s.RsaPublicKeyFingerprint = &v return s }
go
{ "resource": "" }
q132
SetServiceErrorId
train
func (s *ServiceError) SetServiceErrorId(v string) *ServiceError { s.ServiceErrorId = &v return s }
go
{ "resource": "" }
q133
SetDelayUntilElbConnectionsDrained
train
func (s *ShutdownEventConfiguration) SetDelayUntilElbConnectionsDrained(v bool) *ShutdownEventConfiguration { s.DelayUntilElbConnectionsDrained = &v return s }
go
{ "resource": "" }
q134
SetExecutionTimeout
train
func (s *ShutdownEventConfiguration) SetExecutionTimeout(v int64) *ShutdownEventConfiguration { s.ExecutionTimeout = &v return s }
go
{ "resource": "" }
q135
SetChain
train
func (s *SslConfiguration) SetChain(v string) *SslConfiguration { s.Chain = &v return s }
go
{ "resource": "" }
q136
SetAppsCount
train
func (s *StackSummary) SetAppsCount(v int64) *StackSummary { s.AppsCount = &v return s }
go
{ "resource": "" }
q137
SetInstancesCount
train
func (s *StackSummary) SetInstancesCount(v *InstancesCount) *StackSummary { s.InstancesCount = v return s }
go
{ "resource": "" }
q138
SetLayersCount
train
func (s *StackSummary) SetLayersCount(v int64) *StackSummary { s.LayersCount = &v return s }
go
{ "resource": "" }
q139
SetFriday
train
func (s *WeeklyAutoScalingSchedule) SetFriday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Friday = v return s }
go
{ "resource": "" }
q140
SetMonday
train
func (s *WeeklyAutoScalingSchedule) SetMonday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Monday = v return s }
go
{ "resource": "" }
q141
SetSaturday
train
func (s *WeeklyAutoScalingSchedule) SetSaturday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Saturday = v return s }
go
{ "resource": "" }
q142
SetSunday
train
func (s *WeeklyAutoScalingSchedule) SetSunday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Sunday = v return s }
go
{ "resource": "" }
q143
SetThursday
train
func (s *WeeklyAutoScalingSchedule) SetThursday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Thursday = v return s }
go
{ "resource": "" }
q144
SetTuesday
train
func (s *WeeklyAutoScalingSchedule) SetTuesday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Tuesday = v return s }
go
{ "resource": "" }
q145
SetWednesday
train
func (s *WeeklyAutoScalingSchedule) SetWednesday(v map[string]*string) *WeeklyAutoScalingSchedule { s.Wednesday = v return s }
go
{ "resource": "" }
q146
NewCredentials
train
func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials { p := &ProcessProvider{ command: exec.Command(command), Duration: DefaultDuration, Timeout: DefaultTimeout, MaxBufSize: DefaultBufSize, } for _, option := range options { option(p) } return credentials.NewCredentials(p) }
go
{ "resource": "" }
q147
NewCredentialsTimeout
train
func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials { p := NewCredentials(command, func(opt *ProcessProvider) { opt.Timeout = timeout }) return p }
go
{ "resource": "" }
q148
Retrieve
train
func (p *ProcessProvider) Retrieve() (credentials.Value, error) { out, err := p.executeCredentialProcess() if err != nil { return credentials.Value{ProviderName: ProviderName}, err } // Serialize and validate response resp := &credentialProcessResponse{} if err = json.Unmarshal(out, resp); err != nil { return credentials.Value{ProviderName: ProviderName}, awserr.New( ErrCodeProcessProviderParse, fmt.Sprintf("%s: %s", errMsgProcessProviderParse, string(out)), err) } if resp.Version != 1 { return credentials.Value{ProviderName: ProviderName}, awserr.New( ErrCodeProcessProviderVersion, errMsgProcessProviderVersion, nil) } if len(resp.AccessKeyID) == 0 { return credentials.Value{ProviderName: ProviderName}, awserr.New( ErrCodeProcessProviderRequired, errMsgProcessProviderMissKey, nil) } if len(resp.SecretAccessKey) == 0 { return credentials.Value{ProviderName: ProviderName}, awserr.New( ErrCodeProcessProviderRequired, errMsgProcessProviderMissSecret, nil) } // Handle expiration p.staticCreds = resp.Expiration == nil if resp.Expiration != nil { p.SetExpiration(*resp.Expiration, p.ExpiryWindow) } return credentials.Value{ ProviderName: ProviderName, AccessKeyID: resp.AccessKeyID, SecretAccessKey: resp.SecretAccessKey, SessionToken: resp.SessionToken, }, nil }
go
{ "resource": "" }
q149
prepareCommand
train
func (p *ProcessProvider) prepareCommand() error { var cmdArgs []string if runtime.GOOS == "windows" { cmdArgs = []string{"cmd.exe", "/C"} } else { cmdArgs = []string{"sh", "-c"} } if len(p.originalCommand) == 0 { p.originalCommand = make([]string, len(p.command.Args)) copy(p.originalCommand, p.command.Args) // check for empty command because it succeeds if len(strings.TrimSpace(p.originalCommand[0])) < 1 { return awserr.New( ErrCodeProcessProviderExecution, fmt.Sprintf( "%s: %s", errMsgProcessProviderPrepareCmd, errMsgProcessProviderEmptyCmd), nil) } } cmdArgs = append(cmdArgs, p.originalCommand...) p.command = exec.Command(cmdArgs[0], cmdArgs[1:]...) p.command.Env = os.Environ() return nil }
go
{ "resource": "" }
q150
executeCredentialProcess
train
func (p *ProcessProvider) executeCredentialProcess() ([]byte, error) { if err := p.prepareCommand(); err != nil { return nil, err } // Setup the pipes outReadPipe, outWritePipe, err := os.Pipe() if err != nil { return nil, awserr.New( ErrCodeProcessProviderExecution, errMsgProcessProviderPipe, err) } p.command.Stderr = os.Stderr // display stderr on console for MFA p.command.Stdout = outWritePipe // get creds json on process's stdout p.command.Stdin = os.Stdin // enable stdin for MFA output := bytes.NewBuffer(make([]byte, 0, p.MaxBufSize)) stdoutCh := make(chan error, 1) go readInput( io.LimitReader(outReadPipe, int64(p.MaxBufSize)), output, stdoutCh) execCh := make(chan error, 1) go executeCommand(*p.command, execCh) finished := false var errors []error for !finished { select { case readError := <-stdoutCh: errors = appendError(errors, readError) finished = true case execError := <-execCh: err := outWritePipe.Close() errors = appendError(errors, err) errors = appendError(errors, execError) if errors != nil { return output.Bytes(), awserr.NewBatchError( ErrCodeProcessProviderExecution, errMsgProcessProviderProcess, errors) } case <-time.After(p.Timeout): finished = true return output.Bytes(), awserr.NewBatchError( ErrCodeProcessProviderExecution, errMsgProcessProviderTimeout, errors) // errors can be nil } } out := output.Bytes() if runtime.GOOS == "windows" { // windows adds slashes to quotes out = []byte(strings.Replace(string(out), `\"`, `"`, -1)) } return out, nil }
go
{ "resource": "" }
q151
appendError
train
func appendError(errors []error, err error) []error { if err != nil { return append(errors, err) } return errors }
go
{ "resource": "" }
q152
Retrieve
train
func (p ErrorProvider) Retrieve() (Value, error) { return Value{ProviderName: p.ProviderName}, p.Err }
go
{ "resource": "" }
q153
SetExpiration
train
func (e *Expiry) SetExpiration(expiration time.Time, window time.Duration) { e.expiration = expiration if window > 0 { e.expiration = e.expiration.Add(-window) } }
go
{ "resource": "" }
q154
ExpiresAt
train
func (c *Credentials) ExpiresAt() (time.Time, error) { c.m.RLock() defer c.m.RUnlock() expirer, ok := c.provider.(Expirer) if !ok { return time.Time{}, awserr.New("ProviderNotExpirer", fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName), nil) } if c.forceRefresh { // set expiration time to the distant past return time.Time{}, nil } return expirer.ExpiresAt(), nil }
go
{ "resource": "" }
q155
SetQos
train
func (s *PublishInput) SetQos(v int64) *PublishInput { s.Qos = &v return s }
go
{ "resource": "" }
q156
SetAccessLoggingEnabled
train
func (s *Container) SetAccessLoggingEnabled(v bool) *Container { s.AccessLoggingEnabled = &v return s }
go
{ "resource": "" }
q157
SetRepositoriesNotFound
train
func (s *BatchGetRepositoriesOutput) SetRepositoriesNotFound(v []*string) *BatchGetRepositoriesOutput { s.RepositoriesNotFound = v return s }
go
{ "resource": "" }
q158
SetAdditionalData
train
func (s *Commit) SetAdditionalData(v string) *Commit { s.AdditionalData = &v return s }
go
{ "resource": "" }
q159
SetCommitter
train
func (s *Commit) SetCommitter(v *UserInfo) *Commit { s.Committer = v return s }
go
{ "resource": "" }
q160
SetAuthorName
train
func (s *CreateCommitInput) SetAuthorName(v string) *CreateCommitInput { s.AuthorName = &v return s }
go
{ "resource": "" }
q161
SetDeleteFiles
train
func (s *CreateCommitInput) SetDeleteFiles(v []*DeleteFileEntry) *CreateCommitInput { s.DeleteFiles = v return s }
go
{ "resource": "" }
q162
SetPutFiles
train
func (s *CreateCommitInput) SetPutFiles(v []*PutFileEntry) *CreateCommitInput { s.PutFiles = v return s }
go
{ "resource": "" }
q163
SetSetFileModes
train
func (s *CreateCommitInput) SetSetFileModes(v []*SetFileModeEntry) *CreateCommitInput { s.SetFileModes = v return s }
go
{ "resource": "" }
q164
SetFilesAdded
train
func (s *CreateCommitOutput) SetFilesAdded(v []*FileMetadata) *CreateCommitOutput { s.FilesAdded = v return s }
go
{ "resource": "" }
q165
SetFilesDeleted
train
func (s *CreateCommitOutput) SetFilesDeleted(v []*FileMetadata) *CreateCommitOutput { s.FilesDeleted = v return s }
go
{ "resource": "" }
q166
SetFilesUpdated
train
func (s *CreateCommitOutput) SetFilesUpdated(v []*FileMetadata) *CreateCommitOutput { s.FilesUpdated = v return s }
go
{ "resource": "" }
q167
SetDeletedBranch
train
func (s *DeleteBranchOutput) SetDeletedBranch(v *BranchInfo) *DeleteBranchOutput { s.DeletedBranch = v return s }
go
{ "resource": "" }
q168
SetPullRequestEvents
train
func (s *DescribePullRequestEventsOutput) SetPullRequestEvents(v []*PullRequestEvent) *DescribePullRequestEventsOutput { s.PullRequestEvents = v return s }
go
{ "resource": "" }
q169
SetAfterBlob
train
func (s *Difference) SetAfterBlob(v *BlobMetadata) *Difference { s.AfterBlob = v return s }
go
{ "resource": "" }
q170
SetBeforeBlob
train
func (s *Difference) SetBeforeBlob(v *BlobMetadata) *Difference { s.BeforeBlob = v return s }
go
{ "resource": "" }
q171
SetCommentsForComparedCommitData
train
func (s *GetCommentsForComparedCommitOutput) SetCommentsForComparedCommitData(v []*CommentsForComparedCommit) *GetCommentsForComparedCommitOutput { s.CommentsForComparedCommitData = v return s }
go
{ "resource": "" }
q172
SetCommentsForPullRequestData
train
func (s *GetCommentsForPullRequestOutput) SetCommentsForPullRequestData(v []*CommentsForPullRequest) *GetCommentsForPullRequestOutput { s.CommentsForPullRequestData = v return s }
go
{ "resource": "" }
q173
SetCommit
train
func (s *GetCommitOutput) SetCommit(v *Commit) *GetCommitOutput { s.Commit = v return s }
go
{ "resource": "" }
q174
SetAfterCommitSpecifier
train
func (s *GetDifferencesInput) SetAfterCommitSpecifier(v string) *GetDifferencesInput { s.AfterCommitSpecifier = &v return s }
go
{ "resource": "" }
q175
SetAfterPath
train
func (s *GetDifferencesInput) SetAfterPath(v string) *GetDifferencesInput { s.AfterPath = &v return s }
go
{ "resource": "" }
q176
SetBeforeCommitSpecifier
train
func (s *GetDifferencesInput) SetBeforeCommitSpecifier(v string) *GetDifferencesInput { s.BeforeCommitSpecifier = &v return s }
go
{ "resource": "" }
q177
SetBeforePath
train
func (s *GetDifferencesInput) SetBeforePath(v string) *GetDifferencesInput { s.BeforePath = &v return s }
go
{ "resource": "" }
q178
SetDifferences
train
func (s *GetDifferencesOutput) SetDifferences(v []*Difference) *GetDifferencesOutput { s.Differences = v return s }
go
{ "resource": "" }
q179
SetSubFolders
train
func (s *GetFolderOutput) SetSubFolders(v []*Folder) *GetFolderOutput { s.SubFolders = v return s }
go
{ "resource": "" }
q180
SetSubModules
train
func (s *GetFolderOutput) SetSubModules(v []*SubModule) *GetFolderOutput { s.SubModules = v return s }
go
{ "resource": "" }
q181
SetSymbolicLinks
train
func (s *GetFolderOutput) SetSymbolicLinks(v []*SymbolicLink) *GetFolderOutput { s.SymbolicLinks = v return s }
go
{ "resource": "" }
q182
SetDestinationCommitSpecifier
train
func (s *GetMergeConflictsInput) SetDestinationCommitSpecifier(v string) *GetMergeConflictsInput { s.DestinationCommitSpecifier = &v return s }
go
{ "resource": "" }
q183
SetMergeOption
train
func (s *GetMergeConflictsInput) SetMergeOption(v string) *GetMergeConflictsInput { s.MergeOption = &v return s }
go
{ "resource": "" }
q184
SetSourceCommitSpecifier
train
func (s *GetMergeConflictsInput) SetSourceCommitSpecifier(v string) *GetMergeConflictsInput { s.SourceCommitSpecifier = &v return s }
go
{ "resource": "" }
q185
SetMergeable
train
func (s *GetMergeConflictsOutput) SetMergeable(v bool) *GetMergeConflictsOutput { s.Mergeable = &v return s }
go
{ "resource": "" }
q186
SetPullRequestIds
train
func (s *ListPullRequestsOutput) SetPullRequestIds(v []*string) *ListPullRequestsOutput { s.PullRequestIds = v return s }
go
{ "resource": "" }
q187
SetFilePosition
train
func (s *Location) SetFilePosition(v int64) *Location { s.FilePosition = &v return s }
go
{ "resource": "" }
q188
SetRelativeFileVersion
train
func (s *Location) SetRelativeFileVersion(v string) *Location { s.RelativeFileVersion = &v return s }
go
{ "resource": "" }
q189
SetIsMerged
train
func (s *MergeMetadata) SetIsMerged(v bool) *MergeMetadata { s.IsMerged = &v return s }
go
{ "resource": "" }
q190
SetMergedBy
train
func (s *MergeMetadata) SetMergedBy(v string) *MergeMetadata { s.MergedBy = &v return s }
go
{ "resource": "" }
q191
SetLastActivityDate
train
func (s *PullRequest) SetLastActivityDate(v time.Time) *PullRequest { s.LastActivityDate = &v return s }
go
{ "resource": "" }
q192
SetPullRequestTargets
train
func (s *PullRequest) SetPullRequestTargets(v []*PullRequestTarget) *PullRequest { s.PullRequestTargets = v return s }
go
{ "resource": "" }
q193
SetPullRequestCreatedEventMetadata
train
func (s *PullRequestEvent) SetPullRequestCreatedEventMetadata(v *PullRequestCreatedEventMetadata) *PullRequestEvent { s.PullRequestCreatedEventMetadata = v return s }
go
{ "resource": "" }
q194
SetPullRequestMergedStateChangedEventMetadata
train
func (s *PullRequestEvent) SetPullRequestMergedStateChangedEventMetadata(v *PullRequestMergedStateChangedEventMetadata) *PullRequestEvent { s.PullRequestMergedStateChangedEventMetadata = v return s }
go
{ "resource": "" }
q195
SetPullRequestSourceReferenceUpdatedEventMetadata
train
func (s *PullRequestEvent) SetPullRequestSourceReferenceUpdatedEventMetadata(v *PullRequestSourceReferenceUpdatedEventMetadata) *PullRequestEvent { s.PullRequestSourceReferenceUpdatedEventMetadata = v return s }
go
{ "resource": "" }
q196
SetPullRequestStatusChangedEventMetadata
train
func (s *PullRequestEvent) SetPullRequestStatusChangedEventMetadata(v *PullRequestStatusChangedEventMetadata) *PullRequestEvent { s.PullRequestStatusChangedEventMetadata = v return s }
go
{ "resource": "" }
q197
SetDestinationCommit
train
func (s *PullRequestTarget) SetDestinationCommit(v string) *PullRequestTarget { s.DestinationCommit = &v return s }
go
{ "resource": "" }
q198
SetSourceCommit
train
func (s *PullRequestTarget) SetSourceCommit(v string) *PullRequestTarget { s.SourceCommit = &v return s }
go
{ "resource": "" }
q199
SetCloneUrlHttp
train
func (s *RepositoryMetadata) SetCloneUrlHttp(v string) *RepositoryMetadata { s.CloneUrlHttp = &v return s }
go
{ "resource": "" }