Dataset Viewer
query_docstring
stringlengths 24
20.8k
| positive_code
stringlengths 17
325k
| hard_negative_code
stringlengths 17
325k
| similarity_score
float64 0.3
1
| query_repo
stringclasses 407
values | query_path
stringlengths 5
170
| hn_repo
stringclasses 400
values | hn_path
stringlengths 5
170
| hn_license
stringclasses 4
values | language
stringclasses 1
value |
---|---|---|---|---|---|---|---|---|---|
Get returns the home directory of the current user with the help of
environment variables depending on the target operating system.
Returned path should be used with "path/filepath" to form new paths.
On non-Windows platforms, it falls back to nss lookups, if the home
directory cannot be obtained from environment-variables.
If linking statically with cgo enabled against glibc, ensure the
osusergo build tag is used.
If needing to do nss lookups, do not disable cgo or set osusergo. | func Get() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | func Get() string {
homedir, _ := unshare.HomeDir()
return homedir
} | 0.975752 | containers/podman-tui | vendor/github.com/docker/docker/pkg/homedir/homedir.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/homedir/homedir_unix.go | Apache-2.0 | go |
Get returns the home directory of the current user with the help of
environment variables depending on the target operating system.
Returned path should be used with "path/filepath" to form new paths.
On non-Windows platforms, it falls back to nss lookups, if the home
directory cannot be obtained from environment-variables.
If linking statically with cgo enabled against glibc, ensure the
osusergo build tag is used.
If needing to do nss lookups, do not disable cgo or set osusergo. | func Get() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | func getHomeDir() string {
homeDir := os.Getenv("HOME")
if homeDir != "" {
return homeDir
}
if u, err := user.Current(); err == nil {
return u.HomeDir
}
return "/"
} | 0.938938 | containers/podman-tui | vendor/github.com/docker/docker/pkg/homedir/homedir.go | Mirantis/cri-dockerd | vendor/github.com/godbus/dbus/v5/homedir.go | Apache-2.0 | go |
Get returns the home directory of the current user with the help of
environment variables depending on the target operating system.
Returned path should be used with "path/filepath" to form new paths.
On non-Windows platforms, it falls back to nss lookups, if the home
directory cannot be obtained from environment-variables.
If linking statically with cgo enabled against glibc, ensure the
osusergo build tag is used.
If needing to do nss lookups, do not disable cgo or set osusergo. | func Get() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | func Get() string {
home := os.Getenv(Key())
if home != "" {
return home
}
home, _ = os.UserHomeDir()
return home
} | 0.901978 | containers/podman-tui | vendor/github.com/docker/docker/pkg/homedir/homedir.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/homedir/homedir_windows.go | Apache-2.0 | go |
Get returns the home directory of the current user with the help of
environment variables depending on the target operating system.
Returned path should be used with "path/filepath" to form new paths.
On non-Windows platforms, it falls back to nss lookups, if the home
directory cannot be obtained from environment-variables.
If linking statically with cgo enabled against glibc, ensure the
osusergo build tag is used.
If needing to do nss lookups, do not disable cgo or set osusergo. | func Get() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | func getHomeDir() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | 0.830466 | containers/podman-tui | vendor/github.com/docker/docker/pkg/homedir/homedir.go | moby/buildkit | vendor/github.com/docker/cli/cli/config/config.go | Apache-2.0 | go |
Get returns the home directory of the current user with the help of
environment variables depending on the target operating system.
Returned path should be used with "path/filepath" to form new paths.
On non-Windows platforms, it falls back to nss lookups, if the home
directory cannot be obtained from environment-variables.
If linking statically with cgo enabled against glibc, ensure the
osusergo build tag is used.
If needing to do nss lookups, do not disable cgo or set osusergo. | func Get() string {
home, _ := os.UserHomeDir()
if home == "" && runtime.GOOS != "windows" {
if u, err := user.Current(); err == nil {
return u.HomeDir
}
}
return home
} | func Dir() (string, error) {
if !DisableCache {
cacheLock.RLock()
cached := homedirCache
cacheLock.RUnlock()
if cached != "" {
return cached, nil
}
}
cacheLock.Lock()
defer cacheLock.Unlock()
var result string
var err error
if runtime.GOOS == "windows" {
result, err = dirWindows()
} else {
// Unix-like system, so just assume Unix
result, err = dirUnix()
}
if err != nil {
return "", err
}
homedirCache = result
return result, nil
} | 0.770265 | containers/podman-tui | vendor/github.com/docker/docker/pkg/homedir/homedir.go | tektoncd/cli | vendor/github.com/mitchellh/go-homedir/homedir.go | Apache-2.0 | go |
GetAwsNetworkPerformanceDataPagesWithContext same as GetAwsNetworkPerformanceDataPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *EC2) GetAwsNetworkPerformanceDataPagesWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAwsNetworkPerformanceDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAwsNetworkPerformanceDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAwsNetworkPerformanceDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *EC2) GetAwsNetworkPerformanceDataWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, opts ...request.Option) (*GetAwsNetworkPerformanceDataOutput, error) {
req, out := c.GetAwsNetworkPerformanceDataRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.915439 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
GetAwsNetworkPerformanceDataPagesWithContext same as GetAwsNetworkPerformanceDataPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *EC2) GetAwsNetworkPerformanceDataPagesWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAwsNetworkPerformanceDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAwsNetworkPerformanceDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAwsNetworkPerformanceDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *EC2) GetAwsNetworkPerformanceData(input *GetAwsNetworkPerformanceDataInput) (*GetAwsNetworkPerformanceDataOutput, error) {
req, out := c.GetAwsNetworkPerformanceDataRequest(input)
return out, req.Send()
} | 0.831906 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
GetAwsNetworkPerformanceDataPagesWithContext same as GetAwsNetworkPerformanceDataPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *EC2) GetAwsNetworkPerformanceDataPagesWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAwsNetworkPerformanceDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAwsNetworkPerformanceDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAwsNetworkPerformanceDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *EC2) GetAwsNetworkPerformanceDataRequest(input *GetAwsNetworkPerformanceDataInput) (req *request.Request, output *GetAwsNetworkPerformanceDataOutput) {
op := &request.Operation{
Name: opGetAwsNetworkPerformanceData,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetAwsNetworkPerformanceDataInput{}
}
output = &GetAwsNetworkPerformanceDataOutput{}
req = c.newRequest(op, input, output)
return
} | 0.813943 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
GetAwsNetworkPerformanceDataPagesWithContext same as GetAwsNetworkPerformanceDataPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *EC2) GetAwsNetworkPerformanceDataPagesWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAwsNetworkPerformanceDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAwsNetworkPerformanceDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAwsNetworkPerformanceDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *EC2) GetAwsNetworkPerformanceDataPages(input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool) error {
return c.GetAwsNetworkPerformanceDataPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.797332 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
GetAwsNetworkPerformanceDataPagesWithContext same as GetAwsNetworkPerformanceDataPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *EC2) GetAwsNetworkPerformanceDataPagesWithContext(ctx aws.Context, input *GetAwsNetworkPerformanceDataInput, fn func(*GetAwsNetworkPerformanceDataOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *GetAwsNetworkPerformanceDataInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.GetAwsNetworkPerformanceDataRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*GetAwsNetworkPerformanceDataOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *EC2) DescribeAwsNetworkPerformanceMetricSubscriptionsPagesWithContext(ctx aws.Context, input *DescribeAwsNetworkPerformanceMetricSubscriptionsInput, fn func(*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeAwsNetworkPerformanceMetricSubscriptionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeAwsNetworkPerformanceMetricSubscriptionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeAwsNetworkPerformanceMetricSubscriptionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.726242 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateVerifiedAccessGroup API operation for Amazon Elastic Compute Cloud.
An Amazon Web Services Verified Access group is a collection of Amazon Web
Services Verified Access endpoints who's associated applications have similar
security requirements. Each instance within a Verified Access group shares
an Verified Access policy. For example, you can group all Verified Access
instances associated with "sales" applications together and use one common
Verified Access policy.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions
with awserr.Error's Code and Message methods to get detailed information about
the error.
See the AWS API reference guide for Amazon Elastic Compute Cloud's
API operation CreateVerifiedAccessGroup for usage and error information.
See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVerifiedAccessGroup | func (c *EC2) CreateVerifiedAccessGroup(input *CreateVerifiedAccessGroupInput) (*CreateVerifiedAccessGroupOutput, error) {
req, out := c.CreateVerifiedAccessGroupRequest(input)
return out, req.Send()
} | func (c *EC2) ModifyVerifiedAccessGroup(input *ModifyVerifiedAccessGroupInput) (*ModifyVerifiedAccessGroupOutput, error) {
req, out := c.ModifyVerifiedAccessGroupRequest(input)
return out, req.Send()
} | 0.893534 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateVerifiedAccessGroup API operation for Amazon Elastic Compute Cloud.
An Amazon Web Services Verified Access group is a collection of Amazon Web
Services Verified Access endpoints who's associated applications have similar
security requirements. Each instance within a Verified Access group shares
an Verified Access policy. For example, you can group all Verified Access
instances associated with "sales" applications together and use one common
Verified Access policy.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions
with awserr.Error's Code and Message methods to get detailed information about
the error.
See the AWS API reference guide for Amazon Elastic Compute Cloud's
API operation CreateVerifiedAccessGroup for usage and error information.
See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVerifiedAccessGroup | func (c *EC2) CreateVerifiedAccessGroup(input *CreateVerifiedAccessGroupInput) (*CreateVerifiedAccessGroupOutput, error) {
req, out := c.CreateVerifiedAccessGroupRequest(input)
return out, req.Send()
} | func (c *EC2) DeleteVerifiedAccessGroup(input *DeleteVerifiedAccessGroupInput) (*DeleteVerifiedAccessGroupOutput, error) {
req, out := c.DeleteVerifiedAccessGroupRequest(input)
return out, req.Send()
} | 0.865543 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateVerifiedAccessGroup API operation for Amazon Elastic Compute Cloud.
An Amazon Web Services Verified Access group is a collection of Amazon Web
Services Verified Access endpoints who's associated applications have similar
security requirements. Each instance within a Verified Access group shares
an Verified Access policy. For example, you can group all Verified Access
instances associated with "sales" applications together and use one common
Verified Access policy.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions
with awserr.Error's Code and Message methods to get detailed information about
the error.
See the AWS API reference guide for Amazon Elastic Compute Cloud's
API operation CreateVerifiedAccessGroup for usage and error information.
See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVerifiedAccessGroup | func (c *EC2) CreateVerifiedAccessGroup(input *CreateVerifiedAccessGroupInput) (*CreateVerifiedAccessGroupOutput, error) {
req, out := c.CreateVerifiedAccessGroupRequest(input)
return out, req.Send()
} | func (c *EC2) ModifyVerifiedAccessGroupPolicy(input *ModifyVerifiedAccessGroupPolicyInput) (*ModifyVerifiedAccessGroupPolicyOutput, error) {
req, out := c.ModifyVerifiedAccessGroupPolicyRequest(input)
return out, req.Send()
} | 0.841176 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateVerifiedAccessGroup API operation for Amazon Elastic Compute Cloud.
An Amazon Web Services Verified Access group is a collection of Amazon Web
Services Verified Access endpoints who's associated applications have similar
security requirements. Each instance within a Verified Access group shares
an Verified Access policy. For example, you can group all Verified Access
instances associated with "sales" applications together and use one common
Verified Access policy.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions
with awserr.Error's Code and Message methods to get detailed information about
the error.
See the AWS API reference guide for Amazon Elastic Compute Cloud's
API operation CreateVerifiedAccessGroup for usage and error information.
See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVerifiedAccessGroup | func (c *EC2) CreateVerifiedAccessGroup(input *CreateVerifiedAccessGroupInput) (*CreateVerifiedAccessGroupOutput, error) {
req, out := c.CreateVerifiedAccessGroupRequest(input)
return out, req.Send()
} | func (c *EC2) DescribeVerifiedAccessGroups(input *DescribeVerifiedAccessGroupsInput) (*DescribeVerifiedAccessGroupsOutput, error) {
req, out := c.DescribeVerifiedAccessGroupsRequest(input)
return out, req.Send()
} | 0.839433 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateVerifiedAccessGroup API operation for Amazon Elastic Compute Cloud.
An Amazon Web Services Verified Access group is a collection of Amazon Web
Services Verified Access endpoints who's associated applications have similar
security requirements. Each instance within a Verified Access group shares
an Verified Access policy. For example, you can group all Verified Access
instances associated with "sales" applications together and use one common
Verified Access policy.
Returns awserr.Error for service API and SDK errors. Use runtime type assertions
with awserr.Error's Code and Message methods to get detailed information about
the error.
See the AWS API reference guide for Amazon Elastic Compute Cloud's
API operation CreateVerifiedAccessGroup for usage and error information.
See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateVerifiedAccessGroup | func (c *EC2) CreateVerifiedAccessGroup(input *CreateVerifiedAccessGroupInput) (*CreateVerifiedAccessGroupOutput, error) {
req, out := c.CreateVerifiedAccessGroupRequest(input)
return out, req.Send()
} | func (c *EC2) CreateVerifiedAccessGroupRequest(input *CreateVerifiedAccessGroupInput) (req *request.Request, output *CreateVerifiedAccessGroupOutput) {
op := &request.Operation{
Name: opCreateVerifiedAccessGroup,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateVerifiedAccessGroupInput{}
}
output = &CreateVerifiedAccessGroupOutput{}
req = c.newRequest(op, input, output)
return
} | 0.826022 | aws/aws-sdk-go | service/ec2/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
Close frees resources associated with the layer reader. It will return an
error if there was an error while reading the layer or of the layer was not
completely read. | func (r *FilterLayerReader) Close() (err error) {
if r.context != 0 {
err = exportLayerEnd(r.context)
if err != nil {
err = hcserror.New(err, "ExportLayerEnd", "")
}
r.context = 0
}
return
} | func (rp *ResourcePool) Close() {
if rp.idleTimer != nil {
rp.idleTimer.Stop()
}
_ = rp.SetCapacity(0)
} | 0.640176 | genuinetools/binctr | vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go | tektoncd/cli | vendor/github.com/thales-e-security/pool/resource_pool.go | Apache-2.0 | go |
Close frees resources associated with the layer reader. It will return an
error if there was an error while reading the layer or of the layer was not
completely read. | func (r *FilterLayerReader) Close() (err error) {
if r.context != 0 {
err = exportLayerEnd(r.context)
if err != nil {
err = hcserror.New(err, "ExportLayerEnd", "")
}
r.context = 0
}
return
} | func (cr *chunkReader) Close() error {
if cr.state != newRow {
return fmt.Errorf("invalid state for end of stream %q", cr.state)
}
return nil
} | 0.640044 | genuinetools/binctr | vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go | googleapis/google-cloud-go | bigtable/reader.go | Apache-2.0 | go |
Close frees resources associated with the layer reader. It will return an
error if there was an error while reading the layer or of the layer was not
completely read. | func (r *FilterLayerReader) Close() (err error) {
if r.context != 0 {
err = exportLayerEnd(r.context)
if err != nil {
err = hcserror.New(err, "ExportLayerEnd", "")
}
r.context = 0
}
return
} | func (mr *ManualReader) Shutdown(context.Context) error {
err := ErrReaderShutdown
mr.shutdownOnce.Do(func() {
// Any future call to Collect will now return ErrReaderShutdown.
mr.sdkProducer.Store(produceHolder{
produce: shutdownProducer{}.produce,
})
mr.mu.Lock()
defer mr.mu.Unlock()
mr.isShutdown = true
// release references to Producer(s)
mr.externalProducers.Store([]Producer{})
err = nil
})
return err
} | 0.625025 | genuinetools/binctr | vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go | tektoncd/cli | vendor/go.opentelemetry.io/otel/sdk/metric/manual_reader.go | Apache-2.0 | go |
Close frees resources associated with the layer reader. It will return an
error if there was an error while reading the layer or of the layer was not
completely read. | func (r *FilterLayerReader) Close() (err error) {
if r.context != 0 {
err = exportLayerEnd(r.context)
if err != nil {
err = hcserror.New(err, "ExportLayerEnd", "")
}
r.context = 0
}
return
} | func (c *Client) Close() error {
pubErr := c.pubc.Close()
subErr := c.subc.Close()
if pubErr != nil {
return fmt.Errorf("pubsub publisher closing error: %w", pubErr)
}
if subErr != nil {
// Suppress client connection closing errors. This will only happen
// when using the client in conjunction with the Pub/Sub emulator
// or fake (pstest). Closing both clients separately will never
// return this error against the live Pub/Sub service.
if strings.Contains(subErr.Error(), "the client connection is closing") {
return nil
}
return fmt.Errorf("pubsub subscriber closing error: %w", subErr)
}
return nil
} | 0.615686 | genuinetools/binctr | vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go | go-graphite/go-carbon | vendor/cloud.google.com/go/pubsub/pubsub.go | MIT | go |
Close frees resources associated with the layer reader. It will return an
error if there was an error while reading the layer or of the layer was not
completely read. | func (r *FilterLayerReader) Close() (err error) {
if r.context != 0 {
err = exportLayerEnd(r.context)
if err != nil {
err = hcserror.New(err, "ExportLayerEnd", "")
}
r.context = 0
}
return
} | func (h *Handle) Delete() {
h.Close()
} | 0.609388 | genuinetools/binctr | vendor/github.com/Microsoft/hcsshim/internal/wclayer/exportlayer.go | Mirantis/cri-dockerd | vendor/github.com/vishvananda/netlink/handle_linux.go | Apache-2.0 | go |
NewProgressMeter returns a progress meter that can be used to show
progress to a TTY periodically, including an increasing int64
value. | func NewProgressMeter(w io.Writer, period time.Duration) Progress {
return &progressMeter{
w: w,
period: period,
}
} | func NewMeter() Meter {
return &worker{
measures: make(map[string]*measureRef),
views: make(map[string]*viewInternal),
viewStartTimes: make(map[*viewInternal]time.Time),
timer: time.NewTicker(defaultReportingDuration),
c: make(chan command, 1024),
quit: make(chan bool),
done: make(chan bool),
exporters: make(map[Exporter]struct{}),
}
} | 0.640433 | github/git-sizer | meter/meter.go | config-syncer/config-syncer | vendor/go.opencensus.io/stats/view/worker.go | Apache-2.0 | go |
NewProgressMeter returns a progress meter that can be used to show
progress to a TTY periodically, including an increasing int64
value. | func NewProgressMeter(w io.Writer, period time.Duration) Progress {
return &progressMeter{
w: w,
period: period,
}
} | func (cpb *ProgressBar) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) io.ReadCloser {
cpb.lock.Lock()
defer cpb.lock.Unlock()
newPb := pb.New64(totalSize)
newPb.Set("prefix", fmt.Sprintf("%s ", filepath.Base(src)))
newPb.SetCurrent(currentSize)
newPb.Start()
reader := newPb.NewProxyReader(stream)
return &readCloser{
Reader: reader,
close: func() error {
cpb.lock.Lock()
defer cpb.lock.Unlock()
newPb.Finish()
return nil
},
}
} | 0.566949 | github/git-sizer | meter/meter.go | okteto/okteto | cmd/utils/progress.go | Apache-2.0 | go |
NewProgressMeter returns a progress meter that can be used to show
progress to a TTY periodically, including an increasing int64
value. | func NewProgressMeter(w io.Writer, period time.Duration) Progress {
return &progressMeter{
w: w,
period: period,
}
} | func NewRegisteredMeter(name string, r Registry) Meter {
c := NewMeter()
if nil == r {
r = DefaultRegistry
}
r.Register(name, c)
return c
} | 0.556872 | github/git-sizer | meter/meter.go | tektoncd/cli | vendor/github.com/rcrowley/go-metrics/meter.go | Apache-2.0 | go |
NewProgressMeter returns a progress meter that can be used to show
progress to a TTY periodically, including an increasing int64
value. | func NewProgressMeter(w io.Writer, period time.Duration) Progress {
return &progressMeter{
w: w,
period: period,
}
} | func NewMeter(parent ...tree.Node) *Meter { return tree.New[Meter](parent...) } | 0.554086 | github/git-sizer | meter/meter.go | cogentcore/core | core/typegen.go | BSD-3-Clause | go |
NewProgressMeter returns a progress meter that can be used to show
progress to a TTY periodically, including an increasing int64
value. | func NewProgressMeter(w io.Writer, period time.Duration) Progress {
return &progressMeter{
w: w,
period: period,
}
} | func NewRegisteredTimer(name string, r Registry) Timer {
c := NewTimer()
if nil == r {
r = DefaultRegistry
}
r.Register(name, c)
return c
} | 0.546799 | github/git-sizer | meter/meter.go | tektoncd/cli | vendor/github.com/rcrowley/go-metrics/timer.go | Apache-2.0 | go |
CreateUsageProfileRequest generates a "aws/request.Request" representing the
client's request for the CreateUsageProfile operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See CreateUsageProfile for more information on using the CreateUsageProfile
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the CreateUsageProfileRequest method.
req, resp := client.CreateUsageProfileRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUsageProfile | func (c *Glue) CreateUsageProfileRequest(input *CreateUsageProfileInput) (req *request.Request, output *CreateUsageProfileOutput) {
op := &request.Operation{
Name: opCreateUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateUsageProfileInput{}
}
output = &CreateUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Glue) GetUsageProfileRequest(input *GetUsageProfileInput) (req *request.Request, output *GetUsageProfileOutput) {
op := &request.Operation{
Name: opGetUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetUsageProfileInput{}
}
output = &GetUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | 0.915321 | aws/aws-sdk-go | service/glue/api.go | aws/aws-sdk-go | service/glue/api.go | Apache-2.0 | go |
CreateUsageProfileRequest generates a "aws/request.Request" representing the
client's request for the CreateUsageProfile operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See CreateUsageProfile for more information on using the CreateUsageProfile
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the CreateUsageProfileRequest method.
req, resp := client.CreateUsageProfileRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUsageProfile | func (c *Glue) CreateUsageProfileRequest(input *CreateUsageProfileInput) (req *request.Request, output *CreateUsageProfileOutput) {
op := &request.Operation{
Name: opCreateUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateUsageProfileInput{}
}
output = &CreateUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Glue) DeleteUsageProfileRequest(input *DeleteUsageProfileInput) (req *request.Request, output *DeleteUsageProfileOutput) {
op := &request.Operation{
Name: opDeleteUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteUsageProfileInput{}
}
output = &DeleteUsageProfileOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
} | 0.887672 | aws/aws-sdk-go | service/glue/api.go | aws/aws-sdk-go | service/glue/api.go | Apache-2.0 | go |
CreateUsageProfileRequest generates a "aws/request.Request" representing the
client's request for the CreateUsageProfile operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See CreateUsageProfile for more information on using the CreateUsageProfile
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the CreateUsageProfileRequest method.
req, resp := client.CreateUsageProfileRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUsageProfile | func (c *Glue) CreateUsageProfileRequest(input *CreateUsageProfileInput) (req *request.Request, output *CreateUsageProfileOutput) {
op := &request.Operation{
Name: opCreateUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateUsageProfileInput{}
}
output = &CreateUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *B2bi) CreateProfileRequest(input *CreateProfileInput) (req *request.Request, output *CreateProfileOutput) {
op := &request.Operation{
Name: opCreateProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateProfileInput{}
}
output = &CreateProfileOutput{}
req = c.newRequest(op, input, output)
return
} | 0.875469 | aws/aws-sdk-go | service/glue/api.go | aws/aws-sdk-go | service/b2bi/api.go | Apache-2.0 | go |
CreateUsageProfileRequest generates a "aws/request.Request" representing the
client's request for the CreateUsageProfile operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See CreateUsageProfile for more information on using the CreateUsageProfile
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the CreateUsageProfileRequest method.
req, resp := client.CreateUsageProfileRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUsageProfile | func (c *Glue) CreateUsageProfileRequest(input *CreateUsageProfileInput) (req *request.Request, output *CreateUsageProfileOutput) {
op := &request.Operation{
Name: opCreateUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateUsageProfileInput{}
}
output = &CreateUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *WellArchitected) CreateProfileRequest(input *CreateProfileInput) (req *request.Request, output *CreateProfileOutput) {
op := &request.Operation{
Name: opCreateProfile,
HTTPMethod: "POST",
HTTPPath: "/profiles",
}
if input == nil {
input = &CreateProfileInput{}
}
output = &CreateProfileOutput{}
req = c.newRequest(op, input, output)
return
} | 0.869217 | aws/aws-sdk-go | service/glue/api.go | aws/aws-sdk-go | service/wellarchitected/api.go | Apache-2.0 | go |
CreateUsageProfileRequest generates a "aws/request.Request" representing the
client's request for the CreateUsageProfile operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See CreateUsageProfile for more information on using the CreateUsageProfile
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the CreateUsageProfileRequest method.
req, resp := client.CreateUsageProfileRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUsageProfile | func (c *Glue) CreateUsageProfileRequest(input *CreateUsageProfileInput) (req *request.Request, output *CreateUsageProfileOutput) {
op := &request.Operation{
Name: opCreateUsageProfile,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateUsageProfileInput{}
}
output = &CreateUsageProfileOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *CustomerProfiles) CreateProfileRequest(input *CreateProfileInput) (req *request.Request, output *CreateProfileOutput) {
op := &request.Operation{
Name: opCreateProfile,
HTTPMethod: "POST",
HTTPPath: "/domains/{DomainName}/profiles",
}
if input == nil {
input = &CreateProfileInput{}
}
output = &CreateProfileOutput{}
req = c.newRequest(op, input, output)
return
} | 0.865245 | aws/aws-sdk-go | service/glue/api.go | aws/aws-sdk-go | service/customerprofiles/api.go | Apache-2.0 | go |
WithBaseLevelSize sets the maximum size target for the base level.
The default value is 10MB. | func (opt Options) WithBaseLevelSize(val int64) Options {
opt.BaseLevelSize = val
return opt
} | func WithWindowSize(n int) EOption {
return func(o *encoderOptions) error {
switch {
case n < MinWindowSize:
return fmt.Errorf("window size must be at least %d", MinWindowSize)
case n > MaxWindowSize:
return fmt.Errorf("window size must be at most %d", MaxWindowSize)
case (n & (n - 1)) != 0:
return errors.New("window size must be a power of 2")
}
o.windowSize = n
o.customWindow = true
if o.blockSize > o.windowSize {
o.blockSize = o.windowSize
o.customBlockSize = true
}
return nil
}
} | 0.685525 | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | umputun/tg-spam | vendor/github.com/klauspost/compress/zstd/encoder_options.go | MIT | go |
WithBaseLevelSize sets the maximum size target for the base level.
The default value is 10MB. | func (opt Options) WithBaseLevelSize(val int64) Options {
opt.BaseLevelSize = val
return opt
} | func (opt Options) WithBaseTableSize(val int64) Options {
opt.BaseTableSize = val
return opt
} | 0.673239 | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | Apache-2.0 | go |
WithBaseLevelSize sets the maximum size target for the base level.
The default value is 10MB. | func (opt Options) WithBaseLevelSize(val int64) Options {
opt.BaseLevelSize = val
return opt
} | func (opt Options) WithLevelSizeMultiplier(val int) Options {
opt.LevelSizeMultiplier = val
return opt
} | 0.665562 | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | Apache-2.0 | go |
WithBaseLevelSize sets the maximum size target for the base level.
The default value is 10MB. | func (opt Options) WithBaseLevelSize(val int64) Options {
opt.BaseLevelSize = val
return opt
} | func WithWindowSize(n int) EOption {
return func(o *encoderOptions) error {
switch {
case n < MinWindowSize:
return fmt.Errorf("window size must be at least %d", MinWindowSize)
case n > MaxWindowSize:
return fmt.Errorf("window size must be at most %d", MaxWindowSize)
case (n & (n - 1)) != 0:
return errors.New("window size must be a power of 2")
}
o.windowSize = n
o.customWindow = true
if o.blockSize > o.windowSize {
o.blockSize = o.windowSize
}
return nil
}
} | 0.639202 | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | qiniu/logkit | vendor/github.com/klauspost/compress/zstd/encoder_options.go | Apache-2.0 | go |
WithBaseLevelSize sets the maximum size target for the base level.
The default value is 10MB. | func (opt Options) WithBaseLevelSize(val int64) Options {
opt.BaseLevelSize = val
return opt
} | func WithDecoderMaxWindow(size uint64) DOption {
return func(o *decoderOptions) error {
if size < MinWindowSize {
return errors.New("WithMaxWindowSize must be at least 1KB, 1024 bytes")
}
if size > (1<<41)+7*(1<<38) {
return errors.New("WithMaxWindowSize must be less than (1<<41) + 7*(1<<38) ~ 3.75TB")
}
o.maxWindowSize = size
return nil
}
} | 0.607022 | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | umputun/tg-spam | vendor/github.com/klauspost/compress/zstd/decoder_options.go | MIT | go |
SetDefaultMessageTypeWithContext is the same as SetDefaultMessageType with the addition of
the ability to pass a context and additional request options.
See SetDefaultMessageType for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeWithContext(ctx aws.Context, input *SetDefaultMessageTypeInput, opts ...request.Option) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *PinpointSMSVoiceV2) DeleteDefaultMessageTypeWithContext(ctx aws.Context, input *DeleteDefaultMessageTypeInput, opts ...request.Option) (*DeleteDefaultMessageTypeOutput, error) {
req, out := c.DeleteDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.826565 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
SetDefaultMessageTypeWithContext is the same as SetDefaultMessageType with the addition of
the ability to pass a context and additional request options.
See SetDefaultMessageType for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeWithContext(ctx aws.Context, input *SetDefaultMessageTypeInput, opts ...request.Option) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeRequest(input *SetDefaultMessageTypeInput) (req *request.Request, output *SetDefaultMessageTypeOutput) {
op := &request.Operation{
Name: opSetDefaultMessageType,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &SetDefaultMessageTypeInput{}
}
output = &SetDefaultMessageTypeOutput{}
req = c.newRequest(op, input, output)
return
} | 0.726447 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
SetDefaultMessageTypeWithContext is the same as SetDefaultMessageType with the addition of
the ability to pass a context and additional request options.
See SetDefaultMessageType for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeWithContext(ctx aws.Context, input *SetDefaultMessageTypeInput, opts ...request.Option) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *PinpointSMSVoiceV2) SetDefaultMessageType(input *SetDefaultMessageTypeInput) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
return out, req.Send()
} | 0.654531 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
SetDefaultMessageTypeWithContext is the same as SetDefaultMessageType with the addition of
the ability to pass a context and additional request options.
See SetDefaultMessageType for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeWithContext(ctx aws.Context, input *SetDefaultMessageTypeInput, opts ...request.Option) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *PinpointSMSVoiceV2) SetDefaultSenderIdWithContext(ctx aws.Context, input *SetDefaultSenderIdInput, opts ...request.Option) (*SetDefaultSenderIdOutput, error) {
req, out := c.SetDefaultSenderIdRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.633054 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
SetDefaultMessageTypeWithContext is the same as SetDefaultMessageType with the addition of
the ability to pass a context and additional request options.
See SetDefaultMessageType for details on how to use this API operation.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *PinpointSMSVoiceV2) SetDefaultMessageTypeWithContext(ctx aws.Context, input *SetDefaultMessageTypeInput, opts ...request.Option) (*SetDefaultMessageTypeOutput, error) {
req, out := c.SetDefaultMessageTypeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *PinpointSMSVoiceV2) DeleteDefaultMessageTypeRequest(input *DeleteDefaultMessageTypeInput) (req *request.Request, output *DeleteDefaultMessageTypeOutput) {
op := &request.Operation{
Name: opDeleteDefaultMessageType,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteDefaultMessageTypeInput{}
}
output = &DeleteDefaultMessageTypeOutput{}
req = c.newRequest(op, input, output)
return
} | 0.601211 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListServiceNetworkServiceAssociations method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation.
pageNum := 0
err := client.ListServiceNetworkServiceAssociationsPages(params,
func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *VPCLattice) ListServiceNetworkServiceAssociationsRequest(input *ListServiceNetworkServiceAssociationsInput) (req *request.Request, output *ListServiceNetworkServiceAssociationsOutput) {
op := &request.Operation{
Name: opListServiceNetworkServiceAssociations,
HTTPMethod: "GET",
HTTPPath: "/servicenetworkserviceassociations",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "maxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListServiceNetworkServiceAssociationsInput{}
}
output = &ListServiceNetworkServiceAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.928105 | aws/aws-sdk-go | service/vpclattice/api.go | aws/aws-sdk-go | service/vpclattice/api.go | Apache-2.0 | go |
ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListServiceNetworkServiceAssociations method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation.
pageNum := 0
err := client.ListServiceNetworkServiceAssociationsPages(params,
func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *VPCLattice) ListServiceNetworkVpcAssociationsPages(input *ListServiceNetworkVpcAssociationsInput, fn func(*ListServiceNetworkVpcAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkVpcAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.912475 | aws/aws-sdk-go | service/vpclattice/api.go | aws/aws-sdk-go | service/vpclattice/api.go | Apache-2.0 | go |
ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListServiceNetworkServiceAssociations method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation.
pageNum := 0
err := client.ListServiceNetworkServiceAssociationsPages(params,
func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPagesWithContext(ctx aws.Context, input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListServiceNetworkServiceAssociationsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListServiceNetworkServiceAssociationsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListServiceNetworkServiceAssociationsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.912066 | aws/aws-sdk-go | service/vpclattice/api.go | aws/aws-sdk-go | service/vpclattice/api.go | Apache-2.0 | go |
ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListServiceNetworkServiceAssociations method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation.
pageNum := 0
err := client.ListServiceNetworkServiceAssociationsPages(params,
func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *VPCLattice) ListServiceNetworkVpcAssociationsPagesWithContext(ctx aws.Context, input *ListServiceNetworkVpcAssociationsInput, fn func(*ListServiceNetworkVpcAssociationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListServiceNetworkVpcAssociationsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListServiceNetworkVpcAssociationsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListServiceNetworkVpcAssociationsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.831815 | aws/aws-sdk-go | service/vpclattice/api.go | aws/aws-sdk-go | service/vpclattice/api.go | Apache-2.0 | go |
ListServiceNetworkServiceAssociationsPages iterates over the pages of a ListServiceNetworkServiceAssociations operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListServiceNetworkServiceAssociations method for more information on how to use this operation.
Note: This operation can generate multiple requests to a service.
// Example iterating over at most 3 pages of a ListServiceNetworkServiceAssociations operation.
pageNum := 0
err := client.ListServiceNetworkServiceAssociationsPages(params,
func(page *vpclattice.ListServiceNetworkServiceAssociationsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *VPCLattice) ListServiceNetworkServiceAssociationsPages(input *ListServiceNetworkServiceAssociationsInput, fn func(*ListServiceNetworkServiceAssociationsOutput, bool) bool) error {
return c.ListServiceNetworkServiceAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *VPCLattice) ListServiceNetworkVpcAssociationsRequest(input *ListServiceNetworkVpcAssociationsInput) (req *request.Request, output *ListServiceNetworkVpcAssociationsOutput) {
op := &request.Operation{
Name: opListServiceNetworkVpcAssociations,
HTTPMethod: "GET",
HTTPPath: "/servicenetworkvpcassociations",
Paginator: &request.Paginator{
InputTokens: []string{"nextToken"},
OutputTokens: []string{"nextToken"},
LimitToken: "maxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListServiceNetworkVpcAssociationsInput{}
}
output = &ListServiceNetworkVpcAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.829148 | aws/aws-sdk-go | service/vpclattice/api.go | aws/aws-sdk-go | service/vpclattice/api.go | Apache-2.0 | go |
ListPermissionVersionsPagesWithContext same as ListPermissionVersionsPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *RAM) ListPermissionVersionsPagesWithContext(ctx aws.Context, input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *RAM) ListPermissionVersionsWithContext(ctx aws.Context, input *ListPermissionVersionsInput, opts ...request.Option) (*ListPermissionVersionsOutput, error) {
req, out := c.ListPermissionVersionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.919855 | aws/aws-sdk-go | service/ram/api.go | aws/aws-sdk-go | service/ram/api.go | Apache-2.0 | go |
ListPermissionVersionsPagesWithContext same as ListPermissionVersionsPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *RAM) ListPermissionVersionsPagesWithContext(ctx aws.Context, input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *FinSpaceData) ListPermissionGroupsPagesWithContext(ctx aws.Context, input *ListPermissionGroupsInput, fn func(*ListPermissionGroupsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionGroupsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionGroupsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionGroupsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.846627 | aws/aws-sdk-go | service/ram/api.go | aws/aws-sdk-go | service/finspacedata/api.go | Apache-2.0 | go |
ListPermissionVersionsPagesWithContext same as ListPermissionVersionsPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *RAM) ListPermissionVersionsPagesWithContext(ctx aws.Context, input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *ManagedGrafana) ListPermissionsPagesWithContext(ctx aws.Context, input *ListPermissionsInput, fn func(*ListPermissionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.831663 | aws/aws-sdk-go | service/ram/api.go | aws/aws-sdk-go | service/managedgrafana/api.go | Apache-2.0 | go |
ListPermissionVersionsPagesWithContext same as ListPermissionVersionsPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *RAM) ListPermissionVersionsPagesWithContext(ctx aws.Context, input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *RAM) ListPermissionAssociationsPagesWithContext(ctx aws.Context, input *ListPermissionAssociationsInput, fn func(*ListPermissionAssociationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionAssociationsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionAssociationsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionAssociationsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.816849 | aws/aws-sdk-go | service/ram/api.go | aws/aws-sdk-go | service/ram/api.go | Apache-2.0 | go |
ListPermissionVersionsPagesWithContext same as ListPermissionVersionsPages except
it takes a Context and allows setting request options on the pages.
The context must be non-nil and will be used for request cancellation. If
the context is nil a panic will occur. In the future the SDK may create
sub-contexts for http.Requests. See https://golang.org/pkg/context/
for more information on using Contexts. | func (c *RAM) ListPermissionVersionsPagesWithContext(ctx aws.Context, input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListPermissionVersionsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListPermissionVersionsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListPermissionVersionsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *RAM) ListPermissionVersionsPages(input *ListPermissionVersionsInput, fn func(*ListPermissionVersionsOutput, bool) bool) error {
return c.ListPermissionVersionsPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.8095 | aws/aws-sdk-go | service/ram/api.go | aws/aws-sdk-go | service/ram/api.go | Apache-2.0 | go |
OldCreatedAt returns the old "created_at" field's value of the AddonRateCard entity.
If the AddonRateCard object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails. | func (m *AddonRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | func (m *PlanRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | 0.970663 | openmeterio/openmeter | openmeter/ent/db/mutation.go | openmeterio/openmeter | openmeter/ent/db/mutation.go | Apache-2.0 | go |
OldCreatedAt returns the old "created_at" field's value of the AddonRateCard entity.
If the AddonRateCard object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails. | func (m *AddonRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | func (m *AddonRateCardMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
}
return oldValue.UpdatedAt, nil
} | 0.898945 | openmeterio/openmeter | openmeter/ent/db/mutation.go | openmeterio/openmeter | openmeter/ent/db/mutation.go | Apache-2.0 | go |
OldCreatedAt returns the old "created_at" field's value of the AddonRateCard entity.
If the AddonRateCard object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails. | func (m *AddonRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | func (m *AddonMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | 0.890877 | openmeterio/openmeter | openmeter/ent/db/mutation.go | openmeterio/openmeter | openmeter/ent/db/mutation.go | Apache-2.0 | go |
OldCreatedAt returns the old "created_at" field's value of the AddonRateCard entity.
If the AddonRateCard object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails. | func (m *AddonRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | func (m *ProductMutation) OldCreatedAt(ctx context.Context) (v types.UnixTimestamp, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | 0.879461 | openmeterio/openmeter | openmeter/ent/db/mutation.go | OldSmokeGun/go-scaffold | internal/pkg/ent/ent/mutation.go | MIT | go |
OldCreatedAt returns the old "created_at" field's value of the AddonRateCard entity.
If the AddonRateCard object wasn't provided to the builder, the object is fetched from the database.
An error is returned if the mutation operation is not UpdateOne, or the database query fails. | func (m *AddonRateCardMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | func (m *BalanceSnapshotMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldCreatedAt requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
}
return oldValue.CreatedAt, nil
} | 0.877956 | openmeterio/openmeter | openmeter/ent/db/mutation.go | openmeterio/openmeter | openmeter/ent/db/mutation.go | Apache-2.0 | go |
SetLessThan returns a new value that represents the range of possible
values in v that are less than to the highest in o.
o must be of type *EnumValue. | func (v *EnumValue) SetLessThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | func (v *EnumValue) SetGreaterThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetGreaterThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | 0.933242 | google/agi | gapil/analysis/enum_value.go | google/agi | gapil/analysis/enum_value.go | Apache-2.0 | go |
SetLessThan returns a new value that represents the range of possible
values in v that are less than to the highest in o.
o must be of type *EnumValue. | func (v *EnumValue) SetLessThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | func (v *EnumValue) SetGreaterEqual(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetGreaterEqual(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | 0.894673 | google/agi | gapil/analysis/enum_value.go | google/agi | gapil/analysis/enum_value.go | Apache-2.0 | go |
SetLessThan returns a new value that represents the range of possible
values in v that are less than to the highest in o.
o must be of type *EnumValue. | func (v *EnumValue) SetLessThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | func (v *UintValue) SetLessThan(o Value) Value {
b := o.(*UintValue).span()
out := v.Clone().(*UintValue)
interval.Remove(&out.Ranges, interval.U64Span{Start: b.End - 1, End: ^uint64(0)})
return out
} | 0.890452 | google/agi | gapil/analysis/enum_value.go | google/agi | gapil/analysis/uint_value.go | Apache-2.0 | go |
SetLessThan returns a new value that represents the range of possible
values in v that are less than to the highest in o.
o must be of type *EnumValue. | func (v *EnumValue) SetLessThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | func (v *EnumValue) SetLessEqual(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessEqual(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | 0.881267 | google/agi | gapil/analysis/enum_value.go | google/agi | gapil/analysis/enum_value.go | Apache-2.0 | go |
SetLessThan returns a new value that represents the range of possible
values in v that are less than to the highest in o.
o must be of type *EnumValue. | func (v *EnumValue) SetLessThan(o Value) Value {
a, b := v, o.(*EnumValue)
return &EnumValue{
Ty: a.Ty,
Numbers: a.Numbers.SetLessThan(b.Numbers).(*UintValue),
Labels: a.joinLabels(b),
}
} | func (v *UintValue) SetGreaterThan(o Value) Value {
b := o.(*UintValue).span()
out := v.Clone().(*UintValue)
interval.Remove(&out.Ranges, interval.U64Span{Start: 0, End: b.Start + 1})
return out
} | 0.805283 | google/agi | gapil/analysis/enum_value.go | google/agi | gapil/analysis/uint_value.go | Apache-2.0 | go |
DescribeSenderIdsRequest generates a "aws/request.Request" representing the
client's request for the DescribeSenderIds operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeSenderIds for more information on using the DescribeSenderIds
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeSenderIdsRequest method.
req, resp := client.DescribeSenderIdsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/DescribeSenderIds | func (c *PinpointSMSVoiceV2) DescribeSenderIdsRequest(input *DescribeSenderIdsInput) (req *request.Request, output *DescribeSenderIdsOutput) {
op := &request.Operation{
Name: opDescribeSenderIds,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSenderIdsInput{}
}
output = &DescribeSenderIdsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *PinpointSMSVoiceV2) DescribeSenderIdsPages(input *DescribeSenderIdsInput, fn func(*DescribeSenderIdsOutput, bool) bool) error {
return c.DescribeSenderIdsPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.865284 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
DescribeSenderIdsRequest generates a "aws/request.Request" representing the
client's request for the DescribeSenderIds operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeSenderIds for more information on using the DescribeSenderIds
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeSenderIdsRequest method.
req, resp := client.DescribeSenderIdsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/DescribeSenderIds | func (c *PinpointSMSVoiceV2) DescribeSenderIdsRequest(input *DescribeSenderIdsInput) (req *request.Request, output *DescribeSenderIdsOutput) {
op := &request.Operation{
Name: opDescribeSenderIds,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSenderIdsInput{}
}
output = &DescribeSenderIdsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *PinpointSMSVoiceV2) DescribeSenderIdsWithContext(ctx aws.Context, input *DescribeSenderIdsInput, opts ...request.Option) (*DescribeSenderIdsOutput, error) {
req, out := c.DescribeSenderIdsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.837259 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
DescribeSenderIdsRequest generates a "aws/request.Request" representing the
client's request for the DescribeSenderIds operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeSenderIds for more information on using the DescribeSenderIds
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeSenderIdsRequest method.
req, resp := client.DescribeSenderIdsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/DescribeSenderIds | func (c *PinpointSMSVoiceV2) DescribeSenderIdsRequest(input *DescribeSenderIdsInput) (req *request.Request, output *DescribeSenderIdsOutput) {
op := &request.Operation{
Name: opDescribeSenderIds,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSenderIdsInput{}
}
output = &DescribeSenderIdsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *PinpointSMSVoiceV2) DescribeSenderIds(input *DescribeSenderIdsInput) (*DescribeSenderIdsOutput, error) {
req, out := c.DescribeSenderIdsRequest(input)
return out, req.Send()
} | 0.828075 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
DescribeSenderIdsRequest generates a "aws/request.Request" representing the
client's request for the DescribeSenderIds operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeSenderIds for more information on using the DescribeSenderIds
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeSenderIdsRequest method.
req, resp := client.DescribeSenderIdsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/DescribeSenderIds | func (c *PinpointSMSVoiceV2) DescribeSenderIdsRequest(input *DescribeSenderIdsInput) (req *request.Request, output *DescribeSenderIdsOutput) {
op := &request.Operation{
Name: opDescribeSenderIds,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSenderIdsInput{}
}
output = &DescribeSenderIdsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *PinpointSMSVoiceV2) RequestSenderIdRequest(input *RequestSenderIdInput) (req *request.Request, output *RequestSenderIdOutput) {
op := &request.Operation{
Name: opRequestSenderId,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &RequestSenderIdInput{}
}
output = &RequestSenderIdOutput{}
req = c.newRequest(op, input, output)
return
} | 0.799061 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
DescribeSenderIdsRequest generates a "aws/request.Request" representing the
client's request for the DescribeSenderIds operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeSenderIds for more information on using the DescribeSenderIds
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeSenderIdsRequest method.
req, resp := client.DescribeSenderIdsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/DescribeSenderIds | func (c *PinpointSMSVoiceV2) DescribeSenderIdsRequest(input *DescribeSenderIdsInput) (req *request.Request, output *DescribeSenderIdsOutput) {
op := &request.Operation{
Name: opDescribeSenderIds,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeSenderIdsInput{}
}
output = &DescribeSenderIdsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *PinpointSMSVoiceV2) DescribeSenderIdsPagesWithContext(ctx aws.Context, input *DescribeSenderIdsInput, fn func(*DescribeSenderIdsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeSenderIdsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeSenderIdsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeSenderIdsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.789604 | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | aws/aws-sdk-go | service/pinpointsmsvoicev2/api.go | Apache-2.0 | go |
WithFilteredResourceAttributes determinies which resource attributes to
add to metrics as metric labels. By default, it adds service.name,
service.namespace, and service.instance.id. This is recommended to avoid
writing duplicate timeseries against the same monitored resource. Use
WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
resource attributes to metric labels. | func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
return func(o *options) {
o.resourceAttributeFilter = filter
}
} | func ResourceAttributesToMonitoringMonitoredResource(attrs ReadOnlyAttributes) *monitoredrespb.MonitoredResource {
cloudPlatform, _ := attrs.GetString(string(semconv.CloudPlatformKey))
switch cloudPlatform {
case semconv.CloudPlatformGCPAppEngine.Value.AsString():
return createMonitoredResource(gaeInstance, attrs)
default:
return commonResourceAttributesToMonitoredResource(cloudPlatform, attrs)
}
} | 0.637572 | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go | Apache-2.0 | go |
WithFilteredResourceAttributes determinies which resource attributes to
add to metrics as metric labels. By default, it adds service.name,
service.namespace, and service.instance.id. This is recommended to avoid
writing duplicate timeseries against the same monitored resource. Use
WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
resource attributes to metric labels. | func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
return func(o *options) {
o.resourceAttributeFilter = filter
}
} | func ResourceAttributesToLoggingMonitoredResource(attrs ReadOnlyAttributes) *monitoredrespb.MonitoredResource {
cloudPlatform, _ := attrs.GetString(string(semconv.CloudPlatformKey))
switch cloudPlatform {
case semconv.CloudPlatformGCPAppEngine.Value.AsString():
return createMonitoredResource(gaeApp, attrs)
default:
return commonResourceAttributesToMonitoredResource(cloudPlatform, attrs)
}
} | 0.619658 | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping/resourcemapping.go | Apache-2.0 | go |
WithFilteredResourceAttributes determinies which resource attributes to
add to metrics as metric labels. By default, it adds service.name,
service.namespace, and service.instance.id. This is recommended to avoid
writing duplicate timeseries against the same monitored resource. Use
WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
resource attributes to metric labels. | func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
return func(o *options) {
o.resourceAttributeFilter = filter
}
} | func (w *worker) SetResource(r *resource.Resource) {
w.r = r
} | 0.589867 | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | config-syncer/config-syncer | vendor/go.opencensus.io/stats/view/worker.go | Apache-2.0 | go |
WithFilteredResourceAttributes determinies which resource attributes to
add to metrics as metric labels. By default, it adds service.name,
service.namespace, and service.instance.id. This is recommended to avoid
writing duplicate timeseries against the same monitored resource. Use
WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
resource attributes to metric labels. | func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
return func(o *options) {
o.resourceAttributeFilter = filter
}
} | func WithMonitoredResourceDescription(mrType string, mrLabels []string) func(o *options) {
return func(o *options) {
mrLabelSet := make(map[string]struct{})
for _, label := range mrLabels {
mrLabelSet[label] = struct{}{}
}
o.monitoredResourceDescription = MonitoredResourceDescription{
mrType: mrType,
mrLabels: mrLabelSet,
}
}
} | 0.58541 | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | Apache-2.0 | go |
WithFilteredResourceAttributes determinies which resource attributes to
add to metrics as metric labels. By default, it adds service.name,
service.namespace, and service.instance.id. This is recommended to avoid
writing duplicate timeseries against the same monitored resource. Use
WithFilteredResourceAttributes(NoAttributes()) to disable the addition of
resource attributes to metric labels. | func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) {
return func(o *options) {
o.resourceAttributeFilter = filter
}
} | func NewWithAttributes(schemaURL string, attrs ...attribute.KeyValue) *Resource {
resource := NewSchemaless(attrs...)
resource.schemaURL = schemaURL
return resource
} | 0.577641 | tektoncd/cli | vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go | Mirantis/cri-dockerd | vendor/go.opentelemetry.io/otel/sdk/resource/resource.go | Apache-2.0 | go |
AESCBCContentCipherBuilder returns a new encryption only AES/CBC mode structure using the provided padder. The provided cipher data generator
will be used to provide keys for content encryption.
Deprecated: This feature is in maintenance mode, no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information. | func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder {
return cbcContentCipherBuilder{generator: generator, padder: padder}
} | func AESGCMContentCipherBuilder(generator CipherDataGenerator) ContentCipherBuilder {
return gcmContentCipherBuilder{generator}
} | 0.824651 | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | aws/aws-sdk-go | service/s3/s3crypto/aes_gcm_content_cipher.go | Apache-2.0 | go |
AESCBCContentCipherBuilder returns a new encryption only AES/CBC mode structure using the provided padder. The provided cipher data generator
will be used to provide keys for content encryption.
Deprecated: This feature is in maintenance mode, no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information. | func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder {
return cbcContentCipherBuilder{generator: generator, padder: padder}
} | func AESGCMContentCipherBuilderV2(generator CipherDataGeneratorWithCEKAlg) ContentCipherBuilder {
return gcmContentCipherBuilderV2{generator}
} | 0.714829 | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | aws/aws-sdk-go | service/s3/s3crypto/aes_gcm_content_cipher.go | Apache-2.0 | go |
AESCBCContentCipherBuilder returns a new encryption only AES/CBC mode structure using the provided padder. The provided cipher data generator
will be used to provide keys for content encryption.
Deprecated: This feature is in maintenance mode, no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information. | func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder {
return cbcContentCipherBuilder{generator: generator, padder: padder}
} | func RegisterAESCBCContentCipher(registry *CryptoRegistry, padder Padder) error {
if registry == nil {
return errNilCryptoRegistry
}
name := AESCBC + "/" + padder.Name()
err := registry.AddCEK(name, newAESCBCContentCipher)
if err != nil {
return err
}
if err := registry.AddPadder(name, padder); err != nil {
return err
}
return nil
} | 0.700707 | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | Apache-2.0 | go |
AESCBCContentCipherBuilder returns a new encryption only AES/CBC mode structure using the provided padder. The provided cipher data generator
will be used to provide keys for content encryption.
Deprecated: This feature is in maintenance mode, no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information. | func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder {
return cbcContentCipherBuilder{generator: generator, padder: padder}
} | func (key *SecretKey) NewCBC(paddingMode PaddingMode) (cipher.AEAD, error) {
var pkcsMech uint
switch paddingMode {
case PaddingNone:
pkcsMech = key.Cipher.CBCMech
case PaddingPKCS:
pkcsMech = key.Cipher.CBCPKCSMech
default:
return nil, errors.New("unrecognized padding mode")
}
g := genericAead{
key: key,
overhead: 0,
nonceSize: key.BlockSize(),
makeMech: func(nonce []byte, additionalData []byte, encrypt bool) ([]*pkcs11.Mechanism, *pkcs11.GCMParams, error) {
if len(additionalData) > 0 {
return nil, nil, errors.New("additional data not supported for CBC mode")
}
return []*pkcs11.Mechanism{pkcs11.NewMechanism(pkcsMech, nonce)}, nil, nil
},
}
return g, nil
} | 0.685048 | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | tektoncd/cli | vendor/github.com/ThalesIgnite/crypto11/aead.go | Apache-2.0 | go |
AESCBCContentCipherBuilder returns a new encryption only AES/CBC mode structure using the provided padder. The provided cipher data generator
will be used to provide keys for content encryption.
Deprecated: This feature is in maintenance mode, no new updates will be released. Please see https://docs.aws.amazon.com/general/latest/gr/aws_sdk_cryptography.html for more information. | func AESCBCContentCipherBuilder(generator CipherDataGenerator, padder Padder) ContentCipherBuilder {
return cbcContentCipherBuilder{generator: generator, padder: padder}
} | func NewPKCS7Padder(blockSize int) Padder {
return pkcs7Padder{blockSize}
} | 0.639975 | aws/aws-sdk-go | service/s3/s3crypto/aes_cbc_content_cipher.go | aws/aws-sdk-go | service/s3/s3crypto/pkcs7_padder.go | Apache-2.0 | go |
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures
that the transformer cannot be recursively applied upon its own output.
An example use case is a transformer that splits a string by lines:
AcyclicTransformer("SplitLines", func(s string) []string{
return strings.Split(s, "\n")
})
Had this been an unfiltered [cmp.Transformer] instead, this would result in an
infinite cycle converting a string to []string to [][]string and so on. | func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option {
xf := xformFilter{cmp.Transformer(name, xformFunc)}
return cmp.FilterPath(xf.filter, xf.xform)
} | func Transformer(name string, f interface{}) Option {
v := reflect.ValueOf(f)
if !function.IsType(v.Type(), function.Transformer) || v.IsNil() {
panic(fmt.Sprintf("invalid transformer function: %T", f))
}
if name == "" {
name = function.NameOf(v)
if !identsRx.MatchString(name) {
name = "λ" // Lambda-symbol as placeholder name
}
} else if !identsRx.MatchString(name) {
panic(fmt.Sprintf("invalid name: %q", name))
}
tr := &transformer{name: name, fnc: reflect.ValueOf(f)}
if ti := v.Type().In(0); ti.Kind() != reflect.Interface || ti.NumMethod() > 0 {
tr.typ = ti
}
return tr
} | 0.593232 | docker/cli | vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go | k8snetworkplumbingwg/multus-cni | vendor/github.com/google/go-cmp/cmp/options.go | Apache-2.0 | go |
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures
that the transformer cannot be recursively applied upon its own output.
An example use case is a transformer that splits a string by lines:
AcyclicTransformer("SplitLines", func(s string) []string{
return strings.Split(s, "\n")
})
Had this been an unfiltered [cmp.Transformer] instead, this would result in an
infinite cycle converting a string to []string to [][]string and so on. | func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option {
xf := xformFilter{cmp.Transformer(name, xformFunc)}
return cmp.FilterPath(xf.filter, xf.xform)
} | func Transformer(name string, f interface{}) Option {
v := reflect.ValueOf(f)
if !function.IsType(v.Type(), function.Transformer) || v.IsNil() {
panic(fmt.Sprintf("invalid transformer function: %T", f))
}
if name == "" {
name = "λ" // Lambda-symbol as place-holder for anonymous transformer
}
if !isValid(name) {
panic(fmt.Sprintf("invalid name: %q", name))
}
tr := &transformer{name: name, fnc: reflect.ValueOf(f)}
if ti := v.Type().In(0); ti.Kind() != reflect.Interface || ti.NumMethod() > 0 {
tr.typ = ti
}
return tr
} | 0.576302 | docker/cli | vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go | docker/app | vendor/github.com/google/go-cmp/cmp/options.go | Apache-2.0 | go |
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures
that the transformer cannot be recursively applied upon its own output.
An example use case is a transformer that splits a string by lines:
AcyclicTransformer("SplitLines", func(s string) []string{
return strings.Split(s, "\n")
})
Had this been an unfiltered [cmp.Transformer] instead, this would result in an
infinite cycle converting a string to []string to [][]string and so on. | func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option {
xf := xformFilter{cmp.Transformer(name, xformFunc)}
return cmp.FilterPath(xf.filter, xf.xform)
} | func Map(mapping func(rune) rune) Transformer {
return Transformer{mapper(mapping)}
} | 0.539496 | docker/cli | vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go | k8snetworkplumbingwg/multus-cni | vendor/golang.org/x/text/runes/runes.go | Apache-2.0 | go |
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures
that the transformer cannot be recursively applied upon its own output.
An example use case is a transformer that splits a string by lines:
AcyclicTransformer("SplitLines", func(s string) []string{
return strings.Split(s, "\n")
})
Had this been an unfiltered [cmp.Transformer] instead, this would result in an
infinite cycle converting a string to []string to [][]string and so on. | func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option {
xf := xformFilter{cmp.Transformer(name, xformFunc)}
return cmp.FilterPath(xf.filter, xf.xform)
} | func SortMaps(lessFunc interface{}) cmp.Option {
vf := reflect.ValueOf(lessFunc)
if !function.IsType(vf.Type(), function.Less) || vf.IsNil() {
panic(fmt.Sprintf("invalid less function: %T", lessFunc))
}
ms := mapSorter{vf.Type().In(0), vf}
return cmp.FilterValues(ms.filter, cmp.Transformer("cmpopts.SortMaps", ms.sort))
} | 0.501508 | docker/cli | vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go | loggie-io/loggie | vendor/github.com/google/go-cmp/cmp/cmpopts/sort.go | Apache-2.0 | go |
AcyclicTransformer returns a [cmp.Transformer] with a filter applied that ensures
that the transformer cannot be recursively applied upon its own output.
An example use case is a transformer that splits a string by lines:
AcyclicTransformer("SplitLines", func(s string) []string{
return strings.Split(s, "\n")
})
Had this been an unfiltered [cmp.Transformer] instead, this would result in an
infinite cycle converting a string to []string to [][]string and so on. | func AcyclicTransformer(name string, xformFunc interface{}) cmp.Option {
xf := xformFilter{cmp.Transformer(name, xformFunc)}
return cmp.FilterPath(xf.filter, xf.xform)
} | func TransformString(f func(s string) string) Transformer {
return func(ans interface{}) interface{} {
// if the answer value passed in is the zero value of the appropriate type
if isZero(reflect.ValueOf(ans)) {
// skip this `Transformer` by returning a zero value of string.
// The original answer will be not affected,
// see survey.go#L125.
// A zero value of string should be returned to be handled by
// next Transformer in a composed Tranformer,
// see tranform.go#L75
return ""
}
// "ans" is never nil here, so we don't have to check that
// see survey.go#L338 for more.
// Make sure that the the answer's value was a typeof string.
s, ok := ans.(string)
if !ok {
return ""
}
return f(s)
}
} | 0.464598 | docker/cli | vendor/github.com/google/go-cmp/cmp/cmpopts/xform.go | tektoncd/cli | vendor/github.com/AlecAivazis/survey/v2/transform.go | Apache-2.0 | go |
Connect creates a new Client and then initializes it using the Connect method. This is equivalent to calling
NewClient followed by Client.Connect.
When creating an options.ClientOptions, the order the methods are called matters. Later Set*
methods will overwrite the values from previous Set* method invocations. This includes the
ApplyURI method. This allows callers to determine the order of precedence for option
application. For instance, if ApplyURI is called before SetAuth, the Credential from
SetAuth will overwrite the values from the connection string. If ApplyURI is called
after SetAuth, then its values will overwrite those from SetAuth.
The opts parameter is processed using options.MergeClientOptions, which will overwrite entire
option fields of previous options, there is no partial overwriting. For example, if Username is
set in the Auth field for the first option, and Password is set for the second but with no
Username, after the merge the Username field will be empty.
The NewClient function does not do any I/O and returns an error if the given options are invalid.
The Client.Connect method starts background goroutines to monitor the state of the deployment and does not do
any I/O in the main goroutine to prevent the main goroutine from blocking. Therefore, it will not error if the
deployment is down.
The Client.Ping method can be used to verify that the deployment is successfully connected and the
Client was correctly configured. | func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, error) {
c, err := NewClient(opts...)
if err != nil {
return nil, err
}
err = c.Connect(ctx)
if err != nil {
return nil, err
}
return c, nil
} | func NewClient(opts ...*options.ClientOptions) (*Client, error) {
clientOpt := options.MergeClientOptions(opts...)
id, err := uuid.New()
if err != nil {
return nil, err
}
client := &Client{id: id}
// ClusterClock
client.clock = new(session.ClusterClock)
// LocalThreshold
client.localThreshold = defaultLocalThreshold
if clientOpt.LocalThreshold != nil {
client.localThreshold = *clientOpt.LocalThreshold
}
// Monitor
if clientOpt.Monitor != nil {
client.monitor = clientOpt.Monitor
}
// ServerMonitor
if clientOpt.ServerMonitor != nil {
client.serverMonitor = clientOpt.ServerMonitor
}
// ReadConcern
client.readConcern = readconcern.New()
if clientOpt.ReadConcern != nil {
client.readConcern = clientOpt.ReadConcern
}
// ReadPreference
client.readPreference = readpref.Primary()
if clientOpt.ReadPreference != nil {
client.readPreference = clientOpt.ReadPreference
}
// BSONOptions
if clientOpt.BSONOptions != nil {
client.bsonOpts = clientOpt.BSONOptions
}
// Registry
client.registry = bson.DefaultRegistry
if clientOpt.Registry != nil {
client.registry = clientOpt.Registry
}
// RetryWrites
client.retryWrites = true // retry writes on by default
if clientOpt.RetryWrites != nil {
client.retryWrites = *clientOpt.RetryWrites
}
client.retryReads = true
if clientOpt.RetryReads != nil {
client.retryReads = *clientOpt.RetryReads
}
// Timeout
client.timeout = clientOpt.Timeout
client.httpClient = clientOpt.HTTPClient
// WriteConcern
if clientOpt.WriteConcern != nil {
client.writeConcern = clientOpt.WriteConcern
}
// AutoEncryptionOptions
if clientOpt.AutoEncryptionOptions != nil {
if err := client.configureAutoEncryption(clientOpt); err != nil {
return nil, err
}
} else {
client.cryptFLE = clientOpt.Crypt
}
// Deployment
if clientOpt.Deployment != nil {
client.deployment = clientOpt.Deployment
}
// Set default options
if clientOpt.MaxPoolSize == nil {
clientOpt.SetMaxPoolSize(defaultMaxPoolSize)
}
cfg, err := topology.NewConfig(clientOpt, client.clock)
if err != nil {
return nil, err
}
client.serverAPI = topology.ServerAPIFromServerOptions(cfg.ServerOpts)
if client.deployment == nil {
client.deployment, err = topology.New(cfg)
if err != nil {
return nil, replaceErrors(err)
}
}
// Create a logger for the client.
client.logger, err = newLogger(clientOpt.LoggerOptions)
if err != nil {
return nil, fmt.Errorf("invalid logger options: %w", err)
}
return client, nil
} | 0.877992 | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | Apache-2.0 | go |
Connect creates a new Client and then initializes it using the Connect method. This is equivalent to calling
NewClient followed by Client.Connect.
When creating an options.ClientOptions, the order the methods are called matters. Later Set*
methods will overwrite the values from previous Set* method invocations. This includes the
ApplyURI method. This allows callers to determine the order of precedence for option
application. For instance, if ApplyURI is called before SetAuth, the Credential from
SetAuth will overwrite the values from the connection string. If ApplyURI is called
after SetAuth, then its values will overwrite those from SetAuth.
The opts parameter is processed using options.MergeClientOptions, which will overwrite entire
option fields of previous options, there is no partial overwriting. For example, if Username is
set in the Auth field for the first option, and Password is set for the second but with no
Username, after the merge the Username field will be empty.
The NewClient function does not do any I/O and returns an error if the given options are invalid.
The Client.Connect method starts background goroutines to monitor the state of the deployment and does not do
any I/O in the main goroutine to prevent the main goroutine from blocking. Therefore, it will not error if the
deployment is down.
The Client.Ping method can be used to verify that the deployment is successfully connected and the
Client was correctly configured. | func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, error) {
c, err := NewClient(opts...)
if err != nil {
return nil, err
}
err = c.Connect(ctx)
if err != nil {
return nil, err
}
return c, nil
} | func MergeClientOptions(opts ...*ClientOptions) *ClientOptions {
c := Client()
for _, opt := range opts {
if opt == nil {
continue
}
if opt.Dialer != nil {
c.Dialer = opt.Dialer
}
if opt.AppName != nil {
c.AppName = opt.AppName
}
if opt.Auth != nil {
c.Auth = opt.Auth
}
if opt.AuthenticateToAnything != nil {
c.AuthenticateToAnything = opt.AuthenticateToAnything
}
if opt.Compressors != nil {
c.Compressors = opt.Compressors
}
if opt.ConnectTimeout != nil {
c.ConnectTimeout = opt.ConnectTimeout
}
if opt.Crypt != nil {
c.Crypt = opt.Crypt
}
if opt.HeartbeatInterval != nil {
c.HeartbeatInterval = opt.HeartbeatInterval
}
if len(opt.Hosts) > 0 {
c.Hosts = opt.Hosts
}
if opt.HTTPClient != nil {
c.HTTPClient = opt.HTTPClient
}
if opt.LoadBalanced != nil {
c.LoadBalanced = opt.LoadBalanced
}
if opt.LocalThreshold != nil {
c.LocalThreshold = opt.LocalThreshold
}
if opt.MaxConnIdleTime != nil {
c.MaxConnIdleTime = opt.MaxConnIdleTime
}
if opt.MaxPoolSize != nil {
c.MaxPoolSize = opt.MaxPoolSize
}
if opt.MinPoolSize != nil {
c.MinPoolSize = opt.MinPoolSize
}
if opt.MaxConnecting != nil {
c.MaxConnecting = opt.MaxConnecting
}
if opt.PoolMonitor != nil {
c.PoolMonitor = opt.PoolMonitor
}
if opt.Monitor != nil {
c.Monitor = opt.Monitor
}
if opt.ServerAPIOptions != nil {
c.ServerAPIOptions = opt.ServerAPIOptions
}
if opt.ServerMonitor != nil {
c.ServerMonitor = opt.ServerMonitor
}
if opt.ReadConcern != nil {
c.ReadConcern = opt.ReadConcern
}
if opt.ReadPreference != nil {
c.ReadPreference = opt.ReadPreference
}
if opt.BSONOptions != nil {
c.BSONOptions = opt.BSONOptions
}
if opt.Registry != nil {
c.Registry = opt.Registry
}
if opt.ReplicaSet != nil {
c.ReplicaSet = opt.ReplicaSet
}
if opt.RetryWrites != nil {
c.RetryWrites = opt.RetryWrites
}
if opt.RetryReads != nil {
c.RetryReads = opt.RetryReads
}
if opt.ServerSelectionTimeout != nil {
c.ServerSelectionTimeout = opt.ServerSelectionTimeout
}
if opt.Direct != nil {
c.Direct = opt.Direct
}
if opt.SocketTimeout != nil {
c.SocketTimeout = opt.SocketTimeout
}
if opt.SRVMaxHosts != nil {
c.SRVMaxHosts = opt.SRVMaxHosts
}
if opt.SRVServiceName != nil {
c.SRVServiceName = opt.SRVServiceName
}
if opt.Timeout != nil {
c.Timeout = opt.Timeout
}
if opt.TLSConfig != nil {
c.TLSConfig = opt.TLSConfig
}
if opt.WriteConcern != nil {
c.WriteConcern = opt.WriteConcern
}
if opt.ZlibLevel != nil {
c.ZlibLevel = opt.ZlibLevel
}
if opt.ZstdLevel != nil {
c.ZstdLevel = opt.ZstdLevel
}
if opt.AutoEncryptionOptions != nil {
c.AutoEncryptionOptions = opt.AutoEncryptionOptions
}
if opt.Deployment != nil {
c.Deployment = opt.Deployment
}
if opt.DisableOCSPEndpointCheck != nil {
c.DisableOCSPEndpointCheck = opt.DisableOCSPEndpointCheck
}
if opt.err != nil {
c.err = opt.err
}
if opt.cs != nil {
c.cs = opt.cs
}
if opt.LoggerOptions != nil {
c.LoggerOptions = opt.LoggerOptions
}
if opt.ServerMonitoringMode != nil {
c.ServerMonitoringMode = opt.ServerMonitoringMode
}
}
return c
} | 0.67854 | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go | Apache-2.0 | go |
Connect creates a new Client and then initializes it using the Connect method. This is equivalent to calling
NewClient followed by Client.Connect.
When creating an options.ClientOptions, the order the methods are called matters. Later Set*
methods will overwrite the values from previous Set* method invocations. This includes the
ApplyURI method. This allows callers to determine the order of precedence for option
application. For instance, if ApplyURI is called before SetAuth, the Credential from
SetAuth will overwrite the values from the connection string. If ApplyURI is called
after SetAuth, then its values will overwrite those from SetAuth.
The opts parameter is processed using options.MergeClientOptions, which will overwrite entire
option fields of previous options, there is no partial overwriting. For example, if Username is
set in the Auth field for the first option, and Password is set for the second but with no
Username, after the merge the Username field will be empty.
The NewClient function does not do any I/O and returns an error if the given options are invalid.
The Client.Connect method starts background goroutines to monitor the state of the deployment and does not do
any I/O in the main goroutine to prevent the main goroutine from blocking. Therefore, it will not error if the
deployment is down.
The Client.Ping method can be used to verify that the deployment is successfully connected and the
Client was correctly configured. | func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, error) {
c, err := NewClient(opts...)
if err != nil {
return nil, err
}
err = c.Connect(ctx)
if err != nil {
return nil, err
}
return c, nil
} | func (mi *ModuleInstance) NewClient(call goja.ConstructorCall) *goja.Object {
rt := mi.vu.Runtime()
var optionsArg map[string]interface{}
err := rt.ExportTo(call.Arguments[0], &optionsArg)
if err != nil {
common.Throw(rt, errors.New("unable to parse options object"))
}
opts, err := newOptionsFrom(optionsArg)
if err != nil {
common.Throw(rt, fmt.Errorf("invalid options; reason: %w", err))
}
client := &Client{
vu: mi.vu,
client: nil,
handshake: opts.HandshakeData,
responses: make(map[uint]chan []byte, 100),
pushes: make(map[string]chan []byte, 100),
timeout: time.Duration(opts.RequestTimeoutMs) * time.Millisecond,
metrics: mi.metrics,
useTLS: opts.UseTLS,
}
client.client = pitayaclient.New(logrus.InfoLevel)
client.client.SetClientHandshakeData(opts.HandshakeData)
return rt.ToValue(client).ToObject(rt)
} | 0.654988 | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | topfreegames/pitaya | xk6-pitaya/module.go | MIT | go |
Connect creates a new Client and then initializes it using the Connect method. This is equivalent to calling
NewClient followed by Client.Connect.
When creating an options.ClientOptions, the order the methods are called matters. Later Set*
methods will overwrite the values from previous Set* method invocations. This includes the
ApplyURI method. This allows callers to determine the order of precedence for option
application. For instance, if ApplyURI is called before SetAuth, the Credential from
SetAuth will overwrite the values from the connection string. If ApplyURI is called
after SetAuth, then its values will overwrite those from SetAuth.
The opts parameter is processed using options.MergeClientOptions, which will overwrite entire
option fields of previous options, there is no partial overwriting. For example, if Username is
set in the Auth field for the first option, and Password is set for the second but with no
Username, after the merge the Username field will be empty.
The NewClient function does not do any I/O and returns an error if the given options are invalid.
The Client.Connect method starts background goroutines to monitor the state of the deployment and does not do
any I/O in the main goroutine to prevent the main goroutine from blocking. Therefore, it will not error if the
deployment is down.
The Client.Ping method can be used to verify that the deployment is successfully connected and the
Client was correctly configured. | func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, error) {
c, err := NewClient(opts...)
if err != nil {
return nil, err
}
err = c.Connect(ctx)
if err != nil {
return nil, err
}
return c, nil
} | func NewClient(opts ...Opt) (*Client, error) {
cfg, seeds, compressor, err := validateCfg(opts...)
if err != nil {
return nil, err
}
if cfg.retryTimeout == nil {
cfg.retryTimeout = func(key int16) time.Duration {
switch key {
case ((*kmsg.JoinGroupRequest)(nil)).Key(),
((*kmsg.SyncGroupRequest)(nil)).Key(),
((*kmsg.HeartbeatRequest)(nil)).Key():
return cfg.sessionTimeout
}
return 30 * time.Second
}
}
if cfg.dialFn == nil {
dialer := &net.Dialer{Timeout: cfg.dialTimeout}
cfg.dialFn = dialer.DialContext
if cfg.dialTLS != nil {
cfg.dialFn = func(ctx context.Context, network, host string) (net.Conn, error) {
c := cfg.dialTLS.Clone()
if c.ServerName == "" {
server, _, err := net.SplitHostPort(host)
if err != nil {
return nil, fmt.Errorf("unable to split host:port for dialing: %w", err)
}
c.ServerName = server
}
return (&tls.Dialer{
NetDialer: dialer,
Config: c,
}).DialContext(ctx, network, host)
}
}
}
ctx, cancel := context.WithCancel(context.Background())
cl := &Client{
cfg: cfg,
ctx: ctx,
ctxCancel: cancel,
rng: func() func() float64 {
var mu sync.Mutex
rng := rand.New(rand.NewSource(time.Now().UnixNano()))
return func() float64 {
mu.Lock()
defer mu.Unlock()
return rng.Float64()
}
}(),
controllerID: unknownControllerID,
sinksAndSources: make(map[int32]sinkAndSource),
reqFormatter: kmsg.NewRequestFormatter(),
connTimeouter: connTimeouter{def: cfg.requestTimeoutOverhead},
bufPool: newBufPool(),
prsPool: newPrsPool(),
compressor: compressor,
decompressor: newDecompressor(),
coordinators: make(map[coordinatorKey]*coordinatorLoad),
updateMetadataCh: make(chan string, 1),
updateMetadataNowCh: make(chan string, 1),
blockingMetadataFnCh: make(chan func()),
metadone: make(chan struct{}),
}
// Before we start any goroutines below, we must notify any interested
// hooks of our existence.
cl.cfg.hooks.each(func(h Hook) {
if h, ok := h.(HookNewClient); ok {
h.OnNewClient(cl)
}
})
cl.producer.init(cl)
cl.consumer.init(cl)
cl.metawait.init()
if cfg.id != nil {
cl.reqFormatter = kmsg.NewRequestFormatter(kmsg.FormatterClientID(*cfg.id))
}
for i, seed := range seeds {
b := cl.newBroker(unknownSeedID(i), seed.host, seed.port, nil)
cl.seeds = append(cl.seeds, b)
}
sort.Slice(cl.seeds, func(i, j int) bool { return cl.seeds[i].meta.NodeID < cl.seeds[j].meta.NodeID })
go cl.updateMetadataLoop()
go cl.reapConnectionsLoop()
return cl, nil
} | 0.636486 | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | loggie-io/loggie | vendor/github.com/twmb/franz-go/pkg/kgo/client.go | Apache-2.0 | go |
Connect creates a new Client and then initializes it using the Connect method. This is equivalent to calling
NewClient followed by Client.Connect.
When creating an options.ClientOptions, the order the methods are called matters. Later Set*
methods will overwrite the values from previous Set* method invocations. This includes the
ApplyURI method. This allows callers to determine the order of precedence for option
application. For instance, if ApplyURI is called before SetAuth, the Credential from
SetAuth will overwrite the values from the connection string. If ApplyURI is called
after SetAuth, then its values will overwrite those from SetAuth.
The opts parameter is processed using options.MergeClientOptions, which will overwrite entire
option fields of previous options, there is no partial overwriting. For example, if Username is
set in the Auth field for the first option, and Password is set for the second but with no
Username, after the merge the Username field will be empty.
The NewClient function does not do any I/O and returns an error if the given options are invalid.
The Client.Connect method starts background goroutines to monitor the state of the deployment and does not do
any I/O in the main goroutine to prevent the main goroutine from blocking. Therefore, it will not error if the
deployment is down.
The Client.Ping method can be used to verify that the deployment is successfully connected and the
Client was correctly configured. | func Connect(ctx context.Context, opts ...*options.ClientOptions) (*Client, error) {
c, err := NewClient(opts...)
if err != nil {
return nil, err
}
err = c.Connect(ctx)
if err != nil {
return nil, err
}
return c, nil
} | func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveEndpointResolverV2(&options)
resolveTracerProvider(&options)
resolveMeterProvider(&options)
resolveAuthSchemeResolver(&options)
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttempts(&options)
ignoreAnonymousAuth(&options)
wrapWithAnonymousAuth(&options)
resolveAuthSchemes(&options)
client := &Client{
options: options,
}
initializeTimeOffsetResolver(client)
return client
} | 0.607544 | tektoncd/cli | vendor/go.mongodb.org/mongo-driver/mongo/client.go | tektoncd/cli | vendor/github.com/aws/aws-sdk-go-v2/service/ecrpublic/api_client.go | Apache-2.0 | go |
DescribeApplicationAssociationsRequest generates a "aws/request.Request" representing the
client's request for the DescribeApplicationAssociations operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeApplicationAssociations for more information on using the DescribeApplicationAssociations
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeApplicationAssociationsRequest method.
req, resp := client.DescribeApplicationAssociationsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeApplicationAssociations | func (c *WorkSpaces) DescribeApplicationAssociationsRequest(input *DescribeApplicationAssociationsInput) (req *request.Request, output *DescribeApplicationAssociationsOutput) {
op := &request.Operation{
Name: opDescribeApplicationAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeApplicationAssociationsInput{}
}
output = &DescribeApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *AppIntegrationsService) ListApplicationAssociationsRequest(input *ListApplicationAssociationsInput) (req *request.Request, output *ListApplicationAssociationsOutput) {
op := &request.Operation{
Name: opListApplicationAssociations,
HTTPMethod: "GET",
HTTPPath: "/applications/{ApplicationIdentifier}/associations",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListApplicationAssociationsInput{}
}
output = &ListApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.890565 | aws/aws-sdk-go | service/workspaces/api.go | aws/aws-sdk-go | service/appintegrationsservice/api.go | Apache-2.0 | go |
DescribeApplicationAssociationsRequest generates a "aws/request.Request" representing the
client's request for the DescribeApplicationAssociations operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeApplicationAssociations for more information on using the DescribeApplicationAssociations
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeApplicationAssociationsRequest method.
req, resp := client.DescribeApplicationAssociationsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeApplicationAssociations | func (c *WorkSpaces) DescribeApplicationAssociationsRequest(input *DescribeApplicationAssociationsInput) (req *request.Request, output *DescribeApplicationAssociationsOutput) {
op := &request.Operation{
Name: opDescribeApplicationAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeApplicationAssociationsInput{}
}
output = &DescribeApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *WorkSpaces) DescribeApplicationAssociationsPages(input *DescribeApplicationAssociationsInput, fn func(*DescribeApplicationAssociationsOutput, bool) bool) error {
return c.DescribeApplicationAssociationsPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.884164 | aws/aws-sdk-go | service/workspaces/api.go | aws/aws-sdk-go | service/workspaces/api.go | Apache-2.0 | go |
DescribeApplicationAssociationsRequest generates a "aws/request.Request" representing the
client's request for the DescribeApplicationAssociations operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeApplicationAssociations for more information on using the DescribeApplicationAssociations
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeApplicationAssociationsRequest method.
req, resp := client.DescribeApplicationAssociationsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeApplicationAssociations | func (c *WorkSpaces) DescribeApplicationAssociationsRequest(input *DescribeApplicationAssociationsInput) (req *request.Request, output *DescribeApplicationAssociationsOutput) {
op := &request.Operation{
Name: opDescribeApplicationAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeApplicationAssociationsInput{}
}
output = &DescribeApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *WorkSpaces) DescribeApplicationAssociationsWithContext(ctx aws.Context, input *DescribeApplicationAssociationsInput, opts ...request.Option) (*DescribeApplicationAssociationsOutput, error) {
req, out := c.DescribeApplicationAssociationsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.859745 | aws/aws-sdk-go | service/workspaces/api.go | aws/aws-sdk-go | service/workspaces/api.go | Apache-2.0 | go |
DescribeApplicationAssociationsRequest generates a "aws/request.Request" representing the
client's request for the DescribeApplicationAssociations operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeApplicationAssociations for more information on using the DescribeApplicationAssociations
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeApplicationAssociationsRequest method.
req, resp := client.DescribeApplicationAssociationsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeApplicationAssociations | func (c *WorkSpaces) DescribeApplicationAssociationsRequest(input *DescribeApplicationAssociationsInput) (req *request.Request, output *DescribeApplicationAssociationsOutput) {
op := &request.Operation{
Name: opDescribeApplicationAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeApplicationAssociationsInput{}
}
output = &DescribeApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *WorkSpaces) DescribeApplicationAssociationsPagesWithContext(ctx aws.Context, input *DescribeApplicationAssociationsInput, fn func(*DescribeApplicationAssociationsOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeApplicationAssociationsInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeApplicationAssociationsRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeApplicationAssociationsOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.824694 | aws/aws-sdk-go | service/workspaces/api.go | aws/aws-sdk-go | service/workspaces/api.go | Apache-2.0 | go |
DescribeApplicationAssociationsRequest generates a "aws/request.Request" representing the
client's request for the DescribeApplicationAssociations operation. The "output" return
value will be populated with the request's response once the request completes
successfully.
Use "Send" method on the returned Request to send the API call to the service.
the "output" return value is not valid until after Send returns without error.
See DescribeApplicationAssociations for more information on using the DescribeApplicationAssociations
API call, and error handling.
This method is useful when you want to inject custom logic or configuration
into the SDK's request lifecycle. Such as custom headers, or retry logic.
// Example sending a request using the DescribeApplicationAssociationsRequest method.
req, resp := client.DescribeApplicationAssociationsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeApplicationAssociations | func (c *WorkSpaces) DescribeApplicationAssociationsRequest(input *DescribeApplicationAssociationsInput) (req *request.Request, output *DescribeApplicationAssociationsOutput) {
op := &request.Operation{
Name: opDescribeApplicationAssociations,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &DescribeApplicationAssociationsInput{}
}
output = &DescribeApplicationAssociationsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *WorkSpaces) DescribeApplicationAssociations(input *DescribeApplicationAssociationsInput) (*DescribeApplicationAssociationsOutput, error) {
req, out := c.DescribeApplicationAssociationsRequest(input)
return out, req.Send()
} | 0.813884 | aws/aws-sdk-go | service/workspaces/api.go | aws/aws-sdk-go | service/workspaces/api.go | Apache-2.0 | go |
C documentation
/*
** Add a new name/number pair to a VList. This might require that the
** VList object be reallocated, so return the new VList. If an OOM
** error occurs, the original VList returned and the
** db->mallocFailed flag is set.
**
** A VList is really just an array of integers. To destroy a VList,
** simply pass it to sqlite3DbFree().
**
** The first integer is the number of integers allocated for the whole
** VList. The second integer is the number of integers actually used.
** Each name/number pair is encoded by subsequent groups of 3 or more
** integers.
**
** Each name/number pair starts with two integers which are the numeric
** value for the pair and the size of the name/number pair, respectively.
** The text name overlays one or more following integers. The text name
** is always zero-terminated.
**
** Conceptually:
**
** struct VList {
** int nAlloc; // Number of allocated slots
** int nUsed; // Number of used slots
** struct VListEntry {
** int iValue; // Value for this entry
** int nSlot; // Slots used by this entry
** // ... variable name goes here
** } a[0];
** }
**
** During code generation, pointers to the variable names within the
** VList are taken. When that happens, nAlloc is set to zero as an
** indication that the VList may never again be enlarged, since the
** accompanying realloc() would invalidate the pointers.
*/ | func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) (r uintptr) {
var i, nInt int32
var nAlloc Tsqlite3_int64
var pOut, z uintptr
var v1 int64
_, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */
nInt = nName/int32(4) + int32(3)
/* Verify ok to add new elements */
if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) {
if pIn != 0 {
v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn)))
} else {
v1 = int64(10)
}
/* Enlarge the allocation */
nAlloc = v1 + int64(nInt)
pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc)*uint64(4))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2)
}
pIn = pOut
*(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc)
}
i = *(*TVList)(unsafe.Pointer(pIn + 1*4))
*(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt
z = pIn + uintptr(i+int32(2))*4
*(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.X__builtin___memcpy_chk(tls, z, zName, libc.Uint64FromInt32(nName), ^t__predefined_size_t(0))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0
return pIn
} | func Xsqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) uintptr {
var nInt int32
var z uintptr
var i int32
nInt = nName/4 + 3
if pIn == uintptr(0) || *(*VList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*VList)(unsafe.Pointer(pIn)) {
var nAlloc Sqlite3_int64 = func() int64 {
if pIn != 0 {
return int64(2) * Sqlite3_int64(*(*VList)(unsafe.Pointer(pIn)))
}
return int64(10)
}() + Sqlite3_int64(nInt)
var pOut uintptr = Xsqlite3DbRealloc(tls, db, pIn, uint64(nAlloc)*uint64(unsafe.Sizeof(int32(0))))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*VList)(unsafe.Pointer(pOut + 1*4)) = 2
}
pIn = pOut
*(*VList)(unsafe.Pointer(pIn)) = VList(nAlloc)
}
i = *(*VList)(unsafe.Pointer(pIn + 1*4))
*(*VList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*VList)(unsafe.Pointer(pIn + uintptr(i+1)*4)) = nInt
z = pIn + uintptr(i+2)*4
*(*VList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.Xmemcpy(tls, z, zName, uint64(nName))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = int8(0)
return pIn
} | 0.750306 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | Apache-2.0 | go |
C documentation
/*
** Add a new name/number pair to a VList. This might require that the
** VList object be reallocated, so return the new VList. If an OOM
** error occurs, the original VList returned and the
** db->mallocFailed flag is set.
**
** A VList is really just an array of integers. To destroy a VList,
** simply pass it to sqlite3DbFree().
**
** The first integer is the number of integers allocated for the whole
** VList. The second integer is the number of integers actually used.
** Each name/number pair is encoded by subsequent groups of 3 or more
** integers.
**
** Each name/number pair starts with two integers which are the numeric
** value for the pair and the size of the name/number pair, respectively.
** The text name overlays one or more following integers. The text name
** is always zero-terminated.
**
** Conceptually:
**
** struct VList {
** int nAlloc; // Number of allocated slots
** int nUsed; // Number of used slots
** struct VListEntry {
** int iValue; // Value for this entry
** int nSlot; // Slots used by this entry
** // ... variable name goes here
** } a[0];
** }
**
** During code generation, pointers to the variable names within the
** VList are taken. When that happens, nAlloc is set to zero as an
** indication that the VList may never again be enlarged, since the
** accompanying realloc() would invalidate the pointers.
*/ | func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) (r uintptr) {
var i, nInt int32
var nAlloc Tsqlite3_int64
var pOut, z uintptr
var v1 int64
_, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */
nInt = nName/int32(4) + int32(3)
/* Verify ok to add new elements */
if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) {
if pIn != 0 {
v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn)))
} else {
v1 = int64(10)
}
/* Enlarge the allocation */
nAlloc = v1 + int64(nInt)
pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc)*uint64(4))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2)
}
pIn = pOut
*(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc)
}
i = *(*TVList)(unsafe.Pointer(pIn + 1*4))
*(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt
z = pIn + uintptr(i+int32(2))*4
*(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.X__builtin___memcpy_chk(tls, z, zName, libc.Uint64FromInt32(nName), ^t__predefined_size_t(0))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0
return pIn
} | func _sqlite3VListNumToName(tls *libc.TLS, pIn uintptr, iVal int32) (r uintptr) {
var i, mx int32
_, _ = i, mx
if pIn == uintptr(0) {
return uintptr(0)
}
mx = *(*TVList)(unsafe.Pointer(pIn + 1*4))
i = int32(2)
for cond := true; cond; cond = i < mx {
if *(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) == iVal {
return pIn + uintptr(i+int32(2))*4
}
i += *(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4))
}
return uintptr(0)
} | 0.626477 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | MIT | go |
C documentation
/*
** Add a new name/number pair to a VList. This might require that the
** VList object be reallocated, so return the new VList. If an OOM
** error occurs, the original VList returned and the
** db->mallocFailed flag is set.
**
** A VList is really just an array of integers. To destroy a VList,
** simply pass it to sqlite3DbFree().
**
** The first integer is the number of integers allocated for the whole
** VList. The second integer is the number of integers actually used.
** Each name/number pair is encoded by subsequent groups of 3 or more
** integers.
**
** Each name/number pair starts with two integers which are the numeric
** value for the pair and the size of the name/number pair, respectively.
** The text name overlays one or more following integers. The text name
** is always zero-terminated.
**
** Conceptually:
**
** struct VList {
** int nAlloc; // Number of allocated slots
** int nUsed; // Number of used slots
** struct VListEntry {
** int iValue; // Value for this entry
** int nSlot; // Slots used by this entry
** // ... variable name goes here
** } a[0];
** }
**
** During code generation, pointers to the variable names within the
** VList are taken. When that happens, nAlloc is set to zero as an
** indication that the VList may never again be enlarged, since the
** accompanying realloc() would invalidate the pointers.
*/ | func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) (r uintptr) {
var i, nInt int32
var nAlloc Tsqlite3_int64
var pOut, z uintptr
var v1 int64
_, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */
nInt = nName/int32(4) + int32(3)
/* Verify ok to add new elements */
if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) {
if pIn != 0 {
v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn)))
} else {
v1 = int64(10)
}
/* Enlarge the allocation */
nAlloc = v1 + int64(nInt)
pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc)*uint64(4))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2)
}
pIn = pOut
*(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc)
}
i = *(*TVList)(unsafe.Pointer(pIn + 1*4))
*(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt
z = pIn + uintptr(i+int32(2))*4
*(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.X__builtin___memcpy_chk(tls, z, zName, libc.Uint64FromInt32(nName), ^t__predefined_size_t(0))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0
return pIn
} | func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r int32) {
bp := tls.Alloc(32)
defer tls.Free(32)
var iTrunk TPgno
var nFree, nLeaf Tu32
var pPage1 uintptr
var v1, v3, v5 int32
var v2, v4, v6 bool
var _ /* pPage at bp+8 */ uintptr
var _ /* pTrunk at bp+0 */ uintptr
var _ /* rc at bp+16 */ int32
_, _, _, _, _, _, _, _, _, _ = iTrunk, nFree, nLeaf, pPage1, v1, v2, v3, v4, v5, v6
*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Free-list trunk page */
iTrunk = uint32(0) /* Page number of free-list trunk page */
pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */
if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage {
return _sqlite3CorruptError(tls, int32(77551))
}
if pMemPage != 0 {
*(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage
_sqlite3PagerRef(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
} else {
*(*uintptr)(unsafe.Pointer(bp + 8)) = _btreePageLookup(tls, pBt, iPage)
}
/* Increment the free page count on pPage1 */
*(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FpDbPage)
if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
goto freepage_out
}
nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36)
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36, nFree+uint32(1))
if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) != 0 {
/* If the secure_delete option is enabled, then
** always fully overwrite deleted information with zeros.
*/
if v2 = !(*(*uintptr)(unsafe.Pointer(bp + 8)) != 0); v2 {
v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0)
*(*int32)(unsafe.Pointer(bp + 16)) = v1
}
if v4 = v2 && v1 != 0; !v4 {
v3 = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
*(*int32)(unsafe.Pointer(bp + 16)) = v3
}
if v4 || v3 != 0 {
goto freepage_out
}
libc.X__builtin___memset_chk(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, 0, uint64((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpBt)).FpageSize), ^t__predefined_size_t(0))
}
/* If the database supports auto-vacuum, write an entry in the pointer-map
** to indicate that the page is free.
*/
if (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0 {
_ptrmapPut(tls, pBt, iPage, uint8(PTRMAP_FREEPAGE), uint32(0), bp+16)
if *(*int32)(unsafe.Pointer(bp + 16)) != 0 {
goto freepage_out
}
}
/* Now manipulate the actual database free-list structure. There are two
** possibilities. If the free-list is currently empty, or if the first
** trunk page in the free-list is full, then this page will become a
** new free-list trunk page. Otherwise, it will become a leaf of the
** first trunk page in the current free-list. This block tests if it
** is possible to add the page as a new free-list leaf.
*/
if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */
iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32)
if iTrunk > _btreePagecount(tls, pBt) {
*(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598))
goto freepage_out
}
*(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0)
if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK {
goto freepage_out
}
nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4)
if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) {
*(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609))
goto freepage_out
}
if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) {
/* In this case there is room on the trunk page to insert the page
** being freed as a new leaf.
**
** Note that the trunk page is not really full until it contains
** usableSize/4 - 2 entries, not usableSize/4 - 8 entries as we have
** coded. But due to a coding error in versions of SQLite prior to
** 3.6.0, databases with freelist trunk pages holding more than
** usableSize/4 - 8 entries will be reported as corrupt. In order
** to maintain backwards compatibility with older versions of SQLite,
** we will continue to restrict the number of entries to usableSize/4 - 8
** for now. At some point in the future (once everyone has upgraded
** to 3.6.0 or later) we should consider fixing the conditional above
** to read "usableSize/4-2" instead of "usableSize/4-8".
**
** EVIDENCE-OF: R-19920-11576 However, newer versions of SQLite still
** avoid using the last six entries in the freelist trunk page array in
** order that database files created by newer versions of SQLite can be
** read by older versions of SQLite.
*/
*(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage)
if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK {
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4, nLeaf+uint32(1))
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+uintptr(uint32(8)+nLeaf*uint32(4)), iPage)
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 && libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_SECURE_DELETE) == 0 {
_sqlite3PagerDontWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
}
*(*int32)(unsafe.Pointer(bp + 16)) = _btreeSetHasContent(tls, pBt, iPage)
}
goto freepage_out
}
}
/* If control flows to this point, then it was not possible to add the
** the page being freed as a leaf page of the first trunk in the free-list.
** Possibly because the free-list is empty, or possibly because the
** first trunk in the free-list is full. Either way, the page being freed
** will become the new first trunk page in the free-list.
*/
if v6 = *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0); v6 {
v5 = _btreeGetPage(tls, pBt, iPage, bp+8, 0)
*(*int32)(unsafe.Pointer(bp + 16)) = v5
}
if v6 && SQLITE_OK != v5 {
goto freepage_out
}
*(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FpDbPage)
if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK {
goto freepage_out
}
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData, iTrunk)
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FaData+4, uint32(0))
_sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32, iPage)
goto freepage_out
freepage_out:
;
if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 {
(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FisInit = uint8(0)
}
_releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 8)))
_releasePage(tls, *(*uintptr)(unsafe.Pointer(bp)))
return *(*int32)(unsafe.Pointer(bp + 16))
} | 0.606416 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | MIT | go |
C documentation
/*
** Add a new name/number pair to a VList. This might require that the
** VList object be reallocated, so return the new VList. If an OOM
** error occurs, the original VList returned and the
** db->mallocFailed flag is set.
**
** A VList is really just an array of integers. To destroy a VList,
** simply pass it to sqlite3DbFree().
**
** The first integer is the number of integers allocated for the whole
** VList. The second integer is the number of integers actually used.
** Each name/number pair is encoded by subsequent groups of 3 or more
** integers.
**
** Each name/number pair starts with two integers which are the numeric
** value for the pair and the size of the name/number pair, respectively.
** The text name overlays one or more following integers. The text name
** is always zero-terminated.
**
** Conceptually:
**
** struct VList {
** int nAlloc; // Number of allocated slots
** int nUsed; // Number of used slots
** struct VListEntry {
** int iValue; // Value for this entry
** int nSlot; // Slots used by this entry
** // ... variable name goes here
** } a[0];
** }
**
** During code generation, pointers to the variable names within the
** VList are taken. When that happens, nAlloc is set to zero as an
** indication that the VList may never again be enlarged, since the
** accompanying realloc() would invalidate the pointers.
*/ | func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) (r uintptr) {
var i, nInt int32
var nAlloc Tsqlite3_int64
var pOut, z uintptr
var v1 int64
_, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */
nInt = nName/int32(4) + int32(3)
/* Verify ok to add new elements */
if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) {
if pIn != 0 {
v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn)))
} else {
v1 = int64(10)
}
/* Enlarge the allocation */
nAlloc = v1 + int64(nInt)
pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc)*uint64(4))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2)
}
pIn = pOut
*(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc)
}
i = *(*TVList)(unsafe.Pointer(pIn + 1*4))
*(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt
z = pIn + uintptr(i+int32(2))*4
*(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.X__builtin___memcpy_chk(tls, z, zName, libc.Uint64FromInt32(nName), ^t__predefined_size_t(0))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0
return pIn
} | func _sqlite3VdbeValueListFree(tls *libc.TLS, pToDelete uintptr) {
Xsqlite3_free(tls, pToDelete)
} | 0.604536 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | MIT | go |
C documentation
/*
** Add a new name/number pair to a VList. This might require that the
** VList object be reallocated, so return the new VList. If an OOM
** error occurs, the original VList returned and the
** db->mallocFailed flag is set.
**
** A VList is really just an array of integers. To destroy a VList,
** simply pass it to sqlite3DbFree().
**
** The first integer is the number of integers allocated for the whole
** VList. The second integer is the number of integers actually used.
** Each name/number pair is encoded by subsequent groups of 3 or more
** integers.
**
** Each name/number pair starts with two integers which are the numeric
** value for the pair and the size of the name/number pair, respectively.
** The text name overlays one or more following integers. The text name
** is always zero-terminated.
**
** Conceptually:
**
** struct VList {
** int nAlloc; // Number of allocated slots
** int nUsed; // Number of used slots
** struct VListEntry {
** int iValue; // Value for this entry
** int nSlot; // Slots used by this entry
** // ... variable name goes here
** } a[0];
** }
**
** During code generation, pointers to the variable names within the
** VList are taken. When that happens, nAlloc is set to zero as an
** indication that the VList may never again be enlarged, since the
** accompanying realloc() would invalidate the pointers.
*/ | func _sqlite3VListAdd(tls *libc.TLS, db uintptr, pIn uintptr, zName uintptr, nName int32, iVal int32) (r uintptr) {
var i, nInt int32
var nAlloc Tsqlite3_int64
var pOut, z uintptr
var v1 int64
_, _, _, _, _, _ = i, nAlloc, nInt, pOut, z, v1 /* Index in pIn[] where zName is stored */
nInt = nName/int32(4) + int32(3)
/* Verify ok to add new elements */
if pIn == uintptr(0) || *(*TVList)(unsafe.Pointer(pIn + 1*4))+nInt > *(*TVList)(unsafe.Pointer(pIn)) {
if pIn != 0 {
v1 = int64(2) * int64(*(*TVList)(unsafe.Pointer(pIn)))
} else {
v1 = int64(10)
}
/* Enlarge the allocation */
nAlloc = v1 + int64(nInt)
pOut = _sqlite3DbRealloc(tls, db, pIn, libc.Uint64FromInt64(nAlloc)*uint64(4))
if pOut == uintptr(0) {
return pIn
}
if pIn == uintptr(0) {
*(*TVList)(unsafe.Pointer(pOut + 1*4)) = int32(2)
}
pIn = pOut
*(*TVList)(unsafe.Pointer(pIn)) = int32(nAlloc)
}
i = *(*TVList)(unsafe.Pointer(pIn + 1*4))
*(*TVList)(unsafe.Pointer(pIn + uintptr(i)*4)) = iVal
*(*TVList)(unsafe.Pointer(pIn + uintptr(i+int32(1))*4)) = nInt
z = pIn + uintptr(i+int32(2))*4
*(*TVList)(unsafe.Pointer(pIn + 1*4)) = i + nInt
libc.X__builtin___memcpy_chk(tls, z, zName, libc.Uint64FromInt32(nName), ^t__predefined_size_t(0))
*(*int8)(unsafe.Pointer(z + uintptr(nName))) = 0
return pIn
} | func _sqlite3Malloc(tls *libc.TLS, n Tu64) (r uintptr) {
bp := tls.Alloc(16)
defer tls.Free(16)
var _ /* p at bp+0 */ uintptr
if n == uint64(0) || n > uint64(SQLITE_MAX_ALLOCATION_SIZE) {
*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
} else {
if _sqlite3Config.FbMemstat != 0 {
Xsqlite3_mutex_enter(tls, _mem0.Fmutex)
_mallocWithAlarm(tls, libc.Int32FromUint64(n), bp)
Xsqlite3_mutex_leave(tls, _mem0.Fmutex)
} else {
*(*uintptr)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, int32) uintptr)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxMalloc})))(tls, libc.Int32FromUint64(n))
}
}
/* IMP: R-11148-40995 */
return *(*uintptr)(unsafe.Pointer(bp))
} | 0.596705 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | MIT | go |
GetLockFile opens a read-write lock file, creating it if necessary. The
*LockFile object may already be locked if the path has already been requested
by the current process. | func GetLockFile(path string) (*LockFile, error) {
return getLockfile(path, false)
} | func GetROLockFile(path string) (*LockFile, error) {
return getLockfile(path, true)
} | 0.917344 | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | Apache-2.0 | go |
GetLockFile opens a read-write lock file, creating it if necessary. The
*LockFile object may already be locked if the path has already been requested
by the current process. | func GetLockFile(path string) (*LockFile, error) {
return getLockfile(path, false)
} | func GetLockfile(path string) (Locker, error) {
return GetLockFile(path)
} | 0.867671 | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | Apache-2.0 | go |
GetLockFile opens a read-write lock file, creating it if necessary. The
*LockFile object may already be locked if the path has already been requested
by the current process. | func GetLockFile(path string) (*LockFile, error) {
return getLockfile(path, false)
} | func getLockfile(path string, ro bool) (*LockFile, error) {
lockFilesLock.Lock()
defer lockFilesLock.Unlock()
if lockFiles == nil {
lockFiles = make(map[string]*LockFile)
}
cleanPath, err := filepath.Abs(path)
if err != nil {
return nil, fmt.Errorf("ensuring that path %q is an absolute path: %w", path, err)
}
if lockFile, ok := lockFiles[cleanPath]; ok {
if ro && lockFile.IsReadWrite() {
return nil, fmt.Errorf("lock %q is not a read-only lock", cleanPath)
}
if !ro && !lockFile.IsReadWrite() {
return nil, fmt.Errorf("lock %q is not a read-write lock", cleanPath)
}
return lockFile, nil
}
lockFile, err := createLockFileForPath(cleanPath, ro) // platform-dependent LockFile
if err != nil {
return nil, err
}
lockFiles[cleanPath] = lockFile
return lockFile, nil
} | 0.826 | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | Apache-2.0 | go |
GetLockFile opens a read-write lock file, creating it if necessary. The
*LockFile object may already be locked if the path has already been requested
by the current process. | func GetLockFile(path string) (*LockFile, error) {
return getLockfile(path, false)
} | func createLockFileForPath(path string, ro bool) (*LockFile, error) {
// Check if we can open the lock.
fd, err := openLock(path, ro)
if err != nil {
return nil, err
}
unlockAndCloseHandle(fd)
lType := writeLock
if ro {
lType = readLock
}
return &LockFile{
file: path,
ro: ro,
rwMutex: &sync.RWMutex{},
stateMutex: &sync.Mutex{},
lw: newLastWrite(), // For compatibility, the first call of .Modified() will always report a change.
lockType: lType,
locked: false,
}, nil
} | 0.801248 | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | Apache-2.0 | go |
GetLockFile opens a read-write lock file, creating it if necessary. The
*LockFile object may already be locked if the path has already been requested
by the current process. | func GetLockFile(path string) (*LockFile, error) {
return getLockfile(path, false)
} | func GetROLockfile(path string) (Locker, error) {
return GetROLockFile(path)
} | 0.787954 | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | containers/podman-tui | vendor/github.com/containers/storage/pkg/lockfile/lockfile.go | Apache-2.0 | go |
End of preview. Expand
in Data Studio
multilingual-codesearch-hard-negativesV2
このデータセットは、多言語コード検索タスク向けに設計された、ハードネガティブペアを提供します。
複数のプログラミング言語から収集した、フィルタ済みのコード/ドックストリング対を基に構成されています。
データセット概要
各サンプルには以下の情報が含まれます。
query_docstring
: 関数やメソッドの自然言語による説明positive_code
: 対応する正しいコード実装hard_negative_code
: 類似しているが意味が異なるコード(FAISSによる近傍検索で選定)similarity_score
: クエリとハードネガティブ間のFAISS類似度スコア(内積/コサイン類似度)- 付加情報: リポジトリ、ファイルパス、ライセンス情報、言語
対応言語
- Python
- Java
- JavaScript
- PHP
- Ruby
- Go
- Rust
データセット作成方法
- 3行以上のドックストリングを持つペアのみをフィルタリングし各言語ごとに最大10万件の関数レベルのコードを取得。
- 各クエリに対して、埋め込み空間内で20件の近傍候補をFAISS検索。
- その中から5件のハードネガティブを選択(自身は除外)。
- コード/ドックストリングの埋め込みには
Shuu12121/CodeSearch-ModernBERT-Crow-Plus
を使用。 - Pythonコードに対しては、マルチラインドックストリングを削除処理。
想定される用途
- Cross-Encoderモデルのトレーニング(コード検索精度向上目的)
- ハードネガティブマイニングによる検索性能向上
- 多言語対応のコード理解モデルのファインチューニング
- Downloads last month
- 26