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 |
---|---|---|---|---|---|---|---|---|---|
ListTopicsPages iterates over the pages of a ListTopics operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListTopics 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 ListTopics operation.
pageNum := 0
err := client.ListTopicsPages(params,
func(page *sns.ListTopicsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *QuickSight) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.979463 | aws/aws-sdk-go | service/sns/api.go | aws/aws-sdk-go | service/quicksight/api.go | Apache-2.0 | go |
ListTopicsPages iterates over the pages of a ListTopics operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListTopics 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 ListTopics operation.
pageNum := 0
err := client.ListTopicsPages(params,
func(page *sns.ListTopicsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *SNS) ListSubscriptionsByTopicPages(input *ListSubscriptionsByTopicInput, fn func(*ListSubscriptionsByTopicOutput, bool) bool) error {
return c.ListSubscriptionsByTopicPagesWithContext(aws.BackgroundContext(), input, fn)
} | 0.823751 | aws/aws-sdk-go | service/sns/api.go | aws/aws-sdk-go | service/sns/api.go | Apache-2.0 | go |
ListTopicsPages iterates over the pages of a ListTopics operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListTopics 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 ListTopics operation.
pageNum := 0
err := client.ListTopicsPages(params,
func(page *sns.ListTopicsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *SNS) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, output *ListTopicsOutput) {
op := &request.Operation{
Name: opListTopics,
HTTPMethod: "POST",
HTTPPath: "/",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "",
TruncationToken: "",
},
}
if input == nil {
input = &ListTopicsInput{}
}
output = &ListTopicsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.819139 | aws/aws-sdk-go | service/sns/api.go | aws/aws-sdk-go | service/sns/api.go | Apache-2.0 | go |
ListTopicsPages iterates over the pages of a ListTopics operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListTopics 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 ListTopics operation.
pageNum := 0
err := client.ListTopicsPages(params,
func(page *sns.ListTopicsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *QuickSight) ListTopicsRequest(input *ListTopicsInput) (req *request.Request, output *ListTopicsOutput) {
op := &request.Operation{
Name: opListTopics,
HTTPMethod: "GET",
HTTPPath: "/accounts/{AwsAccountId}/topics",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListTopicsInput{}
}
output = &ListTopicsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.804484 | aws/aws-sdk-go | service/sns/api.go | aws/aws-sdk-go | service/quicksight/api.go | Apache-2.0 | go |
ListTopicsPages iterates over the pages of a ListTopics operation,
calling the "fn" function with the response data for each page. To stop
iterating, return false from the fn function.
See ListTopics 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 ListTopics operation.
pageNum := 0
err := client.ListTopicsPages(params,
func(page *sns.ListTopicsOutput, lastPage bool) bool {
pageNum++
fmt.Println(page)
return pageNum <= 3
}) | func (c *SNS) ListTopicsPages(input *ListTopicsInput, fn func(*ListTopicsOutput, bool) bool) error {
return c.ListTopicsPagesWithContext(aws.BackgroundContext(), input, fn)
} | func (c *SNS) ListTopics(input *ListTopicsInput) (*ListTopicsOutput, error) {
req, out := c.ListTopicsRequest(input)
return out, req.Send()
} | 0.761139 | aws/aws-sdk-go | service/sns/api.go | aws/aws-sdk-go | service/sns/api.go | Apache-2.0 | go |
C documentation
/*
** Delete an Fts5VtoVTokenizer wrapper tokenizer.
*/ | func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
p = pTok
if p != 0 {
if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
} else {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
}
Xsqlite3_free(tls, p)
}
} | func _fts5PorterDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
if pTok != 0 {
p = pTok
if (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxDelete})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer)
}
Xsqlite3_free(tls, p)
}
} | 0.741223 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | MIT | go |
C documentation
/*
** Delete an Fts5VtoVTokenizer wrapper tokenizer.
*/ | func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
p = pTok
if p != 0 {
if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
} else {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
}
Xsqlite3_free(tls, p)
}
} | func _fts5TokendataIterDelete(tls *libc.TLS, pSet uintptr) {
var ii int32
_ = ii
if pSet != 0 {
ii = 0
for {
if !(ii < (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FnIter) {
break
}
_fts5MultiIterFree(tls, *(*uintptr)(unsafe.Pointer(pSet + 56 + uintptr(ii)*8)))
goto _1
_1:
;
ii++
}
_sqlite3Fts5BufferFree(tls, pSet+16)
Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaPoslistReader)
Xsqlite3_free(tls, (*TFts5TokenDataIter)(unsafe.Pointer(pSet)).FaMap)
Xsqlite3_free(tls, pSet)
}
} | 0.736605 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | MIT | go |
C documentation
/*
** Delete an Fts5VtoVTokenizer wrapper tokenizer.
*/ | func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
p = pTok
if p != 0 {
if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
} else {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
}
Xsqlite3_free(tls, p)
}
} | func _fts5CreateTokenizer_v2(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) (r int32) {
bp := tls.Alloc(16)
defer tls.Free(16)
var pGlobal uintptr
var rc int32
var _ /* pNew at bp+0 */ uintptr
_, _ = pGlobal, rc
pGlobal = pApi
rc = SQLITE_OK
if (*Tfts5_tokenizer_v2)(unsafe.Pointer(pTokenizer)).FiVersion > int32(2) {
rc = int32(SQLITE_ERROR)
} else {
*(*uintptr)(unsafe.Pointer(bp)) = uintptr(0)
rc = _fts5NewTokenizerModule(tls, pGlobal, zName, pUserData, xDestroy, bp)
if *(*uintptr)(unsafe.Pointer(bp)) != 0 {
(*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx2 = *(*Tfts5_tokenizer_v2)(unsafe.Pointer(pTokenizer))
(*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FbV2Native = int32(1)
(*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxCreate = __ccgo_fp(_fts5VtoVCreate)
(*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxTokenize = __ccgo_fp(_fts5V1toV2Tokenize)
(*TFts5TokenizerModule)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Fx1.FxDelete = __ccgo_fp(_fts5VtoVDelete)
}
}
return rc
} | 0.735041 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | MIT | go |
C documentation
/*
** Delete an Fts5VtoVTokenizer wrapper tokenizer.
*/ | func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
p = pTok
if p != 0 {
if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
} else {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
}
Xsqlite3_free(tls, p)
}
} | func _fts5VtoVCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, ppOut uintptr) (r int32) {
bp := tls.Alloc(16)
defer tls.Free(16)
var pMod, pNew uintptr
var _ /* rc at bp+0 */ int32
_, _ = pMod, pNew
pMod = pCtx
pNew = uintptr(0)
*(*int32)(unsafe.Pointer(bp)) = SQLITE_OK
pNew = _sqlite3Fts5MallocZero(tls, bp, int64(72))
if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK {
(*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).Fx1 = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1
(*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).Fx2 = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx2
(*TFts5VtoVTokenizer)(unsafe.Pointer(pNew)).FbV2Native = (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native
if (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FbV2Native != 0 {
*(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx2.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, azArg, nArg, pNew+64)
} else {
*(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5TokenizerModule)(unsafe.Pointer(pMod)).Fx1.FxCreate})))(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pMod)).FpUserData, azArg, nArg, pNew+64)
}
if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK {
Xsqlite3_free(tls, pNew)
pNew = uintptr(0)
}
}
*(*uintptr)(unsafe.Pointer(ppOut)) = pNew
return *(*int32)(unsafe.Pointer(bp))
} | 0.724371 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | MIT | go |
C documentation
/*
** Delete an Fts5VtoVTokenizer wrapper tokenizer.
*/ | func _fts5VtoVDelete(tls *libc.TLS, pTok uintptr) {
var p uintptr
_ = p
p = pTok
if p != 0 {
if (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FbV2Native != 0 {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx2.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
} else {
(*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFts5VtoVTokenizer)(unsafe.Pointer(p)).Fx1.FxDelete})))(tls, (*TFts5VtoVTokenizer)(unsafe.Pointer(p)).FpReal)
}
Xsqlite3_free(tls, p)
}
} | func _fts5CreateTokenizer(tls *libc.TLS, pApi uintptr, zName uintptr, pUserData uintptr, pTokenizer uintptr, xDestroy uintptr) (r int32) {
var nByte, nName Tsqlite3_int64
var pGlobal, pNew uintptr
var rc int32
_, _, _, _, _ = nByte, nName, pGlobal, pNew, rc
pGlobal = pApi /* Bytes of space to allocate */
rc = SQLITE_OK
nName = int64(libc.Xstrlen(tls, zName) + uint64(1))
nByte = int64(uint64(56) + uint64(nName))
pNew = Xsqlite3_malloc64(tls, uint64(nByte))
if pNew != 0 {
libc.Xmemset(tls, pNew, 0, uint64(nByte))
(*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName = pNew + 1*56
libc.Xmemcpy(tls, (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FzName, zName, uint64(nName))
(*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpUserData = pUserData
(*TFts5TokenizerModule)(unsafe.Pointer(pNew)).Fx = *(*Tfts5_tokenizer)(unsafe.Pointer(pTokenizer))
(*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FxDestroy = xDestroy
(*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext = (*TFts5Global)(unsafe.Pointer(pGlobal)).FpTok
(*TFts5Global)(unsafe.Pointer(pGlobal)).FpTok = pNew
if (*TFts5TokenizerModule)(unsafe.Pointer(pNew)).FpNext == uintptr(0) {
(*TFts5Global)(unsafe.Pointer(pGlobal)).FpDfltTok = pNew
}
} else {
rc = int32(SQLITE_NOMEM)
}
return rc
} | 0.720335 | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go | Apache-2.0 | go |
Zero validates that the time pointer is pointing to a zero time value.
Usage example:
var t *time.Time
Is(v.TimeP(t).Zero()).Valid() // Will return true as t is nil and thus pointing to a zero time. | func (validator *ValidatorTimeP) Zero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyZero, template...)
return validator
} | func (validator *ValidatorTimeP) NilOrZero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) == nil || isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyNil, template...)
return validator
} | 0.879969 | cohesivestack/valgo | validator_time_p.go | cohesivestack/valgo | validator_time_p.go | MIT | go |
Zero validates that the time pointer is pointing to a zero time value.
Usage example:
var t *time.Time
Is(v.TimeP(t).Zero()).Valid() // Will return true as t is nil and thus pointing to a zero time. | func (validator *ValidatorTimeP) Zero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyZero, template...)
return validator
} | func (validator *ValidatorTime) Zero(template ...string) *ValidatorTime {
validator.context.Add(
func() bool {
return isTimeZero(validator.context.Value().(time.Time))
},
ErrorKeyZero, template...)
return validator
} | 0.800534 | cohesivestack/valgo | validator_time_p.go | cohesivestack/valgo | validator_time.go | MIT | go |
Zero validates that the time pointer is pointing to a zero time value.
Usage example:
var t *time.Time
Is(v.TimeP(t).Zero()).Valid() // Will return true as t is nil and thus pointing to a zero time. | func (validator *ValidatorTimeP) Zero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyZero, template...)
return validator
} | func (validator *ValidatorTimeP) Nil(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) == nil
},
ErrorKeyNil, template...)
return validator
} | 0.786685 | cohesivestack/valgo | validator_time_p.go | cohesivestack/valgo | validator_time_p.go | MIT | go |
Zero validates that the time pointer is pointing to a zero time value.
Usage example:
var t *time.Time
Is(v.TimeP(t).Zero()).Valid() // Will return true as t is nil and thus pointing to a zero time. | func (validator *ValidatorTimeP) Zero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyZero, template...)
return validator
} | func IsZero(v reflect.Value) bool {
kind := v.Kind()
return kind == reflect.Invalid || v.IsZero()
} | 0.700152 | cohesivestack/valgo | validator_time_p.go | cnk3x/xunlei | pkg/flags/reflect_value.go | MIT | go |
Zero validates that the time pointer is pointing to a zero time value.
Usage example:
var t *time.Time
Is(v.TimeP(t).Zero()).Valid() // Will return true as t is nil and thus pointing to a zero time. | func (validator *ValidatorTimeP) Zero(template ...string) *ValidatorTimeP {
validator.context.Add(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeZero(*(validator.context.Value().(*time.Time)))
},
ErrorKeyZero, template...)
return validator
} | func (validator *ValidatorTimeP) After(value time.Time, template ...string) *ValidatorTimeP {
validator.context.AddWithValue(
func() bool {
return validator.context.Value().(*time.Time) != nil && isTimeAfter(*(validator.context.Value().(*time.Time)), value)
},
ErrorKeyAfter, value, template...)
return validator
} | 0.682675 | cohesivestack/valgo | validator_time_p.go | cohesivestack/valgo | validator_time_p.go | MIT | go |
Read the contents of frame iRead from the wal file into buffer pOut
(which is nOut bytes in size). Return SQLITE_OK if successful, or an
error code otherwise. | func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&0xfe00 + sz&0x0001<<16
iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
return sz
}
return nOut
}(), iOffset)
} | func _sqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead Tu32, nOut int32, pOut uintptr) (r int32) {
var iOffset Ti64
var sz, v1 int32
_, _, _ = iOffset, sz, v1
sz = libc.Int32FromUint16((*TWal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&int32(0xfe00) + sz&int32(0x0001)<<int32(16)
iOffset = int64(WAL_HDRSIZE) + libc.Int64FromUint32(iRead-libc.Uint32FromInt32(1))*int64(sz+libc.Int32FromInt32(WAL_FRAME_HDRSIZE)) + int64(WAL_FRAME_HDRSIZE)
/* testcase( IS_BIG_INT(iOffset) ); // requires a 4GiB WAL */
if nOut > sz {
v1 = sz
} else {
v1 = nOut
}
return _sqlite3OsRead(tls, (*TWal)(unsafe.Pointer(pWal)).FpWalFd, pOut, v1, iOffset)
} | 0.738234 | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | umputun/spot | vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go | MIT | go |
Read the contents of frame iRead from the wal file into buffer pOut
(which is nOut bytes in size). Return SQLITE_OK if successful, or an
error code otherwise. | func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&0xfe00 + sz&0x0001<<16
iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
return sz
}
return nOut
}(), iOffset)
} | func Xsqlite3PagerReadFileheader(tls *libc.TLS, pPager uintptr, N int32, pDest uintptr) int32 {
var rc int32 = SQLITE_OK
libc.Xmemset(tls, pDest, 0, uint64(N))
if (*Sqlite3_file)(unsafe.Pointer((*Pager)(unsafe.Pointer(pPager)).Ffd)).FpMethods != uintptr(0) {
rc = Xsqlite3OsRead(tls, (*Pager)(unsafe.Pointer(pPager)).Ffd, pDest, N, int64(0))
if rc == SQLITE_IOERR|int32(2)<<8 {
rc = SQLITE_OK
}
}
return rc
} | 0.688236 | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | Apache-2.0 | go |
Read the contents of frame iRead from the wal file into buffer pOut
(which is nOut bytes in size). Return SQLITE_OK if successful, or an
error code otherwise. | func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&0xfe00 + sz&0x0001<<16
iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
return sz
}
return nOut
}(), iOffset)
} | func Xsqlite3WalFindFrame(tls *libc.TLS, pWal uintptr, pgno Pgno, piRead uintptr) int32 {
bp := tls.Alloc(24)
defer tls.Free(24)
var iRead U32 = U32(0)
var iLast U32 = (*Wal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame
var iHash int32
var iMinHash int32
if iLast == U32(0) || int32((*Wal)(unsafe.Pointer(pWal)).FreadLock) == 0 && int32((*Wal)(unsafe.Pointer(pWal)).FbShmUnreliable) == 0 {
*(*U32)(unsafe.Pointer(piRead)) = U32(0)
return SQLITE_OK
}
iMinHash = walFramePage(tls, (*Wal)(unsafe.Pointer(pWal)).FminFrame)
for iHash = walFramePage(tls, iLast); iHash >= iMinHash; iHash-- {
var iKey int32
var nCollide int32
var rc int32
var iH U32
rc = walHashGet(tls, pWal, iHash, bp)
if rc != SQLITE_OK {
return rc
}
nCollide = HASHTABLE_NPAGE * 2
iKey = walHash(tls, pgno)
for libc.AssignUint32(&iH, U32(*(*Ht_slot)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaHash + uintptr(iKey)*2)))) != U32(0) {
var iFrame U32 = iH + (*WalHashLoc)(unsafe.Pointer(bp)).FiZero
if iFrame <= iLast && iFrame >= (*Wal)(unsafe.Pointer(pWal)).FminFrame && *(*U32)(unsafe.Pointer((*WalHashLoc)(unsafe.Pointer(bp)).FaPgno + uintptr(iH-U32(1))*4)) == pgno {
iRead = iFrame
}
if libc.PostDecInt32(&nCollide, 1) == 0 {
return Xsqlite3CorruptError(tls, 66423)
}
iKey = walNextHash(tls, iKey)
}
if iRead != 0 {
break
}
}
*(*U32)(unsafe.Pointer(piRead)) = iRead
return SQLITE_OK
} | 0.688144 | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | Apache-2.0 | go |
Read the contents of frame iRead from the wal file into buffer pOut
(which is nOut bytes in size). Return SQLITE_OK if successful, or an
error code otherwise. | func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&0xfe00 + sz&0x0001<<16
iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
return sz
}
return nOut
}(), iOffset)
} | func (c *TunnelingConnection) Read(p []byte) (int, error) {
klog.V(7).Infof("%s: tunneling connection read...", c.name)
defer klog.V(7).Infof("%s: tunneling connection read...complete", c.name)
for {
if c.inProgressMessage == nil {
klog.V(8).Infof("%s: tunneling connection read before NextReader()...", c.name)
messageType, nextReader, err := c.conn.NextReader()
if err != nil {
closeError := &gwebsocket.CloseError{}
if errors.As(err, &closeError) && closeError.Code == gwebsocket.CloseNormalClosure {
return 0, io.EOF
}
klog.V(4).Infof("%s:tunneling connection NextReader() error: %v", c.name, err)
return 0, err
}
if messageType != gwebsocket.BinaryMessage {
return 0, fmt.Errorf("invalid message type received")
}
c.inProgressMessage = nextReader
}
klog.V(8).Infof("%s: tunneling connection read in progress message...", c.name)
i, err := c.inProgressMessage.Read(p)
if i == 0 && err == io.EOF {
c.inProgressMessage = nil
} else {
klog.V(8).Infof("%s: read %d bytes, error=%v, bytes=% X", c.name, i, err, p[:i])
return i, err
}
}
} | 0.619387 | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | kubernetes-sigs/cri-tools | vendor/k8s.io/client-go/tools/portforward/tunneling_connection.go | Apache-2.0 | go |
Read the contents of frame iRead from the wal file into buffer pOut
(which is nOut bytes in size). Return SQLITE_OK if successful, or an
error code otherwise. | func Xsqlite3WalReadFrame(tls *libc.TLS, pWal uintptr, iRead U32, nOut int32, pOut uintptr) int32 {
var sz int32
var iOffset I64
sz = int32((*Wal)(unsafe.Pointer(pWal)).Fhdr.FszPage)
sz = sz&0xfe00 + sz&0x0001<<16
iOffset = int64(WAL_HDRSIZE) + I64(iRead-U32(1))*I64(sz+WAL_FRAME_HDRSIZE) + int64(WAL_FRAME_HDRSIZE)
return Xsqlite3OsRead(tls, (*Wal)(unsafe.Pointer(pWal)).FpWalFd, pOut, func() int32 {
if nOut > sz {
return sz
}
return nOut
}(), iOffset)
} | func (d *Decoder) Read(p []byte) (int, error) {
var n int
for {
if len(d.current.b) > 0 {
filled := copy(p, d.current.b)
p = p[filled:]
d.current.b = d.current.b[filled:]
n += filled
}
if len(p) == 0 {
break
}
if len(d.current.b) == 0 {
// We have an error and no more data
if d.current.err != nil {
break
}
if !d.nextBlock(n == 0) {
return n, d.current.err
}
}
}
if len(d.current.b) > 0 {
if debugDecoder {
println("returning", n, "still bytes left:", len(d.current.b))
}
// Only return error at end of block
return n, nil
}
if d.current.err != nil {
d.drainOutput()
}
if debugDecoder {
println("returning", n, d.current.err, len(d.decoders))
}
return n, d.current.err
} | 0.594372 | 42wim/matterbridge | vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go | umputun/tg-spam | vendor/github.com/klauspost/compress/zstd/decoder.go | MIT | go |
RegisterIgnoreGoroutine appends s into the ignore goroutine list. The
goroutines whose stack trace contains s will not be identified as leaked
goroutines. Not thread-safe, only call this function in init(). | func RegisterIgnoreGoroutine(s string) {
goroutinesToIgnore = append(goroutinesToIgnore, s)
} | func (p *cpuProfile) addNonGo(stk []uintptr) {
// Simple cas-lock to coordinate with SetCPUProfileRate.
// (Other calls to add or addNonGo should be blocked out
// by the fact that only one SIGPROF can be handled by the
// process at a time. If not, this lock will serialize those too.)
for !atomic.Cas(&prof.signalLock, 0, 1) {
osyield()
}
if cpuprof.numExtra+1+len(stk) < len(cpuprof.extra) {
i := cpuprof.numExtra
cpuprof.extra[i] = uintptr(1 + len(stk))
copy(cpuprof.extra[i+1:], stk)
cpuprof.numExtra += 1 + len(stk)
} else {
cpuprof.lostExtra++
}
atomic.Store(&prof.signalLock, 0)
} | 0.504943 | genuinetools/binctr | vendor/google.golang.org/grpc/internal/leakcheck/leakcheck.go | mit-pdos/biscuit | src/runtime/cpuprof.go | BSD-3-Clause | go |
RegisterIgnoreGoroutine appends s into the ignore goroutine list. The
goroutines whose stack trace contains s will not be identified as leaked
goroutines. Not thread-safe, only call this function in init(). | func RegisterIgnoreGoroutine(s string) {
goroutinesToIgnore = append(goroutinesToIgnore, s)
} | func (opt Options) WithNumGoroutines(val int) Options {
opt.NumGoroutines = val
return opt
} | 0.503288 | genuinetools/binctr | vendor/google.golang.org/grpc/internal/leakcheck/leakcheck.go | loggie-io/loggie | vendor/github.com/dgraph-io/badger/v3/options.go | Apache-2.0 | go |
RegisterIgnoreGoroutine appends s into the ignore goroutine list. The
goroutines whose stack trace contains s will not be identified as leaked
goroutines. Not thread-safe, only call this function in init(). | func RegisterIgnoreGoroutine(s string) {
goroutinesToIgnore = append(goroutinesToIgnore, s)
} | func reentersyscall(pc, sp uintptr) {
_g_ := getg()
// Disable preemption because during this function g is in Gsyscall status,
// but can have inconsistent g->sched, do not let GC observe it.
_g_.m.locks++
// Entersyscall must not call any function that might split/grow the stack.
// (See details in comment above.)
// Catch calls that might, by replacing the stack guard with something that
// will trip any stack check and leaving a flag to tell newstack to die.
_g_.stackguard0 = stackPreempt
_g_.throwsplit = true
// Leave SP around for GC and traceback.
save(pc, sp)
_g_.syscallsp = sp
_g_.syscallpc = pc
casgstatus(_g_, _Grunning, _Gsyscall)
if _g_.syscallsp < _g_.stack.lo || _g_.stack.hi < _g_.syscallsp {
systemstack(func() {
print("entersyscall inconsistent ", hex(_g_.syscallsp), " [", hex(_g_.stack.lo), ",", hex(_g_.stack.hi), "]\n")
throw("entersyscall")
})
}
if trace.enabled {
systemstack(traceGoSysCall)
// systemstack itself clobbers g.sched.{pc,sp} and we might
// need them later when the G is genuinely blocked in a
// syscall
save(pc, sp)
}
if atomic.Load(&sched.sysmonwait) != 0 {
systemstack(entersyscall_sysmon)
save(pc, sp)
}
if _g_.m.p.ptr().runSafePointFn != 0 {
// runSafePointFn may stack split if run on this stack
systemstack(runSafePointFn)
save(pc, sp)
}
_g_.m.syscalltick = _g_.m.p.ptr().syscalltick
_g_.sysblocktraced = true
_g_.m.mcache = nil
_g_.m.p.ptr().m = 0
atomic.Store(&_g_.m.p.ptr().status, _Psyscall)
if sched.gcwaiting != 0 {
systemstack(entersyscall_gcwait)
save(pc, sp)
}
_g_.m.locks--
} | 0.491242 | genuinetools/binctr | vendor/google.golang.org/grpc/internal/leakcheck/leakcheck.go | mit-pdos/biscuit | src/runtime/proc.go | BSD-3-Clause | go |
RegisterIgnoreGoroutine appends s into the ignore goroutine list. The
goroutines whose stack trace contains s will not be identified as leaked
goroutines. Not thread-safe, only call this function in init(). | func RegisterIgnoreGoroutine(s string) {
goroutinesToIgnore = append(goroutinesToIgnore, s)
} | func IgnoreTopFunction(f string) Option {
return addFilter(func(s stack.Stack) bool {
return s.FirstFunction() == f
})
} | 0.48485 | genuinetools/binctr | vendor/google.golang.org/grpc/internal/leakcheck/leakcheck.go | ReactiveX/RxGo | vendor/go.uber.org/goleak/options.go | MIT | go |
RegisterIgnoreGoroutine appends s into the ignore goroutine list. The
goroutines whose stack trace contains s will not be identified as leaked
goroutines. Not thread-safe, only call this function in init(). | func RegisterIgnoreGoroutine(s string) {
goroutinesToIgnore = append(goroutinesToIgnore, s)
} | func pprofMatchingGoroutines(id string, events []*trace.Event) (map[uint64]bool, error) {
if id == "" {
return nil, nil
}
pc, err := strconv.ParseUint(id, 10, 64) // id is string
if err != nil {
return nil, fmt.Errorf("invalid goroutine type: %v", id)
}
analyzeGoroutines(events)
var res map[uint64]bool
for _, g := range gs {
if g.PC != pc {
continue
}
if res == nil {
res = make(map[uint64]bool)
}
res[g.ID] = true
}
if len(res) == 0 && id != "" {
return nil, fmt.Errorf("failed to find matching goroutines for id: %s", id)
}
return res, nil
} | 0.479829 | genuinetools/binctr | vendor/google.golang.org/grpc/internal/leakcheck/leakcheck.go | mit-pdos/biscuit | src/cmd/trace/pprof.go | BSD-3-Clause | go |
GetUpgradeStatusRequest generates a "aws/request.Request" representing the
client's request for the GetUpgradeStatus 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 GetUpgradeStatus for more information on using the GetUpgradeStatus
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 GetUpgradeStatusRequest method.
req, resp := client.GetUpgradeStatusRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
} | func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2015-01-01/es/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *OpenSearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2021-01-01/opensearch/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | 0.975311 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/opensearchservice/api.go | Apache-2.0 | go |
GetUpgradeStatusRequest generates a "aws/request.Request" representing the
client's request for the GetUpgradeStatus 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 GetUpgradeStatus for more information on using the GetUpgradeStatus
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 GetUpgradeStatusRequest method.
req, resp := client.GetUpgradeStatusRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
} | func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2015-01-01/es/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *ElasticsearchService) GetUpgradeStatusWithContext(ctx aws.Context, input *GetUpgradeStatusInput, opts ...request.Option) (*GetUpgradeStatusOutput, error) {
req, out := c.GetUpgradeStatusRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.747705 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
GetUpgradeStatusRequest generates a "aws/request.Request" representing the
client's request for the GetUpgradeStatus 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 GetUpgradeStatus for more information on using the GetUpgradeStatus
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 GetUpgradeStatusRequest method.
req, resp := client.GetUpgradeStatusRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
} | func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2015-01-01/es/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *OpenSearchService) GetUpgradeHistoryRequest(input *GetUpgradeHistoryInput) (req *request.Request, output *GetUpgradeHistoryOutput) {
op := &request.Operation{
Name: opGetUpgradeHistory,
HTTPMethod: "GET",
HTTPPath: "/2021-01-01/opensearch/upgradeDomain/{DomainName}/history",
Paginator: &request.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &GetUpgradeHistoryInput{}
}
output = &GetUpgradeHistoryOutput{}
req = c.newRequest(op, input, output)
return
} | 0.719024 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/opensearchservice/api.go | Apache-2.0 | go |
GetUpgradeStatusRequest generates a "aws/request.Request" representing the
client's request for the GetUpgradeStatus 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 GetUpgradeStatus for more information on using the GetUpgradeStatus
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 GetUpgradeStatusRequest method.
req, resp := client.GetUpgradeStatusRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
} | func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2015-01-01/es/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *ElasticsearchService) GetUpgradeStatus(input *GetUpgradeStatusInput) (*GetUpgradeStatusOutput, error) {
req, out := c.GetUpgradeStatusRequest(input)
return out, req.Send()
} | 0.70134 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
GetUpgradeStatusRequest generates a "aws/request.Request" representing the
client's request for the GetUpgradeStatus 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 GetUpgradeStatus for more information on using the GetUpgradeStatus
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 GetUpgradeStatusRequest method.
req, resp := client.GetUpgradeStatusRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
} | func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusInput) (req *request.Request, output *GetUpgradeStatusOutput) {
op := &request.Operation{
Name: opGetUpgradeStatus,
HTTPMethod: "GET",
HTTPPath: "/2015-01-01/es/upgradeDomain/{DomainName}/status",
}
if input == nil {
input = &GetUpgradeStatusInput{}
}
output = &GetUpgradeStatusOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *OpenSearchService) GetUpgradeStatus(input *GetUpgradeStatusInput) (*GetUpgradeStatusOutput, error) {
req, out := c.GetUpgradeStatusRequest(input)
return out, req.Send()
} | 0.681034 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/opensearchservice/api.go | Apache-2.0 | go |
SearchProfiles API operation for Amazon Connect Customer Profiles.
Searches for profiles within a specific domain using one or more predefined
search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined
search keys. A search key is a data type pair that consists of a KeyName
and Values list.
This operation supports searching for profiles with a minimum of 1 key-value(s)
pair and up to 5 key-value(s) pairs using either AND or OR logic.
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 Connect Customer Profiles's
API operation SearchProfiles for usage and error information.
Returned Error Types:
- BadRequestException
The input you provided is invalid.
- AccessDeniedException
You do not have sufficient access to perform this action.
- ResourceNotFoundException
The requested resource does not exist, or access was denied.
- ThrottlingException
You exceeded the maximum number of requests.
- InternalServerException
An internal service error occurred.
See also, https://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/SearchProfiles | func (c *CustomerProfiles) SearchProfiles(input *SearchProfilesInput) (*SearchProfilesOutput, error) {
req, out := c.SearchProfilesRequest(input)
return out, req.Send()
} | func (c *DataZone) SearchUserProfiles(input *SearchUserProfilesInput) (*SearchUserProfilesOutput, error) {
req, out := c.SearchUserProfilesRequest(input)
return out, req.Send()
} | 0.854095 | aws/aws-sdk-go | service/customerprofiles/api.go | aws/aws-sdk-go | service/datazone/api.go | Apache-2.0 | go |
SearchProfiles API operation for Amazon Connect Customer Profiles.
Searches for profiles within a specific domain using one or more predefined
search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined
search keys. A search key is a data type pair that consists of a KeyName
and Values list.
This operation supports searching for profiles with a minimum of 1 key-value(s)
pair and up to 5 key-value(s) pairs using either AND or OR logic.
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 Connect Customer Profiles's
API operation SearchProfiles for usage and error information.
Returned Error Types:
- BadRequestException
The input you provided is invalid.
- AccessDeniedException
You do not have sufficient access to perform this action.
- ResourceNotFoundException
The requested resource does not exist, or access was denied.
- ThrottlingException
You exceeded the maximum number of requests.
- InternalServerException
An internal service error occurred.
See also, https://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/SearchProfiles | func (c *CustomerProfiles) SearchProfiles(input *SearchProfilesInput) (*SearchProfilesOutput, error) {
req, out := c.SearchProfilesRequest(input)
return out, req.Send()
} | func (c *Connect) SearchSecurityProfiles(input *SearchSecurityProfilesInput) (*SearchSecurityProfilesOutput, error) {
req, out := c.SearchSecurityProfilesRequest(input)
return out, req.Send()
} | 0.813504 | aws/aws-sdk-go | service/customerprofiles/api.go | aws/aws-sdk-go | service/connect/api.go | Apache-2.0 | go |
SearchProfiles API operation for Amazon Connect Customer Profiles.
Searches for profiles within a specific domain using one or more predefined
search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined
search keys. A search key is a data type pair that consists of a KeyName
and Values list.
This operation supports searching for profiles with a minimum of 1 key-value(s)
pair and up to 5 key-value(s) pairs using either AND or OR logic.
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 Connect Customer Profiles's
API operation SearchProfiles for usage and error information.
Returned Error Types:
- BadRequestException
The input you provided is invalid.
- AccessDeniedException
You do not have sufficient access to perform this action.
- ResourceNotFoundException
The requested resource does not exist, or access was denied.
- ThrottlingException
You exceeded the maximum number of requests.
- InternalServerException
An internal service error occurred.
See also, https://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/SearchProfiles | func (c *CustomerProfiles) SearchProfiles(input *SearchProfilesInput) (*SearchProfilesOutput, error) {
req, out := c.SearchProfilesRequest(input)
return out, req.Send()
} | func (c *Connect) SearchRoutingProfiles(input *SearchRoutingProfilesInput) (*SearchRoutingProfilesOutput, error) {
req, out := c.SearchRoutingProfilesRequest(input)
return out, req.Send()
} | 0.805313 | aws/aws-sdk-go | service/customerprofiles/api.go | aws/aws-sdk-go | service/connect/api.go | Apache-2.0 | go |
SearchProfiles API operation for Amazon Connect Customer Profiles.
Searches for profiles within a specific domain using one or more predefined
search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined
search keys. A search key is a data type pair that consists of a KeyName
and Values list.
This operation supports searching for profiles with a minimum of 1 key-value(s)
pair and up to 5 key-value(s) pairs using either AND or OR logic.
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 Connect Customer Profiles's
API operation SearchProfiles for usage and error information.
Returned Error Types:
- BadRequestException
The input you provided is invalid.
- AccessDeniedException
You do not have sufficient access to perform this action.
- ResourceNotFoundException
The requested resource does not exist, or access was denied.
- ThrottlingException
You exceeded the maximum number of requests.
- InternalServerException
An internal service error occurred.
See also, https://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/SearchProfiles | func (c *CustomerProfiles) SearchProfiles(input *SearchProfilesInput) (*SearchProfilesOutput, error) {
req, out := c.SearchProfilesRequest(input)
return out, req.Send()
} | func (c *CustomerProfiles) SearchProfilesRequest(input *SearchProfilesInput) (req *request.Request, output *SearchProfilesOutput) {
op := &request.Operation{
Name: opSearchProfiles,
HTTPMethod: "POST",
HTTPPath: "/domains/{DomainName}/profiles/search",
}
if input == nil {
input = &SearchProfilesInput{}
}
output = &SearchProfilesOutput{}
req = c.newRequest(op, input, output)
return
} | 0.803577 | aws/aws-sdk-go | service/customerprofiles/api.go | aws/aws-sdk-go | service/customerprofiles/api.go | Apache-2.0 | go |
SearchProfiles API operation for Amazon Connect Customer Profiles.
Searches for profiles within a specific domain using one or more predefined
search keys (e.g., _fullName, _phone, _email, _account, etc.) and/or custom-defined
search keys. A search key is a data type pair that consists of a KeyName
and Values list.
This operation supports searching for profiles with a minimum of 1 key-value(s)
pair and up to 5 key-value(s) pairs using either AND or OR logic.
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 Connect Customer Profiles's
API operation SearchProfiles for usage and error information.
Returned Error Types:
- BadRequestException
The input you provided is invalid.
- AccessDeniedException
You do not have sufficient access to perform this action.
- ResourceNotFoundException
The requested resource does not exist, or access was denied.
- ThrottlingException
You exceeded the maximum number of requests.
- InternalServerException
An internal service error occurred.
See also, https://docs.aws.amazon.com/goto/WebAPI/customer-profiles-2020-08-15/SearchProfiles | func (c *CustomerProfiles) SearchProfiles(input *SearchProfilesInput) (*SearchProfilesOutput, error) {
req, out := c.SearchProfilesRequest(input)
return out, req.Send()
} | func (c *DataZone) SearchGroupProfiles(input *SearchGroupProfilesInput) (*SearchGroupProfilesOutput, error) {
req, out := c.SearchGroupProfilesRequest(input)
return out, req.Send()
} | 0.782519 | aws/aws-sdk-go | service/customerprofiles/api.go | aws/aws-sdk-go | service/datazone/api.go | Apache-2.0 | go |
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService. | func (a *Account) AddServiceImport(destination *Account, from, to string) error {
return a.AddServiceImportWithClaim(destination, from, to, nil)
} | func (a *Account) addServiceImport(dest *Account, from, to string, claim *jwt.Import) (*serviceImport, error) {
rt := Singleton
var lat *serviceLatency
if dest == nil {
return nil, ErrMissingAccount
}
var atrc bool
dest.mu.RLock()
se := dest.getServiceExport(to)
if se != nil {
rt = se.respType
lat = se.latency
atrc = se.atrc
}
destAccName := dest.Name
dest.mu.RUnlock()
a.mu.Lock()
if a.imports.services == nil {
a.imports.services = make(map[string][]*serviceImport)
} else if dup := a.getServiceImportForAccountLocked(destAccName, from); dup != nil {
a.mu.Unlock()
return nil, fmt.Errorf("duplicate service import subject %q, previously used in import for account %q, subject %q",
from, dup.acc.Name, dup.to)
}
if to == _EMPTY_ {
to = from
}
// Check to see if we have a wildcard
var (
usePub bool
tr *subjectTransform
err error
)
if subjectHasWildcard(to) {
// If to and from match, then we use the published subject.
if to == from {
usePub = true
} else {
to, _ = transformUntokenize(to)
// Create a transform. Do so in reverse such that $ symbols only exist in to
if tr, err = NewSubjectTransformStrict(to, transformTokenize(from)); err != nil {
a.mu.Unlock()
return nil, fmt.Errorf("failed to create mapping transform for service import subject from %q to %q: %v",
from, to, err)
} else {
// un-tokenize and reverse transform so we get the transform needed
from, _ = transformUntokenize(from)
tr = tr.reverse()
}
}
}
var share bool
if claim != nil {
share = claim.Share
}
si := &serviceImport{dest, claim, se, nil, from, to, tr, 0, rt, lat, nil, nil, usePub, false, false, share, false, false, atrc, nil}
sis := a.imports.services[from]
sis = append(sis, si)
a.imports.services[from] = sis
a.mu.Unlock()
if err := a.addServiceImportSub(si); err != nil {
a.removeServiceImport(destAccName, si.from)
return nil, err
}
return si, nil
} | 0.723814 | nats-io/nats-server | server/accounts.go | nats-io/nats-server | server/accounts.go | Apache-2.0 | go |
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService. | func (a *Account) AddServiceImport(destination *Account, from, to string) error {
return a.AddServiceImportWithClaim(destination, from, to, nil)
} | func (a *Account) addStreamExportWithAccountPos(subject string, accounts []*Account, accountPos uint) error {
if a == nil {
return ErrMissingAccount
}
a.mu.Lock()
defer a.mu.Unlock()
if a.exports.streams == nil {
a.exports.streams = make(map[string]*streamExport)
}
ea := a.exports.streams[subject]
if accounts != nil || accountPos > 0 {
if ea == nil {
ea = &streamExport{}
}
if err := setExportAuth(&ea.exportAuth, subject, accounts, accountPos); err != nil {
return err
}
}
a.exports.streams[subject] = ea
return nil
} | 0.508507 | nats-io/nats-server | server/accounts.go | nats-io/nats-server | server/accounts.go | Apache-2.0 | go |
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService. | func (a *Account) AddServiceImport(destination *Account, from, to string) error {
return a.AddServiceImportWithClaim(destination, from, to, nil)
} | func (r *gatewayAPIReconciler) validateServiceImportForReconcile(obj client.Object) bool {
svcImport, ok := obj.(*mcsapiv1a1.ServiceImport)
if !ok {
r.log.Info("unexpected object type, bypassing reconciliation", "object", obj)
return false
}
nsName := utils.NamespacedName(svcImport)
return r.isRouteReferencingBackend(&nsName)
} | 0.5081 | nats-io/nats-server | server/accounts.go | envoyproxy/gateway | internal/provider/kubernetes/predicates.go | Apache-2.0 | go |
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService. | func (a *Account) AddServiceImport(destination *Account, from, to string) error {
return a.AddServiceImportWithClaim(destination, from, to, nil)
} | func ServiceToServiceEntry(svc *model.Service, proxy *model.Proxy) *config.Config {
gvk := gvk.ServiceEntry
getSvcAddresses := func(s *model.Service, node *model.Proxy) []string {
if node.Metadata != nil && node.Metadata.ClusterID == "" {
var addresses []string
addressMap := s.ClusterVIPs.GetAddresses()
for _, clusterAddresses := range addressMap {
addresses = append(addresses, clusterAddresses...)
}
return addresses
}
return s.GetAllAddressesForProxy(proxy)
}
se := &networking.ServiceEntry{
// Host is fully qualified: name, namespace, domainSuffix
Hosts: []string{string(svc.Hostname)},
// Internal Service and K8S Service have a single Address.
// ServiceEntry can represent multiple - but we are not using that. SE may be merged.
// Will be 0.0.0.0 if not specified as ClusterIP or ClusterIP==None. In such case resolution is Passthrough.
Addresses: getSvcAddresses(svc, proxy),
// This is based on alpha.istio.io/canonical-serviceaccounts and
// alpha.istio.io/kubernetes-serviceaccounts.
SubjectAltNames: svc.ServiceAccounts,
}
if len(svc.Attributes.LabelSelectors) > 0 {
se.WorkloadSelector = &networking.WorkloadSelector{Labels: svc.Attributes.LabelSelectors}
}
// Based on networking.istio.io/exportTo annotation
for k := range svc.Attributes.ExportTo {
// k is Private or Public
se.ExportTo = append(se.ExportTo, string(k))
}
if svc.MeshExternal {
se.Location = networking.ServiceEntry_MESH_EXTERNAL // 0 - default
} else {
se.Location = networking.ServiceEntry_MESH_INTERNAL
}
// Reverse in convertServices. Note that enum values are different
var resolution networking.ServiceEntry_Resolution
switch svc.Resolution {
case model.Passthrough: // 2
resolution = networking.ServiceEntry_NONE // 0
case model.DNSLB: // 1
resolution = networking.ServiceEntry_DNS // 2
case model.DNSRoundRobinLB: // 3
resolution = networking.ServiceEntry_DNS_ROUND_ROBIN // 3
case model.ClientSideLB: // 0
resolution = networking.ServiceEntry_STATIC // 1
}
se.Resolution = resolution
// Port is mapped from ServicePort
for _, p := range svc.Ports {
se.Ports = append(se.Ports, &networking.ServicePort{
Number: uint32(p.Port),
Name: p.Name,
// Protocol is converted to protocol.Instance - reverse conversion will use the name.
Protocol: string(p.Protocol),
// TODO: target port
})
}
cfg := &config.Config{
Meta: config.Meta{
GroupVersionKind: gvk,
Name: "synthetic-" + svc.Attributes.Name,
Namespace: svc.Attributes.Namespace,
CreationTimestamp: svc.CreationTime,
ResourceVersion: svc.ResourceVersion,
},
Spec: se,
}
// TODO: WorkloadSelector
// TODO: preserve ServiceRegistry. The reverse conversion sets it to 'external'
// TODO: preserve UID ? It seems MCP didn't preserve it - but that code path was not used much.
// TODO: ClusterExternalPorts map - for NodePort services, with "traffic.istio.io/nodeSelector" ann
// It's a per-cluster map
// TODO: ClusterExternalAddresses - for LB types, per cluster. Populated from K8S, missing
// in SE. Used for multi-network support.
return cfg
} | 0.487887 | nats-io/nats-server | server/accounts.go | istio/istio | pilot/pkg/serviceregistry/serviceentry/conversion.go | Apache-2.0 | go |
AddServiceImport will add a route to an account to send published messages / requests
to the destination account. From is the local subject to map, To is the
subject that will appear on the destination account. Destination will need
to have an import rule to allow access via addService. | func (a *Account) AddServiceImport(destination *Account, from, to string) error {
return a.AddServiceImportWithClaim(destination, from, to, nil)
} | func (c *SESV2) CreateImportJob(input *CreateImportJobInput) (*CreateImportJobOutput, error) {
req, out := c.CreateImportJobRequest(input)
return out, req.Send()
} | 0.486754 | nats-io/nats-server | server/accounts.go | aws/aws-sdk-go | service/sesv2/api.go | Apache-2.0 | go |
Snapshot A comma-separated list of snapshots to retrieve status for.
The default is currently running snapshots.
Wildcards (`*`) are not supported.
API Name: snapshot | func (r *Status) Snapshot(snapshot string) *Status {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | func (r *Delete) _snapshot(snapshot string) *Delete {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | 0.877254 | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | elastic/go-elasticsearch | typedapi/snapshot/delete/delete.go | Apache-2.0 | go |
Snapshot A comma-separated list of snapshots to retrieve status for.
The default is currently running snapshots.
Wildcards (`*`) are not supported.
API Name: snapshot | func (r *Status) Snapshot(snapshot string) *Status {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | func (r *Create) _snapshot(snapshot string) *Create {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | 0.828615 | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | elastic/go-elasticsearch | typedapi/snapshot/create/create.go | Apache-2.0 | go |
Snapshot A comma-separated list of snapshots to retrieve status for.
The default is currently running snapshots.
Wildcards (`*`) are not supported.
API Name: snapshot | func (r *Status) Snapshot(snapshot string) *Status {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | func (r *GetModelSnapshots) SnapshotId(snapshotid string) *GetModelSnapshots {
r.paramSet |= snapshotidMask
r.snapshotid = snapshotid
return r
} | 0.748509 | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | elastic/go-elasticsearch | typedapi/ml/getmodelsnapshots/get_model_snapshots.go | Apache-2.0 | go |
Snapshot A comma-separated list of snapshots to retrieve status for.
The default is currently running snapshots.
Wildcards (`*`) are not supported.
API Name: snapshot | func (r *Status) Snapshot(snapshot string) *Status {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | func New(tp elastictransport.Interface) *Snapshots {
r := &Snapshots{
transport: tp,
values: make(url.Values),
headers: make(http.Header),
}
if instrumented, ok := r.transport.(elastictransport.Instrumented); ok {
if instrument := instrumented.InstrumentationEnabled(); instrument != nil {
r.instrument = instrument
}
}
return r
} | 0.665225 | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | elastic/go-elasticsearch | typedapi/cat/snapshots/snapshots.go | Apache-2.0 | go |
Snapshot A comma-separated list of snapshots to retrieve status for.
The default is currently running snapshots.
Wildcards (`*`) are not supported.
API Name: snapshot | func (r *Status) Snapshot(snapshot string) *Status {
r.paramSet |= snapshotMask
r.snapshot = snapshot
return r
} | func (r *Status) Repository(repository string) *Status {
r.paramSet |= repositoryMask
r.repository = repository
return r
} | 0.656682 | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | elastic/go-elasticsearch | typedapi/snapshot/status/status.go | Apache-2.0 | go |
StopFailbackWithContext is the same as StopFailback with the addition of
the ability to pass a context and additional request options.
See StopFailback 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 *Drs) StopFailbackWithContext(ctx aws.Context, input *StopFailbackInput, opts ...request.Option) (*StopFailbackOutput, error) {
req, out := c.StopFailbackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *Drs) StartFailbackLaunchWithContext(ctx aws.Context, input *StartFailbackLaunchInput, opts ...request.Option) (*StartFailbackLaunchOutput, error) {
req, out := c.StartFailbackLaunchRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.827067 | aws/aws-sdk-go | service/drs/api.go | aws/aws-sdk-go | service/drs/api.go | Apache-2.0 | go |
StopFailbackWithContext is the same as StopFailback with the addition of
the ability to pass a context and additional request options.
See StopFailback 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 *Drs) StopFailbackWithContext(ctx aws.Context, input *StopFailbackInput, opts ...request.Option) (*StopFailbackOutput, error) {
req, out := c.StopFailbackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *OpsWorks) StopStackWithContext(ctx aws.Context, input *StopStackInput, opts ...request.Option) (*StopStackOutput, error) {
req, out := c.StopStackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.756028 | aws/aws-sdk-go | service/drs/api.go | aws/aws-sdk-go | service/opsworks/api.go | Apache-2.0 | go |
StopFailbackWithContext is the same as StopFailback with the addition of
the ability to pass a context and additional request options.
See StopFailback 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 *Drs) StopFailbackWithContext(ctx aws.Context, input *StopFailbackInput, opts ...request.Option) (*StopFailbackOutput, error) {
req, out := c.StopFailbackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *Drs) StopFailbackRequest(input *StopFailbackInput) (req *request.Request, output *StopFailbackOutput) {
op := &request.Operation{
Name: opStopFailback,
HTTPMethod: "POST",
HTTPPath: "/StopFailback",
}
if input == nil {
input = &StopFailbackInput{}
}
output = &StopFailbackOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
} | 0.74443 | aws/aws-sdk-go | service/drs/api.go | aws/aws-sdk-go | service/drs/api.go | Apache-2.0 | go |
StopFailbackWithContext is the same as StopFailback with the addition of
the ability to pass a context and additional request options.
See StopFailback 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 *Drs) StopFailbackWithContext(ctx aws.Context, input *StopFailbackInput, opts ...request.Option) (*StopFailbackOutput, error) {
req, out := c.StopFailbackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *DeviceFarm) StopRunWithContext(ctx aws.Context, input *StopRunInput, opts ...request.Option) (*StopRunOutput, error) {
req, out := c.StopRunRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.734972 | aws/aws-sdk-go | service/drs/api.go | aws/aws-sdk-go | service/devicefarm/api.go | Apache-2.0 | go |
StopFailbackWithContext is the same as StopFailback with the addition of
the ability to pass a context and additional request options.
See StopFailback 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 *Drs) StopFailbackWithContext(ctx aws.Context, input *StopFailbackInput, opts ...request.Option) (*StopFailbackOutput, error) {
req, out := c.StopFailbackRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *SFN) StopExecutionWithContext(ctx aws.Context, input *StopExecutionInput, opts ...request.Option) (*StopExecutionOutput, error) {
req, out := c.StopExecutionRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.72534 | aws/aws-sdk-go | service/drs/api.go | aws/aws-sdk-go | service/sfn/api.go | Apache-2.0 | go |
DescribeDirectoriesPagesWithContext same as DescribeDirectoriesPages 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 *DirectoryService) DescribeDirectoriesPagesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, fn func(*DescribeDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *DirectoryService) DescribeDirectoriesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, opts ...request.Option) (*DescribeDirectoriesOutput, error) {
req, out := c.DescribeDirectoriesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.902716 | aws/aws-sdk-go | service/directoryservice/api.go | aws/aws-sdk-go | service/directoryservice/api.go | Apache-2.0 | go |
DescribeDirectoriesPagesWithContext same as DescribeDirectoriesPages 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 *DirectoryService) DescribeDirectoriesPagesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, fn func(*DescribeDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *CloudDirectory) ListDirectoriesPagesWithContext(ctx aws.Context, input *ListDirectoriesInput, fn func(*ListDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *ListDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.ListDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*ListDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.877627 | aws/aws-sdk-go | service/directoryservice/api.go | aws/aws-sdk-go | service/clouddirectory/api.go | Apache-2.0 | go |
DescribeDirectoriesPagesWithContext same as DescribeDirectoriesPages 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 *DirectoryService) DescribeDirectoriesPagesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, fn func(*DescribeDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *DirectoryService) DescribeSharedDirectoriesPagesWithContext(ctx aws.Context, input *DescribeSharedDirectoriesInput, fn func(*DescribeSharedDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeSharedDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeSharedDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeSharedDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.838605 | aws/aws-sdk-go | service/directoryservice/api.go | aws/aws-sdk-go | service/directoryservice/api.go | Apache-2.0 | go |
DescribeDirectoriesPagesWithContext same as DescribeDirectoriesPages 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 *DirectoryService) DescribeDirectoriesPagesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, fn func(*DescribeDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *WorkSpaces) DescribeWorkspaceDirectoriesPagesWithContext(ctx aws.Context, input *DescribeWorkspaceDirectoriesInput, fn func(*DescribeWorkspaceDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeWorkspaceDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeWorkspaceDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeWorkspaceDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | 0.835586 | aws/aws-sdk-go | service/directoryservice/api.go | aws/aws-sdk-go | service/workspaces/api.go | Apache-2.0 | go |
DescribeDirectoriesPagesWithContext same as DescribeDirectoriesPages 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 *DirectoryService) DescribeDirectoriesPagesWithContext(ctx aws.Context, input *DescribeDirectoriesInput, fn func(*DescribeDirectoriesOutput, bool) bool, opts ...request.Option) error {
p := request.Pagination{
NewRequest: func() (*request.Request, error) {
var inCpy *DescribeDirectoriesInput
if input != nil {
tmp := *input
inCpy = &tmp
}
req, _ := c.DescribeDirectoriesRequest(inCpy)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return req, nil
},
}
for p.Next() {
if !fn(p.Page().(*DescribeDirectoriesOutput), !p.HasNextPage()) {
break
}
}
return p.Err()
} | func (c *CloudDirectory) ListDirectoriesWithContext(ctx aws.Context, input *ListDirectoriesInput, opts ...request.Option) (*ListDirectoriesOutput, error) {
req, out := c.ListDirectoriesRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.789463 | aws/aws-sdk-go | service/directoryservice/api.go | aws/aws-sdk-go | service/clouddirectory/api.go | Apache-2.0 | go |
upgradeManifest updates the in-memory manifest from various versions to the latest version.
If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and
the drop data/attr operation.
If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to
<ns string>-<attr>. This is because of a bug for namespace greater than 127.
See https://github.com/hypermodeinc/dgraph/pull/7810
NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest. | func upgradeManifest(m *Manifest) error {
switch m.Version {
case 0:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
parsedPreds = append(parsedPreds, x.GalaxyAttr(pred))
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
switch op.DropOp {
case pb.DropOperation_DATA:
op.DropValue = fmt.Sprintf("%#x", x.GalaxyNamespace)
case pb.DropOperation_ATTR:
op.DropValue = x.GalaxyAttr(op.DropValue)
default:
// do nothing for drop all and drop namespace.
}
}
case 2103:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
ns_attr, err := x.AttrFrom2103(pred)
if err != nil {
return errors.Errorf("while parsing predicate got: %q", err)
}
parsedPreds = append(parsedPreds, ns_attr)
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
// We have a cluster wide drop data in v21.03.
if op.DropOp == pb.DropOperation_ATTR {
ns_attr, err := x.AttrFrom2103(op.DropValue)
if err != nil {
return errors.Errorf("while parsing the drop operation %+v got: %q",
op, err)
}
op.DropValue = ns_attr
}
}
case 2105:
// pass
}
return nil
} | func ReplaceManifestData(mapMetadata *mapping.Metadata, modifiedManifest string, kubeVersionStr string) (string, error) {
for _, mapping := range mapMetadata.Mappings {
deprecatedAPI := mapping.DeprecatedAPI
supportedAPI := mapping.NewAPI
var apiVersionStr string
if mapping.DeprecatedInVersion != "" {
apiVersionStr = mapping.DeprecatedInVersion
} else {
apiVersionStr = mapping.RemovedInVersion
}
if !semver.IsValid(apiVersionStr) {
return "", errors.Errorf("Failed to get the deprecated or removed Kubernetes version for API: %s", strings.ReplaceAll(deprecatedAPI, "\n", " "))
}
if count := strings.Count(modifiedManifest, deprecatedAPI); count > 0 {
if semver.Compare(apiVersionStr, kubeVersionStr) > 0 {
log.Printf("The following API:\n\"%s\" does not require mapping as the "+
"API is not deprecated or removed in Kubernetes \"%s\"\n", deprecatedAPI, kubeVersionStr)
// skip to next mapping
continue
}
if supportedAPI == "" {
log.Printf("Found %d instances of deprecated or removed Kubernetes API:\n\"%s\"\nNo supported API equivalent\n", count, deprecatedAPI)
modifiedManifest = removeDeprecatedAPIWithoutSuccessor(count, deprecatedAPI, modifiedManifest)
} else {
log.Printf("Found %d instances of deprecated or removed Kubernetes API:\n\"%s\"\nSupported API equivalent:\n\"%s\"\n", count, deprecatedAPI, supportedAPI)
modifiedManifest = strings.ReplaceAll(modifiedManifest, deprecatedAPI, supportedAPI)
}
}
}
return modifiedManifest, nil
} | 0.613292 | hypermodeinc/dgraph | worker/backup_manifest.go | helm/helm-mapkubeapis | pkg/common/common.go | Apache-2.0 | go |
upgradeManifest updates the in-memory manifest from various versions to the latest version.
If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and
the drop data/attr operation.
If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to
<ns string>-<attr>. This is because of a bug for namespace greater than 127.
See https://github.com/hypermodeinc/dgraph/pull/7810
NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest. | func upgradeManifest(m *Manifest) error {
switch m.Version {
case 0:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
parsedPreds = append(parsedPreds, x.GalaxyAttr(pred))
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
switch op.DropOp {
case pb.DropOperation_DATA:
op.DropValue = fmt.Sprintf("%#x", x.GalaxyNamespace)
case pb.DropOperation_ATTR:
op.DropValue = x.GalaxyAttr(op.DropValue)
default:
// do nothing for drop all and drop namespace.
}
}
case 2103:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
ns_attr, err := x.AttrFrom2103(pred)
if err != nil {
return errors.Errorf("while parsing predicate got: %q", err)
}
parsedPreds = append(parsedPreds, ns_attr)
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
// We have a cluster wide drop data in v21.03.
if op.DropOp == pb.DropOperation_ATTR {
ns_attr, err := x.AttrFrom2103(op.DropValue)
if err != nil {
return errors.Errorf("while parsing the drop operation %+v got: %q",
op, err)
}
op.DropValue = ns_attr
}
}
case 2105:
// pass
}
return nil
} | func (m *manifestOCI1) convertToManifestSchema2(_ context.Context, options *types.ManifestUpdateOptions) (*manifestSchema2, error) {
if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig {
return nil, internalManifest.NewNonImageArtifactError(&m.m.Manifest)
}
// Mostly we first make a format conversion, and _afterwards_ do layer edits. But first we need to do the layer edits
// which remove OCI-specific features, because trying to convert those layers would fail.
// So, do the layer updates for decryption, and for conversions from Zstd.
ociManifest := m.m
ociOnlyEdits, err := m.layerEditsOfOCIOnlyFeatures(options)
if err != nil {
return nil, err
}
if ociOnlyEdits != nil {
ociManifest = manifest.OCI1Clone(ociManifest)
if err := ociManifest.UpdateLayerInfos(ociOnlyEdits); err != nil {
return nil, err
}
}
// Create a copy of the descriptor.
config := schema2DescriptorFromOCI1Descriptor(ociManifest.Config)
// Above, we have already checked that this manifest refers to an image, not an OCI artifact,
// so the only difference between OCI and DockerSchema2 is the mediatypes. The
// media type of the manifest is handled by manifestSchema2FromComponents.
config.MediaType = manifest.DockerV2Schema2ConfigMediaType
layers := make([]manifest.Schema2Descriptor, len(ociManifest.Layers))
for idx := range layers {
layers[idx] = schema2DescriptorFromOCI1Descriptor(ociManifest.Layers[idx])
switch layers[idx].MediaType {
case imgspecv1.MediaTypeImageLayerNonDistributable: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images.
layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaType
case imgspecv1.MediaTypeImageLayerNonDistributableGzip: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images.
layers[idx].MediaType = manifest.DockerV2Schema2ForeignLayerMediaTypeGzip
case imgspecv1.MediaTypeImageLayerNonDistributableZstd: //nolint:staticcheck // NonDistributable layers are deprecated, but we want to continue to support manipulating pre-existing images.
return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType)
case imgspecv1.MediaTypeImageLayer:
layers[idx].MediaType = manifest.DockerV2SchemaLayerMediaTypeUncompressed
case imgspecv1.MediaTypeImageLayerGzip:
layers[idx].MediaType = manifest.DockerV2Schema2LayerMediaType
case imgspecv1.MediaTypeImageLayerZstd:
return nil, fmt.Errorf("Error during manifest conversion: %q: zstd compression is not supported for docker images", layers[idx].MediaType)
case ociencspec.MediaTypeLayerEnc, ociencspec.MediaTypeLayerGzipEnc, ociencspec.MediaTypeLayerZstdEnc,
ociencspec.MediaTypeLayerNonDistributableEnc, ociencspec.MediaTypeLayerNonDistributableGzipEnc, ociencspec.MediaTypeLayerNonDistributableZstdEnc:
return nil, fmt.Errorf("during manifest conversion: encrypted layers (%q) are not supported in docker images", layers[idx].MediaType)
default:
return nil, fmt.Errorf("Unknown media type during manifest conversion: %q", layers[idx].MediaType)
}
}
// Rather than copying the ConfigBlob now, we just pass m.src to the
// translated manifest, since the only difference is the mediatype of
// descriptors there is no change to any blob stored in m.src.
return manifestSchema2FromComponents(config, m.src, nil, layers), nil
} | 0.588623 | hypermodeinc/dgraph | worker/backup_manifest.go | containers/podman-tui | vendor/github.com/containers/image/v5/internal/image/oci.go | Apache-2.0 | go |
upgradeManifest updates the in-memory manifest from various versions to the latest version.
If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and
the drop data/attr operation.
If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to
<ns string>-<attr>. This is because of a bug for namespace greater than 127.
See https://github.com/hypermodeinc/dgraph/pull/7810
NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest. | func upgradeManifest(m *Manifest) error {
switch m.Version {
case 0:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
parsedPreds = append(parsedPreds, x.GalaxyAttr(pred))
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
switch op.DropOp {
case pb.DropOperation_DATA:
op.DropValue = fmt.Sprintf("%#x", x.GalaxyNamespace)
case pb.DropOperation_ATTR:
op.DropValue = x.GalaxyAttr(op.DropValue)
default:
// do nothing for drop all and drop namespace.
}
}
case 2103:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
ns_attr, err := x.AttrFrom2103(pred)
if err != nil {
return errors.Errorf("while parsing predicate got: %q", err)
}
parsedPreds = append(parsedPreds, ns_attr)
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
// We have a cluster wide drop data in v21.03.
if op.DropOp == pb.DropOperation_ATTR {
ns_attr, err := x.AttrFrom2103(op.DropValue)
if err != nil {
return errors.Errorf("while parsing the drop operation %+v got: %q",
op, err)
}
op.DropValue = ns_attr
}
}
case 2105:
// pass
}
return nil
} | func (m *manifestOCI1) convertToManifestSchema1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) {
if m.m.Config.MediaType != imgspecv1.MediaTypeImageConfig {
return nil, internalManifest.NewNonImageArtifactError(&m.m.Manifest)
}
// We can't directly convert images to V1, but we can transitively convert via a V2 image
m2, err := m.convertToManifestSchema2(ctx, options)
if err != nil {
return nil, err
}
return m2.convertToManifestSchema1(ctx, options)
} | 0.586164 | hypermodeinc/dgraph | worker/backup_manifest.go | containers/podman-tui | vendor/github.com/containers/image/v5/internal/image/oci.go | Apache-2.0 | go |
upgradeManifest updates the in-memory manifest from various versions to the latest version.
If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and
the drop data/attr operation.
If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to
<ns string>-<attr>. This is because of a bug for namespace greater than 127.
See https://github.com/hypermodeinc/dgraph/pull/7810
NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest. | func upgradeManifest(m *Manifest) error {
switch m.Version {
case 0:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
parsedPreds = append(parsedPreds, x.GalaxyAttr(pred))
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
switch op.DropOp {
case pb.DropOperation_DATA:
op.DropValue = fmt.Sprintf("%#x", x.GalaxyNamespace)
case pb.DropOperation_ATTR:
op.DropValue = x.GalaxyAttr(op.DropValue)
default:
// do nothing for drop all and drop namespace.
}
}
case 2103:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
ns_attr, err := x.AttrFrom2103(pred)
if err != nil {
return errors.Errorf("while parsing predicate got: %q", err)
}
parsedPreds = append(parsedPreds, ns_attr)
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
// We have a cluster wide drop data in v21.03.
if op.DropOp == pb.DropOperation_ATTR {
ns_attr, err := x.AttrFrom2103(op.DropValue)
if err != nil {
return errors.Errorf("while parsing the drop operation %+v got: %q",
op, err)
}
op.DropValue = ns_attr
}
}
case 2105:
// pass
}
return nil
} | func Schema1FromManifest(manifestBlob []byte) (*Schema1, error) {
s1 := Schema1{}
if err := json.Unmarshal(manifestBlob, &s1); err != nil {
return nil, err
}
if s1.SchemaVersion != 1 {
return nil, fmt.Errorf("unsupported schema version %d", s1.SchemaVersion)
}
if err := manifest.ValidateUnambiguousManifestFormat(manifestBlob, DockerV2Schema1SignedMediaType,
manifest.AllowedFieldFSLayers|manifest.AllowedFieldHistory); err != nil {
return nil, err
}
if err := s1.initialize(); err != nil {
return nil, err
}
if err := s1.fixManifestLayers(); err != nil {
return nil, err
}
return &s1, nil
} | 0.572512 | hypermodeinc/dgraph | worker/backup_manifest.go | containers/podman-tui | vendor/github.com/containers/image/v5/manifest/docker_schema1.go | Apache-2.0 | go |
upgradeManifest updates the in-memory manifest from various versions to the latest version.
If the manifest version is 0 (dgraph version < v21.03), attach namespace to the predicates and
the drop data/attr operation.
If the manifest version is 2103, convert the format of predicate from <ns bytes>|<attr> to
<ns string>-<attr>. This is because of a bug for namespace greater than 127.
See https://github.com/hypermodeinc/dgraph/pull/7810
NOTE: Do not use the upgraded manifest to overwrite the non-upgraded manifest. | func upgradeManifest(m *Manifest) error {
switch m.Version {
case 0:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
parsedPreds = append(parsedPreds, x.GalaxyAttr(pred))
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
switch op.DropOp {
case pb.DropOperation_DATA:
op.DropValue = fmt.Sprintf("%#x", x.GalaxyNamespace)
case pb.DropOperation_ATTR:
op.DropValue = x.GalaxyAttr(op.DropValue)
default:
// do nothing for drop all and drop namespace.
}
}
case 2103:
for gid, preds := range m.Groups {
parsedPreds := preds[:0]
for _, pred := range preds {
ns_attr, err := x.AttrFrom2103(pred)
if err != nil {
return errors.Errorf("while parsing predicate got: %q", err)
}
parsedPreds = append(parsedPreds, ns_attr)
}
m.Groups[gid] = parsedPreds
}
for _, op := range m.DropOperations {
// We have a cluster wide drop data in v21.03.
if op.DropOp == pb.DropOperation_ATTR {
ns_attr, err := x.AttrFrom2103(op.DropValue)
if err != nil {
return errors.Errorf("while parsing the drop operation %+v got: %q",
op, err)
}
op.DropValue = ns_attr
}
}
case 2105:
// pass
}
return nil
} | func (m *manifestSchema2) convertToManifestSchema1(ctx context.Context, options *types.ManifestUpdateOptions) (genericManifest, error) {
dest := options.InformationOnly.Destination
var convertedLayerUpdates []types.BlobInfo // Only used if options.LayerInfos != nil
if options.LayerInfos != nil {
if len(options.LayerInfos) != len(m.m.LayersDescriptors) {
return nil, fmt.Errorf("Error converting image: layer edits for %d layers vs %d existing layers",
len(options.LayerInfos), len(m.m.LayersDescriptors))
}
convertedLayerUpdates = []types.BlobInfo{}
}
configBytes, err := m.ConfigBlob(ctx)
if err != nil {
return nil, err
}
imageConfig := &manifest.Schema2Image{}
if err := json.Unmarshal(configBytes, imageConfig); err != nil {
return nil, err
}
// Build fsLayers and History, discarding all configs. We will patch the top-level config in later.
fsLayers := make([]manifest.Schema1FSLayers, len(imageConfig.History))
history := make([]manifest.Schema1History, len(imageConfig.History))
nonemptyLayerIndex := 0
var parentV1ID string // Set in the loop
v1ID := ""
haveGzippedEmptyLayer := false
if len(imageConfig.History) == 0 {
// What would this even mean?! Anyhow, the rest of the code depends on fsLayers[0] and history[0] existing.
return nil, fmt.Errorf("Cannot convert an image with 0 history entries to %s", manifest.DockerV2Schema1SignedMediaType)
}
for v2Index, historyEntry := range imageConfig.History {
parentV1ID = v1ID
v1Index := len(imageConfig.History) - 1 - v2Index
var blobDigest digest.Digest
if historyEntry.EmptyLayer {
emptyLayerBlobInfo := types.BlobInfo{Digest: GzippedEmptyLayerDigest, Size: int64(len(GzippedEmptyLayer))}
if !haveGzippedEmptyLayer {
logrus.Debugf("Uploading empty layer during conversion to schema 1")
// Ideally we should update the relevant BlobInfoCache about this layer, but that would require passing it down here,
// and anyway this blob is so small that it’s easier to just copy it than to worry about figuring out another location where to get it.
info, err := dest.PutBlob(ctx, bytes.NewReader(GzippedEmptyLayer), emptyLayerBlobInfo, none.NoCache, false)
if err != nil {
return nil, fmt.Errorf("uploading empty layer: %w", err)
}
if info.Digest != emptyLayerBlobInfo.Digest {
return nil, fmt.Errorf("Internal error: Uploaded empty layer has digest %#v instead of %s", info.Digest, emptyLayerBlobInfo.Digest)
}
haveGzippedEmptyLayer = true
}
if options.LayerInfos != nil {
convertedLayerUpdates = append(convertedLayerUpdates, emptyLayerBlobInfo)
}
blobDigest = emptyLayerBlobInfo.Digest
} else {
if nonemptyLayerIndex >= len(m.m.LayersDescriptors) {
return nil, fmt.Errorf("Invalid image configuration, needs more than the %d distributed layers", len(m.m.LayersDescriptors))
}
if options.LayerInfos != nil {
convertedLayerUpdates = append(convertedLayerUpdates, options.LayerInfos[nonemptyLayerIndex])
}
blobDigest = m.m.LayersDescriptors[nonemptyLayerIndex].Digest
nonemptyLayerIndex++
}
// AFAICT pull ignores these ID values, at least nowadays, so we could use anything unique, including a simple counter. Use what Docker uses for cargo-cult consistency.
v, err := v1IDFromBlobDigestAndComponents(blobDigest, parentV1ID)
if err != nil {
return nil, err
}
v1ID = v
fakeImage := manifest.Schema1V1Compatibility{
ID: v1ID,
Parent: parentV1ID,
Comment: historyEntry.Comment,
Created: historyEntry.Created,
Author: historyEntry.Author,
ThrowAway: historyEntry.EmptyLayer,
}
fakeImage.ContainerConfig.Cmd = []string{historyEntry.CreatedBy}
v1CompatibilityBytes, err := json.Marshal(&fakeImage)
if err != nil {
return nil, fmt.Errorf("Internal error: Error creating v1compatibility for %#v", fakeImage)
}
fsLayers[v1Index] = manifest.Schema1FSLayers{BlobSum: blobDigest}
history[v1Index] = manifest.Schema1History{V1Compatibility: string(v1CompatibilityBytes)}
// Note that parentV1ID of the top layer is preserved when exiting this loop
}
// Now patch in real configuration for the top layer (v1Index == 0)
v1ID, err = v1IDFromBlobDigestAndComponents(fsLayers[0].BlobSum, parentV1ID, string(configBytes)) // See above WRT v1ID value generation and cargo-cult consistency.
if err != nil {
return nil, err
}
v1Config, err := v1ConfigFromConfigJSON(configBytes, v1ID, parentV1ID, imageConfig.History[len(imageConfig.History)-1].EmptyLayer)
if err != nil {
return nil, err
}
history[0].V1Compatibility = string(v1Config)
if options.LayerInfos != nil {
options.LayerInfos = convertedLayerUpdates
}
m1, err := manifestSchema1FromComponents(dest.Reference().DockerReference(), fsLayers, history, imageConfig.Architecture)
if err != nil {
return nil, err // This should never happen, we should have created all the components correctly.
}
return m1, nil
} | 0.571867 | hypermodeinc/dgraph | worker/backup_manifest.go | containers/podman-tui | vendor/github.com/containers/image/v5/internal/image/docker_schema2.go | Apache-2.0 | go |
getSchema iterates over all predicates and populates the asked fields, if list of
predicates is not specified, then all the predicates belonging to the group
are returned | func getSchema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {
_, span := otel.Tracer("").Start(ctx, "worker.getSchema")
defer span.End()
var result pb.SchemaResult
var predicates []string
var fields []string
if len(s.Predicates) > 0 {
predicates = s.Predicates
} else {
predicates = schema.State().Predicates()
}
if len(s.Fields) > 0 {
fields = s.Fields
} else {
fields = []string{"type", "index", "tokenizer", "reverse", "count", "list", "upsert", "unique",
"lang", "noconflict", "vector_specs"}
}
myGid := groups().groupId()
for _, attr := range predicates {
// This can happen after a predicate is moved. We don't delete predicate from schema state
// immediately. So lets ignore this predicate.
gid, err := groups().BelongsToReadOnly(attr, 0)
if err != nil {
return nil, err
}
if myGid != gid {
continue
}
if schemaNode := populateSchema(attr, fields); schemaNode != nil {
result.Schema = append(result.Schema, schemaNode)
}
}
return &result, nil
} | func createObjectPredicates(
sb *schema.Builder,
s *schema.Schema,
filterObject *entity.Entity,
) ([]*Predicate, error) {
var predicates = make([]*Predicate, 0)
for pair := filterObject.First(); pair != nil; pair = pair.Next() {
if pair.Key == "$or" || pair.Key == "$and" {
opEntities, ok := pair.Value.([]*entity.Entity)
if !ok {
return nil, errors.New("invalid $or/$and value")
}
var opPredicates []*Predicate
for _, opEntity := range opEntities {
/**
In a single entity, all field are connected by AND
E.g. { "age": { "$gt": 1, "$lt": 10 } } --> age > 1 AND age < 10
*/
objectPredicates, err := createObjectPredicates(sb, s, opEntity)
if err != nil {
return nil, err
}
if len(objectPredicates) > 1 {
opPredicates = append(opPredicates, And(objectPredicates...))
} else {
opPredicates = append(opPredicates, objectPredicates...)
}
// opPredicates = append(opPredicates, objectPredicates...)
}
op := utils.If(pair.Key == "$or", Or, And)
predicates = append(predicates, op(opPredicates...))
continue
}
var fieldRelations []string
var fieldPredicates []*Predicate
var err error
// If the field contains ".", it is a relation filter
// E.g. "owner.groups.name": { "$like": "group_or_the_pet_owner%" }
if strings.Contains(pair.Key, ".") {
relationFields := utils.Filter(
strings.Split(pair.Key, "."),
func(s string) bool {
return strings.TrimSpace(s) != ""
},
)
if len(relationFields) < 2 {
return nil, filterError(fmt.Errorf("%s is not a valid relation field", pair.Key))
}
// last field is the last relation filter column
lastRelationColumn := relationFields[len(relationFields)-1]
relationFields = relationFields[:len(relationFields)-1]
currentSchema := s
var targetSchema *schema.Schema = nil
for _, relationField := range relationFields {
currentField := currentSchema.Field(relationField)
if currentField == nil {
return nil, filterError(schema.ErrFieldNotFound(currentSchema.Name, relationField))
}
if !currentField.Type.IsRelationType() {
return nil, filterError(fmt.Errorf("%s is not a relation field", pair.Key))
}
targetSchema, err = sb.Schema(currentField.Relation.TargetSchemaName)
if err != nil {
return nil, filterError(fmt.Errorf("invalid relation schema %s: %w", relationField, err))
}
currentSchema = targetSchema
}
lastRelationField := targetSchema.Field(lastRelationColumn)
if lastRelationField == nil {
return nil, filterError(schema.ErrFieldNotFound(targetSchema.Name, lastRelationColumn))
}
fieldRelations = relationFields
if fieldPredicates, err = createFieldPredicate(
lastRelationField,
pair.Value,
); err != nil {
return nil, err
}
} else {
f := s.Field(pair.Key)
if f == nil {
return nil, filterError(schema.ErrFieldNotFound(s.Name, pair.Key))
}
if fieldPredicates, err = createFieldPredicate(f, pair.Value); err != nil {
return nil, err
}
}
// if err != nil {
// return nil, err
// }
if len(fieldPredicates) > 1 {
p := And(fieldPredicates...)
p.RelationFieldNames = fieldRelations
predicates = append(predicates, p)
} else {
p := fieldPredicates[0]
p.RelationFieldNames = fieldRelations
predicates = append(predicates, p)
}
}
return predicates, nil
} | 0.525494 | hypermodeinc/dgraph | worker/schema.go | fastschema/fastschema | db/predicate.go | MIT | go |
getSchema iterates over all predicates and populates the asked fields, if list of
predicates is not specified, then all the predicates belonging to the group
are returned | func getSchema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {
_, span := otel.Tracer("").Start(ctx, "worker.getSchema")
defer span.End()
var result pb.SchemaResult
var predicates []string
var fields []string
if len(s.Predicates) > 0 {
predicates = s.Predicates
} else {
predicates = schema.State().Predicates()
}
if len(s.Fields) > 0 {
fields = s.Fields
} else {
fields = []string{"type", "index", "tokenizer", "reverse", "count", "list", "upsert", "unique",
"lang", "noconflict", "vector_specs"}
}
myGid := groups().groupId()
for _, attr := range predicates {
// This can happen after a predicate is moved. We don't delete predicate from schema state
// immediately. So lets ignore this predicate.
gid, err := groups().BelongsToReadOnly(attr, 0)
if err != nil {
return nil, err
}
if myGid != gid {
continue
}
if schemaNode := populateSchema(attr, fields); schemaNode != nil {
result.Schema = append(result.Schema, schemaNode)
}
}
return &result, nil
} | func createFieldPredicate(
field *schema.Field,
value any,
) ([]*Predicate, error) {
switch fieldValue := value.(type) {
// If the value is an entity, it means there are some operators. E.g.
// { "age": { "$gt": 1, "$lt": 10 } }
// --> create predicates for each operator
case *entity.Entity:
predicates := []*Predicate{}
for p := fieldValue.First(); p != nil; p = p.Next() {
op := stringToOperatorTypes[p.Key]
if op != OpNULL && !field.IsValidValue(p.Value) {
return nil, filterError(fmt.Errorf(
"invalid value for field %s.%s (%s) = %v (%T)",
field.Name,
p.Key,
field.Type,
p.Value,
p.Value,
))
}
switch stringToOperatorTypes[p.Key] {
case OpEQ:
predicates = append(predicates, EQ(field.Name, p.Value))
case OpNEQ:
predicates = append(predicates, NEQ(field.Name, p.Value))
case OpGT:
predicates = append(predicates, GT(field.Name, p.Value))
case OpGTE:
predicates = append(predicates, GTE(field.Name, p.Value))
case OpLT:
predicates = append(predicates, LT(field.Name, p.Value))
case OpLTE:
predicates = append(predicates, LTE(field.Name, p.Value))
case OpLIKE:
predicates = append(predicates, Like(field.Name, p.Value.(string)))
case OpIN:
arrayVal, ok := p.Value.([]any)
if !ok {
return nil, filterError(fmt.Errorf("$in operator must be an array"))
}
predicates = append(predicates, In(field.Name, arrayVal))
case OpNIN:
arrayVal, ok := p.Value.([]any)
if !ok {
return nil, filterError(fmt.Errorf("$nin operator must be an array"))
}
predicates = append(predicates, NotIn(field.Name, arrayVal))
case OpNULL:
boolVal, ok := p.Value.(bool)
if !ok {
return nil, filterError(fmt.Errorf("$null operator must be a boolean"))
}
predicates = append(predicates, Null(field.Name, boolVal))
}
}
return predicates, nil
// If the value is primitive
// --> create a simple EQ predicate (string, int, uint, bool, etc.)
default:
if !field.IsValidValue(fieldValue) {
return nil, filterError(fmt.Errorf(
"invalid value for field %s (%s) = %v (%T)",
field.Name,
field.Type,
fieldValue,
fieldValue,
))
}
return []*Predicate{EQ(field.Name, fieldValue)}, nil
} | 0.51604 | hypermodeinc/dgraph | worker/schema.go | fastschema/fastschema | db/predicate.go | MIT | go |
getSchema iterates over all predicates and populates the asked fields, if list of
predicates is not specified, then all the predicates belonging to the group
are returned | func getSchema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {
_, span := otel.Tracer("").Start(ctx, "worker.getSchema")
defer span.End()
var result pb.SchemaResult
var predicates []string
var fields []string
if len(s.Predicates) > 0 {
predicates = s.Predicates
} else {
predicates = schema.State().Predicates()
}
if len(s.Fields) > 0 {
fields = s.Fields
} else {
fields = []string{"type", "index", "tokenizer", "reverse", "count", "list", "upsert", "unique",
"lang", "noconflict", "vector_specs"}
}
myGid := groups().groupId()
for _, attr := range predicates {
// This can happen after a predicate is moved. We don't delete predicate from schema state
// immediately. So lets ignore this predicate.
gid, err := groups().BelongsToReadOnly(attr, 0)
if err != nil {
return nil, err
}
if myGid != gid {
continue
}
if schemaNode := populateSchema(attr, fields); schemaNode != nil {
result.Schema = append(result.Schema, schemaNode)
}
}
return &result, nil
} | func (la *LogicalAggregation) GetGroupByCols() []*expression.Column {
if la.groupByCols == nil {
la.collectGroupByColumns()
}
return la.groupByCols
} | 0.480072 | hypermodeinc/dgraph | worker/schema.go | talent-plan/tinysql | planner/core/logical_plans.go | Apache-2.0 | go |
getSchema iterates over all predicates and populates the asked fields, if list of
predicates is not specified, then all the predicates belonging to the group
are returned | func getSchema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {
_, span := otel.Tracer("").Start(ctx, "worker.getSchema")
defer span.End()
var result pb.SchemaResult
var predicates []string
var fields []string
if len(s.Predicates) > 0 {
predicates = s.Predicates
} else {
predicates = schema.State().Predicates()
}
if len(s.Fields) > 0 {
fields = s.Fields
} else {
fields = []string{"type", "index", "tokenizer", "reverse", "count", "list", "upsert", "unique",
"lang", "noconflict", "vector_specs"}
}
myGid := groups().groupId()
for _, attr := range predicates {
// This can happen after a predicate is moved. We don't delete predicate from schema state
// immediately. So lets ignore this predicate.
gid, err := groups().BelongsToReadOnly(attr, 0)
if err != nil {
return nil, err
}
if myGid != gid {
continue
}
if schemaNode := populateSchema(attr, fields); schemaNode != nil {
result.Schema = append(result.Schema, schemaNode)
}
}
return &result, nil
} | func (la *LogicalAggregation) PredicatePushDown(predicates []expression.Expression) (ret []expression.Expression, retPlan LogicalPlan) {
return predicates, la
} | 0.453897 | hypermodeinc/dgraph | worker/schema.go | talent-plan/tinysql | planner/core/rule_predicate_push_down.go | Apache-2.0 | go |
getSchema iterates over all predicates and populates the asked fields, if list of
predicates is not specified, then all the predicates belonging to the group
are returned | func getSchema(ctx context.Context, s *pb.SchemaRequest) (*pb.SchemaResult, error) {
_, span := otel.Tracer("").Start(ctx, "worker.getSchema")
defer span.End()
var result pb.SchemaResult
var predicates []string
var fields []string
if len(s.Predicates) > 0 {
predicates = s.Predicates
} else {
predicates = schema.State().Predicates()
}
if len(s.Fields) > 0 {
fields = s.Fields
} else {
fields = []string{"type", "index", "tokenizer", "reverse", "count", "list", "upsert", "unique",
"lang", "noconflict", "vector_specs"}
}
myGid := groups().groupId()
for _, attr := range predicates {
// This can happen after a predicate is moved. We don't delete predicate from schema state
// immediately. So lets ignore this predicate.
gid, err := groups().BelongsToReadOnly(attr, 0)
if err != nil {
return nil, err
}
if myGid != gid {
continue
}
if schemaNode := populateSchema(attr, fields); schemaNode != nil {
result.Schema = append(result.Schema, schemaNode)
}
}
return &result, nil
} | func IsPreDefinedPredicate(pred string) bool {
pred = ParseAttr(pred)
_, ok := starAllPredicateMap[strings.ToLower(pred)]
return ok || IsAclPredicate(pred) || IsOtherReservedPredicate(pred)
} | 0.449586 | hypermodeinc/dgraph | worker/schema.go | hypermodeinc/dgraph | x/keys.go | Apache-2.0 | go |
UpgradeElasticsearchDomain API operation for Amazon Elasticsearch Service.
Allows you to either upgrade your domain or perform an Upgrade eligibility
check to a compatible Elasticsearch version.
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 Elasticsearch Service's
API operation UpgradeElasticsearchDomain for usage and error information.
Returned Error Types:
- BaseException
An error occurred while processing the request.
- ResourceNotFoundException
An exception for accessing or deleting a resource that does not exist. Gives
http status code of 400.
- ResourceAlreadyExistsException
An exception for creating a resource that already exists. Gives http status
code of 400.
- DisabledOperationException
An error occured because the client wanted to access a not supported operation.
Gives http status code of 409.
- ValidationException
An exception for missing / invalid input fields. Gives http status code of
400.
- InternalException
The request processing has failed because of an unknown error, exception
or failure (the failure is internal to the service) . Gives http status code
of 500. | func (c *ElasticsearchService) UpgradeElasticsearchDomain(input *UpgradeElasticsearchDomainInput) (*UpgradeElasticsearchDomainOutput, error) {
req, out := c.UpgradeElasticsearchDomainRequest(input)
return out, req.Send()
} | func (c *OpenSearchService) UpgradeDomain(input *UpgradeDomainInput) (*UpgradeDomainOutput, error) {
req, out := c.UpgradeDomainRequest(input)
return out, req.Send()
} | 0.919838 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/opensearchservice/api.go | Apache-2.0 | go |
UpgradeElasticsearchDomain API operation for Amazon Elasticsearch Service.
Allows you to either upgrade your domain or perform an Upgrade eligibility
check to a compatible Elasticsearch version.
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 Elasticsearch Service's
API operation UpgradeElasticsearchDomain for usage and error information.
Returned Error Types:
- BaseException
An error occurred while processing the request.
- ResourceNotFoundException
An exception for accessing or deleting a resource that does not exist. Gives
http status code of 400.
- ResourceAlreadyExistsException
An exception for creating a resource that already exists. Gives http status
code of 400.
- DisabledOperationException
An error occured because the client wanted to access a not supported operation.
Gives http status code of 409.
- ValidationException
An exception for missing / invalid input fields. Gives http status code of
400.
- InternalException
The request processing has failed because of an unknown error, exception
or failure (the failure is internal to the service) . Gives http status code
of 500. | func (c *ElasticsearchService) UpgradeElasticsearchDomain(input *UpgradeElasticsearchDomainInput) (*UpgradeElasticsearchDomainOutput, error) {
req, out := c.UpgradeElasticsearchDomainRequest(input)
return out, req.Send()
} | func (c *ElasticsearchService) GetUpgradeStatus(input *GetUpgradeStatusInput) (*GetUpgradeStatusOutput, error) {
req, out := c.GetUpgradeStatusRequest(input)
return out, req.Send()
} | 0.743185 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
UpgradeElasticsearchDomain API operation for Amazon Elasticsearch Service.
Allows you to either upgrade your domain or perform an Upgrade eligibility
check to a compatible Elasticsearch version.
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 Elasticsearch Service's
API operation UpgradeElasticsearchDomain for usage and error information.
Returned Error Types:
- BaseException
An error occurred while processing the request.
- ResourceNotFoundException
An exception for accessing or deleting a resource that does not exist. Gives
http status code of 400.
- ResourceAlreadyExistsException
An exception for creating a resource that already exists. Gives http status
code of 400.
- DisabledOperationException
An error occured because the client wanted to access a not supported operation.
Gives http status code of 409.
- ValidationException
An exception for missing / invalid input fields. Gives http status code of
400.
- InternalException
The request processing has failed because of an unknown error, exception
or failure (the failure is internal to the service) . Gives http status code
of 500. | func (c *ElasticsearchService) UpgradeElasticsearchDomain(input *UpgradeElasticsearchDomainInput) (*UpgradeElasticsearchDomainOutput, error) {
req, out := c.UpgradeElasticsearchDomainRequest(input)
return out, req.Send()
} | func (c *ElasticsearchService) CreateElasticsearchDomain(input *CreateElasticsearchDomainInput) (*CreateElasticsearchDomainOutput, error) {
req, out := c.CreateElasticsearchDomainRequest(input)
return out, req.Send()
} | 0.734768 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
UpgradeElasticsearchDomain API operation for Amazon Elasticsearch Service.
Allows you to either upgrade your domain or perform an Upgrade eligibility
check to a compatible Elasticsearch version.
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 Elasticsearch Service's
API operation UpgradeElasticsearchDomain for usage and error information.
Returned Error Types:
- BaseException
An error occurred while processing the request.
- ResourceNotFoundException
An exception for accessing or deleting a resource that does not exist. Gives
http status code of 400.
- ResourceAlreadyExistsException
An exception for creating a resource that already exists. Gives http status
code of 400.
- DisabledOperationException
An error occured because the client wanted to access a not supported operation.
Gives http status code of 409.
- ValidationException
An exception for missing / invalid input fields. Gives http status code of
400.
- InternalException
The request processing has failed because of an unknown error, exception
or failure (the failure is internal to the service) . Gives http status code
of 500. | func (c *ElasticsearchService) UpgradeElasticsearchDomain(input *UpgradeElasticsearchDomainInput) (*UpgradeElasticsearchDomainOutput, error) {
req, out := c.UpgradeElasticsearchDomainRequest(input)
return out, req.Send()
} | func (c *ElasticsearchService) UpgradeElasticsearchDomainRequest(input *UpgradeElasticsearchDomainInput) (req *request.Request, output *UpgradeElasticsearchDomainOutput) {
op := &request.Operation{
Name: opUpgradeElasticsearchDomain,
HTTPMethod: "POST",
HTTPPath: "/2015-01-01/es/upgradeDomain",
}
if input == nil {
input = &UpgradeElasticsearchDomainInput{}
}
output = &UpgradeElasticsearchDomainOutput{}
req = c.newRequest(op, input, output)
return
} | 0.726692 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
UpgradeElasticsearchDomain API operation for Amazon Elasticsearch Service.
Allows you to either upgrade your domain or perform an Upgrade eligibility
check to a compatible Elasticsearch version.
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 Elasticsearch Service's
API operation UpgradeElasticsearchDomain for usage and error information.
Returned Error Types:
- BaseException
An error occurred while processing the request.
- ResourceNotFoundException
An exception for accessing or deleting a resource that does not exist. Gives
http status code of 400.
- ResourceAlreadyExistsException
An exception for creating a resource that already exists. Gives http status
code of 400.
- DisabledOperationException
An error occured because the client wanted to access a not supported operation.
Gives http status code of 409.
- ValidationException
An exception for missing / invalid input fields. Gives http status code of
400.
- InternalException
The request processing has failed because of an unknown error, exception
or failure (the failure is internal to the service) . Gives http status code
of 500. | func (c *ElasticsearchService) UpgradeElasticsearchDomain(input *UpgradeElasticsearchDomainInput) (*UpgradeElasticsearchDomainOutput, error) {
req, out := c.UpgradeElasticsearchDomainRequest(input)
return out, req.Send()
} | func (c *ElasticsearchService) GetCompatibleElasticsearchVersions(input *GetCompatibleElasticsearchVersionsInput) (*GetCompatibleElasticsearchVersionsOutput, error) {
req, out := c.GetCompatibleElasticsearchVersionsRequest(input)
return out, req.Send()
} | 0.724036 | aws/aws-sdk-go | service/elasticsearchservice/api.go | aws/aws-sdk-go | service/elasticsearchservice/api.go | Apache-2.0 | go |
elementValues returns a slice containing all values for the field across all elements
from all sources.
Return value slice is ordered using the original ordering from the elements, where
elements missing from earlier sources appear later. | func (l Walker) elementValues(keys []string) [][]string {
// use slice to to keep elements in the original order
var returnValues [][]string
var seen sets.StringList
// if we are doing append, dest node should be the first.
// otherwise dest node should be the last.
beginIdx := 0
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
beginIdx = 1
}
for i := range l.Sources {
src := l.Sources[(i+beginIdx)%len(l.Sources)]
if src == nil {
continue
}
// add the value of the field for each element
// don't check error, we know this is a list node
values, _ := src.ElementValuesList(keys)
for _, s := range values {
if len(s) == 0 || seen.Has(s) {
continue
}
returnValues = append(returnValues, s)
seen = seen.Insert(s)
}
}
return returnValues
} | func (rn *RNode) ElementValues(key string) ([]string, error) {
if err := ErrorIfInvalid(rn, yaml.SequenceNode); err != nil {
return nil, errors.Wrap(err)
}
var elements []string
for i := 0; i < len(rn.Content()); i++ {
field := NewRNode(rn.Content()[i]).Field(key)
if !field.IsNilOrEmpty() {
elements = append(elements, field.Value.YNode().Value)
}
}
return elements, nil
} | 0.713 | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/rnode.go | Apache-2.0 | go |
elementValues returns a slice containing all values for the field across all elements
from all sources.
Return value slice is ordered using the original ordering from the elements, where
elements missing from earlier sources appear later. | func (l Walker) elementValues(keys []string) [][]string {
// use slice to to keep elements in the original order
var returnValues [][]string
var seen sets.StringList
// if we are doing append, dest node should be the first.
// otherwise dest node should be the last.
beginIdx := 0
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
beginIdx = 1
}
for i := range l.Sources {
src := l.Sources[(i+beginIdx)%len(l.Sources)]
if src == nil {
continue
}
// add the value of the field for each element
// don't check error, we know this is a list node
values, _ := src.ElementValuesList(keys)
for _, s := range values {
if len(s) == 0 || seen.Has(s) {
continue
}
returnValues = append(returnValues, s)
seen = seen.Insert(s)
}
}
return returnValues
} | func (rn *RNode) ElementValuesList(keys []string) ([][]string, error) {
if err := ErrorIfInvalid(rn, yaml.SequenceNode); err != nil {
return nil, errors.Wrap(err)
}
elements := make([][]string, len(rn.Content()))
for i := 0; i < len(rn.Content()); i++ {
for _, key := range keys {
field := NewRNode(rn.Content()[i]).Field(key)
if field.IsNilOrEmpty() {
elements[i] = append(elements[i], "")
} else {
elements[i] = append(elements[i], field.Value.YNode().Value)
}
}
}
return elements, nil
} | 0.594083 | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/rnode.go | Apache-2.0 | go |
elementValues returns a slice containing all values for the field across all elements
from all sources.
Return value slice is ordered using the original ordering from the elements, where
elements missing from earlier sources appear later. | func (l Walker) elementValues(keys []string) [][]string {
// use slice to to keep elements in the original order
var returnValues [][]string
var seen sets.StringList
// if we are doing append, dest node should be the first.
// otherwise dest node should be the last.
beginIdx := 0
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
beginIdx = 1
}
for i := range l.Sources {
src := l.Sources[(i+beginIdx)%len(l.Sources)]
if src == nil {
continue
}
// add the value of the field for each element
// don't check error, we know this is a list node
values, _ := src.ElementValuesList(keys)
for _, s := range values {
if len(s) == 0 || seen.Has(s) {
continue
}
returnValues = append(returnValues, s)
seen = seen.Insert(s)
}
}
return returnValues
} | func (a Array) Values() ([]Value, error) {
return values(a)
} | 0.567957 | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go | containers/podman-tui | vendor/go.mongodb.org/mongo-driver/x/bsonx/bsoncore/array.go | Apache-2.0 | go |
elementValues returns a slice containing all values for the field across all elements
from all sources.
Return value slice is ordered using the original ordering from the elements, where
elements missing from earlier sources appear later. | func (l Walker) elementValues(keys []string) [][]string {
// use slice to to keep elements in the original order
var returnValues [][]string
var seen sets.StringList
// if we are doing append, dest node should be the first.
// otherwise dest node should be the last.
beginIdx := 0
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
beginIdx = 1
}
for i := range l.Sources {
src := l.Sources[(i+beginIdx)%len(l.Sources)]
if src == nil {
continue
}
// add the value of the field for each element
// don't check error, we know this is a list node
values, _ := src.ElementValuesList(keys)
for _, s := range values {
if len(s) == 0 || seen.Has(s) {
continue
}
returnValues = append(returnValues, s)
seen = seen.Insert(s)
}
}
return returnValues
} | func (r Raw) Elements() ([]RawElement, error) {
doc := bsoncore.Document(r)
if len(doc) == 0 {
return nil, nil
}
elems, err := doc.Elements()
if err != nil {
return nil, err
}
relems := make([]RawElement, 0, len(elems))
for _, elem := range elems {
relems = append(relems, RawElement(elem))
}
return relems, nil
} | 0.539584 | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go | containers/podman-tui | vendor/go.mongodb.org/mongo-driver/bson/raw.go | Apache-2.0 | go |
elementValues returns a slice containing all values for the field across all elements
from all sources.
Return value slice is ordered using the original ordering from the elements, where
elements missing from earlier sources appear later. | func (l Walker) elementValues(keys []string) [][]string {
// use slice to to keep elements in the original order
var returnValues [][]string
var seen sets.StringList
// if we are doing append, dest node should be the first.
// otherwise dest node should be the last.
beginIdx := 0
if l.MergeOptions.ListIncreaseDirection == yaml.MergeOptionsListPrepend {
beginIdx = 1
}
for i := range l.Sources {
src := l.Sources[(i+beginIdx)%len(l.Sources)]
if src == nil {
continue
}
// add the value of the field for each element
// don't check error, we know this is a list node
values, _ := src.ElementValuesList(keys)
for _, s := range values {
if len(s) == 0 || seen.Has(s) {
continue
}
returnValues = append(returnValues, s)
seen = seen.Insert(s)
}
}
return returnValues
} | func (SortOrderType) Values() []SortOrderType {
return []SortOrderType{
"asc",
"desc",
}
} | 0.533249 | tektoncd/cli | vendor/sigs.k8s.io/kustomize/kyaml/yaml/walk/associative_sequence.go | umputun/spot | vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/types/enums.go | MIT | go |
CreateOrUpdateTags API operation for Auto Scaling.
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see Tag Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the Amazon EC2 Auto Scaling User Guide.
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 Auto Scaling's
API operation CreateOrUpdateTags for usage and error information.
Returned Error Codes:
- ErrCodeLimitExceededFault "LimitExceeded"
You have already reached a limit for your Amazon EC2 Auto Scaling resources
(for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
in the Amazon EC2 Auto Scaling API Reference.
- ErrCodeAlreadyExistsFault "AlreadyExists"
You already have an Auto Scaling group or launch configuration with this
name.
- ErrCodeResourceContentionFault "ResourceContention"
You already have a pending update to an Amazon EC2 Auto Scaling resource
(for example, an Auto Scaling group, instance, or load balancer).
- ErrCodeResourceInUseFault "ResourceInUse"
The operation can't be performed because the resource is in use.
See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags | func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) {
req, out := c.CreateOrUpdateTagsRequest(input)
return out, req.Send()
} | func (c *AutoScaling) CreateOrUpdateTagsRequest(input *CreateOrUpdateTagsInput) (req *request.Request, output *CreateOrUpdateTagsOutput) {
op := &request.Operation{
Name: opCreateOrUpdateTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateOrUpdateTagsInput{}
}
output = &CreateOrUpdateTagsOutput{}
req = c.newRequest(op, input, output)
req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
return
} | 0.82524 | aws/aws-sdk-go | service/autoscaling/api.go | aws/aws-sdk-go | service/autoscaling/api.go | Apache-2.0 | go |
CreateOrUpdateTags API operation for Auto Scaling.
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see Tag Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the Amazon EC2 Auto Scaling User Guide.
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 Auto Scaling's
API operation CreateOrUpdateTags for usage and error information.
Returned Error Codes:
- ErrCodeLimitExceededFault "LimitExceeded"
You have already reached a limit for your Amazon EC2 Auto Scaling resources
(for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
in the Amazon EC2 Auto Scaling API Reference.
- ErrCodeAlreadyExistsFault "AlreadyExists"
You already have an Auto Scaling group or launch configuration with this
name.
- ErrCodeResourceContentionFault "ResourceContention"
You already have a pending update to an Amazon EC2 Auto Scaling resource
(for example, an Auto Scaling group, instance, or load balancer).
- ErrCodeResourceInUseFault "ResourceInUse"
The operation can't be performed because the resource is in use.
See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags | func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) {
req, out := c.CreateOrUpdateTagsRequest(input)
return out, req.Send()
} | func (c *AutoScaling) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) {
req, out := c.DeleteTagsRequest(input)
return out, req.Send()
} | 0.779813 | aws/aws-sdk-go | service/autoscaling/api.go | aws/aws-sdk-go | service/autoscaling/api.go | Apache-2.0 | go |
CreateOrUpdateTags API operation for Auto Scaling.
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see Tag Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the Amazon EC2 Auto Scaling User Guide.
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 Auto Scaling's
API operation CreateOrUpdateTags for usage and error information.
Returned Error Codes:
- ErrCodeLimitExceededFault "LimitExceeded"
You have already reached a limit for your Amazon EC2 Auto Scaling resources
(for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
in the Amazon EC2 Auto Scaling API Reference.
- ErrCodeAlreadyExistsFault "AlreadyExists"
You already have an Auto Scaling group or launch configuration with this
name.
- ErrCodeResourceContentionFault "ResourceContention"
You already have a pending update to an Amazon EC2 Auto Scaling resource
(for example, an Auto Scaling group, instance, or load balancer).
- ErrCodeResourceInUseFault "ResourceInUse"
The operation can't be performed because the resource is in use.
See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags | func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) {
req, out := c.CreateOrUpdateTagsRequest(input)
return out, req.Send()
} | func (c *ApplicationAutoScaling) TagResource(input *TagResourceInput) (*TagResourceOutput, error) {
req, out := c.TagResourceRequest(input)
return out, req.Send()
} | 0.766481 | aws/aws-sdk-go | service/autoscaling/api.go | aws/aws-sdk-go | service/applicationautoscaling/api.go | Apache-2.0 | go |
CreateOrUpdateTags API operation for Auto Scaling.
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see Tag Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the Amazon EC2 Auto Scaling User Guide.
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 Auto Scaling's
API operation CreateOrUpdateTags for usage and error information.
Returned Error Codes:
- ErrCodeLimitExceededFault "LimitExceeded"
You have already reached a limit for your Amazon EC2 Auto Scaling resources
(for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
in the Amazon EC2 Auto Scaling API Reference.
- ErrCodeAlreadyExistsFault "AlreadyExists"
You already have an Auto Scaling group or launch configuration with this
name.
- ErrCodeResourceContentionFault "ResourceContention"
You already have a pending update to an Amazon EC2 Auto Scaling resource
(for example, an Auto Scaling group, instance, or load balancer).
- ErrCodeResourceInUseFault "ResourceInUse"
The operation can't be performed because the resource is in use.
See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags | func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) {
req, out := c.CreateOrUpdateTagsRequest(input)
return out, req.Send()
} | func (c *EC2) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) {
req, out := c.CreateTagsRequest(input)
return out, req.Send()
} | 0.761212 | aws/aws-sdk-go | service/autoscaling/api.go | aws/aws-sdk-go | service/ec2/api.go | Apache-2.0 | go |
CreateOrUpdateTags API operation for Auto Scaling.
Creates or updates tags for the specified Auto Scaling group.
When you specify a tag with a key that already exists, the operation overwrites
the previous tag definition, and you do not get an error message.
For more information, see Tag Auto Scaling groups and instances (https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-tagging.html)
in the Amazon EC2 Auto Scaling User Guide.
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 Auto Scaling's
API operation CreateOrUpdateTags for usage and error information.
Returned Error Codes:
- ErrCodeLimitExceededFault "LimitExceeded"
You have already reached a limit for your Amazon EC2 Auto Scaling resources
(for example, Auto Scaling groups, launch configurations, or lifecycle hooks).
For more information, see DescribeAccountLimits (https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeAccountLimits.html)
in the Amazon EC2 Auto Scaling API Reference.
- ErrCodeAlreadyExistsFault "AlreadyExists"
You already have an Auto Scaling group or launch configuration with this
name.
- ErrCodeResourceContentionFault "ResourceContention"
You already have a pending update to an Amazon EC2 Auto Scaling resource
(for example, an Auto Scaling group, instance, or load balancer).
- ErrCodeResourceInUseFault "ResourceInUse"
The operation can't be performed because the resource is in use.
See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/CreateOrUpdateTags | func (c *AutoScaling) CreateOrUpdateTags(input *CreateOrUpdateTagsInput) (*CreateOrUpdateTagsOutput, error) {
req, out := c.CreateOrUpdateTagsRequest(input)
return out, req.Send()
} | func (c *AutoScaling) CreateAutoScalingGroup(input *CreateAutoScalingGroupInput) (*CreateAutoScalingGroupOutput, error) {
req, out := c.CreateAutoScalingGroupRequest(input)
return out, req.Send()
} | 0.747004 | aws/aws-sdk-go | service/autoscaling/api.go | aws/aws-sdk-go | service/autoscaling/api.go | Apache-2.0 | go |
CreateApplicationPresignedUrlWithContext is the same as CreateApplicationPresignedUrl with the addition of
the ability to pass a context and additional request options.
See CreateApplicationPresignedUrl 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 *KinesisAnalyticsV2) CreateApplicationPresignedUrlWithContext(ctx aws.Context, input *CreateApplicationPresignedUrlInput, opts ...request.Option) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *SageMaker) CreatePresignedDomainUrlWithContext(ctx aws.Context, input *CreatePresignedDomainUrlInput, opts ...request.Option) (*CreatePresignedDomainUrlOutput, error) {
req, out := c.CreatePresignedDomainUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.84603 | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | aws/aws-sdk-go | service/sagemaker/api.go | Apache-2.0 | go |
CreateApplicationPresignedUrlWithContext is the same as CreateApplicationPresignedUrl with the addition of
the ability to pass a context and additional request options.
See CreateApplicationPresignedUrl 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 *KinesisAnalyticsV2) CreateApplicationPresignedUrlWithContext(ctx aws.Context, input *CreateApplicationPresignedUrlInput, opts ...request.Option) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *Athena) CreatePresignedNotebookUrlWithContext(ctx aws.Context, input *CreatePresignedNotebookUrlInput, opts ...request.Option) (*CreatePresignedNotebookUrlOutput, error) {
req, out := c.CreatePresignedNotebookUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.827255 | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | aws/aws-sdk-go | service/athena/api.go | Apache-2.0 | go |
CreateApplicationPresignedUrlWithContext is the same as CreateApplicationPresignedUrl with the addition of
the ability to pass a context and additional request options.
See CreateApplicationPresignedUrl 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 *KinesisAnalyticsV2) CreateApplicationPresignedUrlWithContext(ctx aws.Context, input *CreateApplicationPresignedUrlInput, opts ...request.Option) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *KinesisAnalyticsV2) CreateApplicationPresignedUrlRequest(input *CreateApplicationPresignedUrlInput) (req *request.Request, output *CreateApplicationPresignedUrlOutput) {
op := &request.Operation{
Name: opCreateApplicationPresignedUrl,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateApplicationPresignedUrlInput{}
}
output = &CreateApplicationPresignedUrlOutput{}
req = c.newRequest(op, input, output)
return
} | 0.795693 | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | Apache-2.0 | go |
CreateApplicationPresignedUrlWithContext is the same as CreateApplicationPresignedUrl with the addition of
the ability to pass a context and additional request options.
See CreateApplicationPresignedUrl 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 *KinesisAnalyticsV2) CreateApplicationPresignedUrlWithContext(ctx aws.Context, input *CreateApplicationPresignedUrlInput, opts ...request.Option) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *KinesisAnalyticsV2) CreateApplicationPresignedUrl(input *CreateApplicationPresignedUrlInput) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
return out, req.Send()
} | 0.747467 | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | Apache-2.0 | go |
CreateApplicationPresignedUrlWithContext is the same as CreateApplicationPresignedUrl with the addition of
the ability to pass a context and additional request options.
See CreateApplicationPresignedUrl 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 *KinesisAnalyticsV2) CreateApplicationPresignedUrlWithContext(ctx aws.Context, input *CreateApplicationPresignedUrlInput, opts ...request.Option) (*CreateApplicationPresignedUrlOutput, error) {
req, out := c.CreateApplicationPresignedUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | func (c *SageMaker) CreatePresignedNotebookInstanceUrlWithContext(ctx aws.Context, input *CreatePresignedNotebookInstanceUrlInput, opts ...request.Option) (*CreatePresignedNotebookInstanceUrlOutput, error) {
req, out := c.CreatePresignedNotebookInstanceUrlRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.747196 | aws/aws-sdk-go | service/kinesisanalyticsv2/api.go | aws/aws-sdk-go | service/sagemaker/api.go | Apache-2.0 | go |
ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the
client's request for the ListFunctionDefinitions 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 ListFunctionDefinitions for more information on using the ListFunctionDefinitions
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 ListFunctionDefinitionsRequest method.
req, resp := client.ListFunctionDefinitionsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions | func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) {
op := &request.Operation{
Name: opListFunctionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/functions",
}
if input == nil {
input = &ListFunctionDefinitionsInput{}
}
output = &ListFunctionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Greengrass) ListFunctionDefinitions(input *ListFunctionDefinitionsInput) (*ListFunctionDefinitionsOutput, error) {
req, out := c.ListFunctionDefinitionsRequest(input)
return out, req.Send()
} | 0.889894 | aws/aws-sdk-go | service/greengrass/api.go | aws/aws-sdk-go | service/greengrass/api.go | Apache-2.0 | go |
ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the
client's request for the ListFunctionDefinitions 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 ListFunctionDefinitions for more information on using the ListFunctionDefinitions
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 ListFunctionDefinitionsRequest method.
req, resp := client.ListFunctionDefinitionsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions | func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) {
op := &request.Operation{
Name: opListFunctionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/functions",
}
if input == nil {
input = &ListFunctionDefinitionsInput{}
}
output = &ListFunctionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Greengrass) ListFunctionDefinitionsWithContext(ctx aws.Context, input *ListFunctionDefinitionsInput, opts ...request.Option) (*ListFunctionDefinitionsOutput, error) {
req, out := c.ListFunctionDefinitionsRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
} | 0.846665 | aws/aws-sdk-go | service/greengrass/api.go | aws/aws-sdk-go | service/greengrass/api.go | Apache-2.0 | go |
ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the
client's request for the ListFunctionDefinitions 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 ListFunctionDefinitions for more information on using the ListFunctionDefinitions
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 ListFunctionDefinitionsRequest method.
req, resp := client.ListFunctionDefinitionsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions | func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) {
op := &request.Operation{
Name: opListFunctionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/functions",
}
if input == nil {
input = &ListFunctionDefinitionsInput{}
}
output = &ListFunctionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Greengrass) ListSubscriptionDefinitionsRequest(input *ListSubscriptionDefinitionsInput) (req *request.Request, output *ListSubscriptionDefinitionsOutput) {
op := &request.Operation{
Name: opListSubscriptionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/subscriptions",
}
if input == nil {
input = &ListSubscriptionDefinitionsInput{}
}
output = &ListSubscriptionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.7998 | aws/aws-sdk-go | service/greengrass/api.go | aws/aws-sdk-go | service/greengrass/api.go | Apache-2.0 | go |
ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the
client's request for the ListFunctionDefinitions 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 ListFunctionDefinitions for more information on using the ListFunctionDefinitions
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 ListFunctionDefinitionsRequest method.
req, resp := client.ListFunctionDefinitionsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions | func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) {
op := &request.Operation{
Name: opListFunctionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/functions",
}
if input == nil {
input = &ListFunctionDefinitionsInput{}
}
output = &ListFunctionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Greengrass) ListLoggerDefinitionsRequest(input *ListLoggerDefinitionsInput) (req *request.Request, output *ListLoggerDefinitionsOutput) {
op := &request.Operation{
Name: opListLoggerDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/loggers",
}
if input == nil {
input = &ListLoggerDefinitionsInput{}
}
output = &ListLoggerDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.788215 | aws/aws-sdk-go | service/greengrass/api.go | aws/aws-sdk-go | service/greengrass/api.go | Apache-2.0 | go |
ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the
client's request for the ListFunctionDefinitions 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 ListFunctionDefinitions for more information on using the ListFunctionDefinitions
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 ListFunctionDefinitionsRequest method.
req, resp := client.ListFunctionDefinitionsRequest(params)
err := req.Send()
if err == nil { // resp is now filled
fmt.Println(resp)
}
See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions | func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) {
op := &request.Operation{
Name: opListFunctionDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/functions",
}
if input == nil {
input = &ListFunctionDefinitionsInput{}
}
output = &ListFunctionDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | func (c *Greengrass) ListConnectorDefinitionsRequest(input *ListConnectorDefinitionsInput) (req *request.Request, output *ListConnectorDefinitionsOutput) {
op := &request.Operation{
Name: opListConnectorDefinitions,
HTTPMethod: "GET",
HTTPPath: "/greengrass/definition/connectors",
}
if input == nil {
input = &ListConnectorDefinitionsInput{}
}
output = &ListConnectorDefinitionsOutput{}
req = c.newRequest(op, input, output)
return
} | 0.786939 | aws/aws-sdk-go | service/greengrass/api.go | aws/aws-sdk-go | service/greengrass/api.go | Apache-2.0 | go |
NewCModes returns a new CModes reference. channelModes and userPrefixes
would be something you see from the server's "CHANMODES" and "PREFIX"
ISUPPORT capability messages (alternatively, fall back to the standard)
DefaultPrefixes and ModeDefaults. | func NewCModes(channelModes, userPrefixes string) CModes {
split := strings.SplitN(channelModes, ",", 4)
if len(split) != 4 {
for i := len(split); i < 4; i++ {
split = append(split, "")
}
}
return CModes{
raw: channelModes,
modesListArgs: split[0],
modesArgs: split[1],
modesSetArgs: split[2],
modesNoArgs: split[3],
prefixes: userPrefixes,
modes: []CMode{},
}
} | func (s *state) userPrefixes() string {
if prefix, ok := s.serverOptions["PREFIX"]; ok && isValidUserPrefix(prefix) {
return prefix
}
return DefaultPrefixes
} | 0.519977 | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | Apache-2.0 | go |
NewCModes returns a new CModes reference. channelModes and userPrefixes
would be something you see from the server's "CHANMODES" and "PREFIX"
ISUPPORT capability messages (alternatively, fall back to the standard)
DefaultPrefixes and ModeDefaults. | func NewCModes(channelModes, userPrefixes string) CModes {
split := strings.SplitN(channelModes, ",", 4)
if len(split) != 4 {
for i := len(split); i < 4; i++ {
split = append(split, "")
}
}
return CModes{
raw: channelModes,
modesListArgs: split[0],
modesArgs: split[1],
modesSetArgs: split[2],
modesNoArgs: split[3],
prefixes: userPrefixes,
modes: []CMode{},
}
} | func NewDefaultChannelProtocols(channels []ChannelType) map[string]ChannelProtocolConfig {
return map[string]ChannelProtocolConfig{
"": {Binary: true, Channels: channels},
ChannelWebSocketProtocol: {Binary: true, Channels: channels},
Base64ChannelWebSocketProtocol: {Binary: false, Channels: channels},
}
} | 0.455844 | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | Mirantis/cri-dockerd | vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go | Apache-2.0 | go |
NewCModes returns a new CModes reference. channelModes and userPrefixes
would be something you see from the server's "CHANMODES" and "PREFIX"
ISUPPORT capability messages (alternatively, fall back to the standard)
DefaultPrefixes and ModeDefaults. | func NewCModes(channelModes, userPrefixes string) CModes {
split := strings.SplitN(channelModes, ",", 4)
if len(split) != 4 {
for i := len(split); i < 4; i++ {
split = append(split, "")
}
}
return CModes{
raw: channelModes,
modesListArgs: split[0],
modesArgs: split[1],
modesSetArgs: split[2],
modesNoArgs: split[3],
prefixes: userPrefixes,
modes: []CMode{},
}
} | func NewPolicy(config *Config, bkc BlockedKeyCheckFunc) (KeyPolicy, error) {
if config == nil {
config = &Config{}
}
kp := KeyPolicy{
blockedCheck: bkc,
}
if config.AllowedKeys == nil {
kp.allowedKeys = LetsEncryptCPS()
} else {
kp.allowedKeys = *config.AllowedKeys
}
if config.WeakKeyFile != "" {
keyList, err := LoadWeakRSASuffixes(config.WeakKeyFile)
if err != nil {
return KeyPolicy{}, err
}
kp.weakRSAList = keyList
}
if config.BlockedKeyFile != "" {
blocked, err := loadBlockedKeysList(config.BlockedKeyFile)
if err != nil {
return KeyPolicy{}, err
}
kp.blockedList = blocked
}
if config.FermatRounds < 0 {
return KeyPolicy{}, fmt.Errorf("Fermat factorization rounds cannot be negative: %d", config.FermatRounds)
}
kp.fermatRounds = config.FermatRounds
return kp, nil
} | 0.446621 | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | tektoncd/cli | vendor/github.com/letsencrypt/boulder/goodkey/good_key.go | Apache-2.0 | go |
NewCModes returns a new CModes reference. channelModes and userPrefixes
would be something you see from the server's "CHANMODES" and "PREFIX"
ISUPPORT capability messages (alternatively, fall back to the standard)
DefaultPrefixes and ModeDefaults. | func NewCModes(channelModes, userPrefixes string) CModes {
split := strings.SplitN(channelModes, ",", 4)
if len(split) != 4 {
for i := len(split); i < 4; i++ {
split = append(split, "")
}
}
return CModes{
raw: channelModes,
modesListArgs: split[0],
modesArgs: split[1],
modesSetArgs: split[2],
modesNoArgs: split[3],
prefixes: userPrefixes,
modes: []CMode{},
}
} | func NewConn(protocols map[string]ChannelProtocolConfig) *Conn {
return &Conn{
ready: make(chan struct{}),
protocols: protocols,
}
} | 0.444815 | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | Mirantis/cri-dockerd | vendor/k8s.io/apimachinery/pkg/util/httpstream/wsstream/conn.go | Apache-2.0 | go |
NewCModes returns a new CModes reference. channelModes and userPrefixes
would be something you see from the server's "CHANMODES" and "PREFIX"
ISUPPORT capability messages (alternatively, fall back to the standard)
DefaultPrefixes and ModeDefaults. | func NewCModes(channelModes, userPrefixes string) CModes {
split := strings.SplitN(channelModes, ",", 4)
if len(split) != 4 {
for i := len(split); i < 4; i++ {
split = append(split, "")
}
}
return CModes{
raw: channelModes,
modesListArgs: split[0],
modesArgs: split[1],
modesSetArgs: split[2],
modesNoArgs: split[3],
prefixes: userPrefixes,
modes: []CMode{},
}
} | func newAuthority(args authorityBuildOptions) *authority {
ctx, cancel := context.WithCancel(context.Background())
l := grpclog.Component("xds")
logPrefix := args.logPrefix + fmt.Sprintf("[authority %q] ", args.name)
ret := &authority{
name: args.name,
watcherCallbackSerializer: args.serializer,
getChannelForADS: args.getChannelForADS,
xdsClientSerializer: grpcsync.NewCallbackSerializer(ctx),
xdsClientSerializerClose: cancel,
logger: igrpclog.NewPrefixLogger(l, logPrefix),
resources: make(map[xdsresource.Type]map[string]*resourceState),
}
// Create an ordered list of xdsChannels with their server configs. The
// actual channel to the first server configuration is created when the
// first watch is registered, and channels to other server configurations
// are created as needed to support fallback.
for _, sc := range args.serverConfigs {
ret.xdsChannelConfigs = append(ret.xdsChannelConfigs, &xdsChannelWithConfig{serverConfig: sc})
}
return ret
} | 0.443693 | 42wim/matterbridge | vendor/github.com/lrstanley/girc/modes.go | tektoncd/cli | vendor/google.golang.org/grpc/xds/internal/xdsclient/authority.go | Apache-2.0 | go |
OnUnsupportedChannel is called when a new channel is requested of an unsupported type. This gives the implementer
the ability to log unsupported channel requests.
channelID is an ID uniquely identifying the channel within the connection.
channelType is the type of channel requested by the client. We only support the "session" channel type
extraData contains the binary extra data submitted by the client. This is usually empty. | func (a *AbstractSSHConnectionHandler) OnUnsupportedChannel(_ uint64, _ string, _ []byte) {} | func (a *AbstractSessionChannelHandler) OnUnsupportedChannelRequest(
_ uint64,
_ string,
_ []byte,
) {
} | 0.649566 | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSessionChannelHandler.go | Apache-2.0 | go |
OnUnsupportedChannel is called when a new channel is requested of an unsupported type. This gives the implementer
the ability to log unsupported channel requests.
channelID is an ID uniquely identifying the channel within the connection.
channelType is the type of channel requested by the client. We only support the "session" channel type
extraData contains the binary extra data submitted by the client. This is usually empty. | func (a *AbstractSSHConnectionHandler) OnUnsupportedChannel(_ uint64, _ string, _ []byte) {} | func (a *AbstractSSHConnectionHandler) OnSessionChannel(_ metadata.ChannelMetadata, _ []byte, _ SessionChannel) (
channel SessionChannelHandler, failureReason ChannelRejection,
) {
return nil, NewChannelRejection(
ssh.UnknownChannelType,
messageCodes.ESSHNotImplemented,
"Cannot open session channel.",
"Session channels are currently not implemented",
)
} | 0.580103 | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | Apache-2.0 | go |
OnUnsupportedChannel is called when a new channel is requested of an unsupported type. This gives the implementer
the ability to log unsupported channel requests.
channelID is an ID uniquely identifying the channel within the connection.
channelType is the type of channel requested by the client. We only support the "session" channel type
extraData contains the binary extra data submitted by the client. This is usually empty. | func (a *AbstractSSHConnectionHandler) OnUnsupportedChannel(_ uint64, _ string, _ []byte) {} | func (c *IoTAnalytics) CreateChannel(input *CreateChannelInput) (*CreateChannelOutput, error) {
req, out := c.CreateChannelRequest(input)
return out, req.Send()
} | 0.510463 | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | aws/aws-sdk-go | service/iotanalytics/api.go | Apache-2.0 | go |
OnUnsupportedChannel is called when a new channel is requested of an unsupported type. This gives the implementer
the ability to log unsupported channel requests.
channelID is an ID uniquely identifying the channel within the connection.
channelType is the type of channel requested by the client. We only support the "session" channel type
extraData contains the binary extra data submitted by the client. This is usually empty. | func (a *AbstractSSHConnectionHandler) OnUnsupportedChannel(_ uint64, _ string, _ []byte) {} | func (k Keeper) OnCloseChannel(
ctx sdk.Context,
contractAddr sdk.AccAddress,
msg wasmvmtypes.IBCChannelCloseMsg,
) error {
defer telemetry.MeasureSince(time.Now(), "wasm", "contract", "ibc-close-channel")
contractInfo, codeInfo, prefixStore, err := k.contractInstance(ctx, contractAddr)
if err != nil {
return err
}
params := types.NewEnv(ctx, contractAddr)
querier := k.newQueryHandler(ctx, contractAddr)
gasLeft := k.runtimeGasForContract(ctx)
res, gasUsed, execErr := k.wasmVM.IBCChannelClose(codeInfo.CodeHash, params, msg, prefixStore, cosmwasmAPI, querier, ctx.GasMeter(), gasLeft, costJSONDeserialization)
k.consumeRuntimeGas(ctx, gasUsed)
if execErr != nil {
return errorsmod.Wrap(types.ErrExecuteFailed, execErr.Error())
}
if res == nil {
// If this gets executed, that's a bug in wasmvm
return errorsmod.Wrap(types.ErrVMError, "internal wasmvm error")
}
if res.Err != "" {
return types.MarkErrorDeterministic(errorsmod.Wrap(types.ErrExecuteFailed, res.Err))
}
return k.handleIBCBasicContractResponse(ctx, contractAddr, contractInfo.IBCPortID, res.Ok)
} | 0.494503 | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | CosmWasm/wasmd | x/wasm/keeper/relay.go | Apache-2.0 | go |
OnUnsupportedChannel is called when a new channel is requested of an unsupported type. This gives the implementer
the ability to log unsupported channel requests.
channelID is an ID uniquely identifying the channel within the connection.
channelType is the type of channel requested by the client. We only support the "session" channel type
extraData contains the binary extra data submitted by the client. This is usually empty. | func (a *AbstractSSHConnectionHandler) OnUnsupportedChannel(_ uint64, _ string, _ []byte) {} | func (r *Runtime) EventChannel() chan *Event {
if r.eventChannel != nil {
return r.eventChannel
}
r.eventChannel = make(chan *Event, 100)
return r.eventChannel
} | 0.491231 | ContainerSSH/ContainerSSH | internal/sshserver/AbstractSSHConnectionHandler.go | containers/podman-tui | vendor/github.com/containers/common/libimage/runtime.go | Apache-2.0 | go |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.