anchor stringlengths 10 14.3k | positive stringlengths 10 14.9k |
|---|---|
getVolunteers only for reporter | func getVolunteers(c *gin.Context) {
var vols []Volunteer
//Read volunteers from database
if err := db.Find(&vols).Error; err != nil {
createNotFoundResponse(c)
return
}
//Authorization if user is reporter
if !reporterAuth(c) {
return
}
c.JSON(200, vols)
} |
getFileSystemPackagePath returns a string that represents the package files cache path. In some cases when the path isn't represented by the package name, instead the name represents a specific project's directory's path. In this case we will scan the path until we find the package directory. | func getFileSystemPackagePath(packageCachePath, name, version string) (string, error) {
separator := string(filepath.Separator)
// For Windows OS
path := filepath.Join(name)
for path != "" {
packagePath := filepath.Join(packageCachePath, path+"@"+version)
exists, err := fileutils.IsDirExists(packagePath, false)... |
function to delete collector | func deleteCollector(d *schema.ResourceData, m interface{}) error {
client := m.(*lmclient.LMSdkGo)
// get collector id
id, err := strconv.Atoi(d.Id())
if err != nil {
return err
}
params := lm.NewDeleteCollectorByIDParams()
params.SetID(int32(id))
restCollectorResponse, err := client.LM.DeleteCollectorByI... |
JoinToMaxLength takes a string slice and joins it on sep until the joined string cannot be made larger without crossing maxLength length. If any entry in the slice to be joined is larger than maxLength, it will be added on its own to an entry in the resulting slice | func JoinToMaxLength(toJoin []string, sep string, maxLength int) []string {
var out []string
curBuilder := strings.Builder{}
curBuilder.Grow(maxLength)
for _, s := range toJoin {
entryLen := len(s)
if curBuilder.Len() == 0 && entryLen > maxLength {
out = append(out, s)
continue
}
if curBuilder.Len(... |
configureWellKnown enables and configures /.wellknown endpoints. | func (r *Routes) configureWellKnown(healthFunc func() bool) {
wellKnown := r.Group("/.well-known")
{
wellKnown.GET("/schema-discovery", func(ctx *gin.Context) {
discovery := struct {
SchemaURL string `json:"schema_url"`
SchemaType string `json:"schema_type"`
UIURL string `json:"ui_url"`
}{
... |
VerifyWithdrawal will verify a withdrawal given the verification token | func (as *AddressService) VerifyWithdrawal(token string) error {
if err := as.client.Get(buildString("address/withdraw/verify/", token), nil); err != nil {
return err
}
return nil
} |
SetDefaults hydrates default values in the query roles params (not the query body). All values with no default are reset to their zero value. | func (o *QueryRolesParams) SetDefaults() {
var (
limitDefault = int64(10)
offsetDefault = int64(0)
sortDefault = string("last_modified_timestamp|desc")
)
val := QueryRolesParams{
Limit: &limitDefault,
Offset: &offsetDefault,
Sort: &sortDefault,
}
val.timeout = o.timeout
val.Context = o.Context
... |
CenterEntityInSurface centers an entity within a surface | func CenterEntityInSurface(entity *Entity, surface *sdl.Surface) {
entity.X = (surface.W - entity.W) / 2
} |
Create creates a new user. TODO: Verify email address is valid form | func (r mysqlUserRepository) Create(email string) (domain.User, error) {
user := domain.User{Email: email}
err := r.db.Create(&user).Error
if err != nil && strings.Contains(err.Error(), "Duplicate entry") {
return domain.User{}, db.DuplicateError{}
}
return user, err
} |
Layout clips to the dimensions of the selectable, updates the shaped text, configures input handling, and paints the text and selection rectangles. The provided textMaterial and selectionMaterial ops are used to set the paint material for the text and selection rectangles, respectively. | func (l *Selectable) Layout(gtx layout.Context, lt *text.Shaper, font font.Font, size unit.Sp, textMaterial, selectionMaterial op.CallOp) layout.Dimensions {
l.initialize()
l.text.LineHeight = l.LineHeight
l.text.LineHeightScale = l.LineHeightScale
l.text.Alignment = l.Alignment
l.text.MaxLines = l.MaxLines
l.tex... |
Delete will remove the entity from the database. | func (entity *MilitaryForeign) Delete(context *pg.DB, account int64) (int, error) {
entity.AccountID = account
options := &orm.CreateTableOptions{
Temp: false,
IfNotExists: true,
}
var err error
if err = context.CreateTable(&MilitaryForeign{}, options); err != nil {
return entity.ID, err
}
if _, ... |
readCombinationOperator Bit 3 4 | func (p *PageInformationSegment) readCombinationOperator() error {
b, err := p.r.ReadBits(2)
if err != nil {
return err
}
p.combinationOperator = bitmap.CombinationOperator(int(b))
return nil
} |
GetAutomation mocks base method. | func (m *Client) GetAutomation(arg0 context.Context, arg1 int64) (zendesk.Automation, error) {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "GetAutomation", arg0, arg1)
ret0, _ := ret[0].(zendesk.Automation)
ret1, _ := ret[1].(error)
return ret0, ret1
} |
Glusterfs represents a Glusterfs mount on the host that shares a pod's lifetime. More info: | func (o IopingSpecVolumeVolumeSourcePtrOutput) Glusterfs() IopingSpecVolumeVolumeSourceGlusterfsPtrOutput {
return o.ApplyT(func(v *IopingSpecVolumeVolumeSource) *IopingSpecVolumeVolumeSourceGlusterfs {
if v == nil {
return nil
}
return v.Glusterfs
}).(IopingSpecVolumeVolumeSourceGlusterfsPtrOutput)
} |
Deprecated: Use Request.ProtoReflect.Descriptor instead. | func (*Request) Descriptor() ([]byte, []int) {
return file_ocis_messages_policies_v0_policies_proto_rawDescGZIP(), []int{2}
} |
Delete removes a gateway or listener of gateway from an app. | func Delete(c *drycc.Client, appID string, name string, port int, protocol string) error {
u := fmt.Sprintf("/v2/apps/%s/gateways/", appID)
req := api.GatewayRemoveRequest{Name: name, Port: port, Protocol: protocol}
body, err := json.Marshal(req)
if err != nil {
return err
}
res, err := c.Request("DELETE", ... |
Affinity is a group of affinity scheduling rules. | func (o QperfSpecServerConfigurationPodSchedulingPtrOutput) Affinity() QperfSpecServerConfigurationPodSchedulingAffinityPtrOutput {
return o.ApplyT(func(v *QperfSpecServerConfigurationPodScheduling) *QperfSpecServerConfigurationPodSchedulingAffinity {
if v == nil {
return nil
}
return v.Affinity
}).(QperfSpe... |
The name of the storage system as configured in ScaleIO. | func (o FioSpecVolumeVolumeSourceScaleIOPtrOutput) System() pulumi.StringPtrOutput {
return o.ApplyT(func(v *FioSpecVolumeVolumeSourceScaleIO) *string {
if v == nil {
return nil
}
return &v.System
}).(pulumi.StringPtrOutput)
} |
ReadOnly here will force the Quobyte volume to be mounted with readonly permissions. Defaults to false. | func (o IopingSpecVolumeVolumeSourceQuobyteOutput) ReadOnly() pulumi.BoolPtrOutput {
return o.ApplyT(func(v IopingSpecVolumeVolumeSourceQuobyte) *bool { return v.ReadOnly }).(pulumi.BoolPtrOutput)
} |
Top gives the topmost item of the stack | func (s *LinkedStack) Top() (interface{}, error) {
if s.topPtr == nil {
return nil, errors.New("Stack is Empty")
}
return s.topPtr.item, nil
} |
set block times with ttl for ns/alarmVersion/host. | func (b *block) setBlockTimes(ns, alarmVersion, hostname, tagString string, times, timesTTL int) error {
return b.c.SetWithTTL(
BlockTimesKey(ns, alarmVersion, hostname, tagString),
strconv.Itoa(int(times)),
time.Duration(timesTTL)*time.Minute+10*time.Second)
} |
DeliveryRuleRequestMethodConditionGenerator returns a generator of DeliveryRuleRequestMethodCondition instances for property testing. We first initialize deliveryRuleRequestMethodConditionGenerator with a simplified generator based on the fields with primitive types then replacing it with a more complex one that also h... | func DeliveryRuleRequestMethodConditionGenerator() gopter.Gen {
if deliveryRuleRequestMethodConditionGenerator != nil {
return deliveryRuleRequestMethodConditionGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForDeliveryRuleRequestMethodCondition(generators)
deliveryRuleReq... |
GetVolumeSize returns the actual and maximum size of the volume plus a DiskType and a DirtyFlag | func GetVolumeSize(log *base.LogObject, name string) (uint64, uint64, string, bool, error) {
info, err := os.Stat(name)
if err != nil {
errStr := fmt.Sprintf("GetVolumeSize failed for %s: %v",
name, err)
return 0, 0, "", false, errors.New(errStr)
}
if info.IsDir() {
// Assume this is a container
size, er... |
MarshalEasyJSON supports easyjson.Marshaler interface | func (v PlantainerShadowStateSt) MarshalEasyJSON(w *jwriter.Writer) {
easyjson5bd79fa1EncodeMevericcoreMcplantainer3(w, v)
} |
NewProductFromDownloader takes a downloader and builds a Product struct | func NewProductFromDownloader(dl downloader.Downloader, url string) (*Product, error) {
// Fetch the URL
content, err := dl.Download(url)
if err != nil {
return nil, err
}
// Parse the product
parser := new(parser.ProductParser)
results := parser.Parse(content.Data)
// Convert price to float
unit_price := ... |
Create a flag set with flags common to most commands. | func (c *Command) DefaultFlagSet(cn string) *flag.FlagSet {
f := flag.NewFlagSet(cn, flag.ExitOnError)
f.StringVar(&c.workingDirFlag, "workingdir", "", "Working Directory. Defaults to current working directory.")
f.StringVar(&c.projectOutFile, "projectout", "", "Where to save the project (json protobuf).")
f.String... |
Wrapper for returing precondition failure status from missing checkout/input root digest | func getCheckoutMissingStatus(snapshotID string) (*google_rpc_status.Status, error) {
inputRoot, err := bazel.DigestFromSnapshotID(snapshotID)
if err != nil {
return nil, fmt.Errorf("Failed to convert SnapshotID %s to Digest: %s", snapshotID, err)
}
return getFailedPreconditionStatus([]*remoteexecution.Digest{inp... |
NewServeBuildTypesInProjectParamsWithHTTPClient creates a new ServeBuildTypesInProjectParams object with the default values initialized, and the ability to set a custom HTTPClient for a request | func NewServeBuildTypesInProjectParamsWithHTTPClient(client *http.Client) *ServeBuildTypesInProjectParams {
var ()
return &ServeBuildTypesInProjectParams{
HTTPClient: client,
}
} |
Nil asserts that the v is nil. assert.Nil(t, err, "err should be nothing") Returns whether the assertion was successful (true) or not (false). | func Nil(t Testing, v interface{}, formatAndArgs ...interface{}) bool {
if isNil(v) {
return true
}
return Fail(t, pretty.Sprintf("Expected to be nil, but got: %# v", v), formatAndArgs...)
} |
NewEndpointResource creates an instance of EndpointResource from the given Endpointer. | func NewEndpointResource(e Endpointer) EndpointResource {
return EndpointResource{
Resource: "endpoint",
Name: e.GetName(),
Path: e.GetPath(),
MethodsList: GetMethodsList(e),
Methods: GetMethods(e),
MediaTypesList: GetContentTypesList(hAPI, e),
MediaTypes: GetConte... |
Deprecated: Use CreateVacancyV1Response.ProtoReflect.Descriptor instead. | func (*CreateVacancyV1Response) Descriptor() ([]byte, []int) {
return file_api_ocp_vacancy_api_ocp_vacancy_api_proto_rawDescGZIP(), []int{2}
} |
ThisFunction returns calling function name | func ThisFunction() string {
var pc [32]uintptr
runtime.Callers(2, pc[:])
return runtime.FuncForPC(pc[0]).Name()
} |
GetType returns the value of the "type" field in the mutation. | func (m *ResourceMutation) GetType() (r string, exists bool) {
v := m._type
if v == nil {
return
}
return *v, true
} |
User to map volume access to Defaults to serivceaccount user | func (o IopingSpecVolumeVolumeSourceQuobyteOutput) User() pulumi.StringPtrOutput {
return o.ApplyT(func(v IopingSpecVolumeVolumeSourceQuobyte) *string { return v.User }).(pulumi.StringPtrOutput)
} |
AddGetRecordsTimeout records the number of times the GetRecords API timed out on the HTTP level. This is influenced by the WithHTTPClientTimeout configuration. | func (dsc *DefaultConsumerStatsCollector) AddGetRecordsTimeout(count int) {
dsc.GetRecordsTimeout.Inc(int64(count))
} |
MarshalEasyJSON supports easyjson.Marshaler interface | func (v GetCharactersCharacterIdClonesOk) MarshalEasyJSON(w *jwriter.Writer) {
easyjson13ace497EncodeGithubComAntihaxGoesiEsi1(w, v)
} |
GetName returns the Name field value | func (o *Project) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
} |
New builds the Shoe from decks of Cards and then shuffles it | func New(decks int, shuffles int) *Shoe {
var ret Shoe
for i := 0; i < decks; i++ {
ret.addDeck()
}
for i := 0; i < shuffles; i++ {
ret.Shuffle()
}
return &ret
} |
Reconcile updates ClientConfigs of MutatingWebhookConfigurations to contain the CABundle from the respective Istio SA secret | func (r *reconciler) Reconcile(request reconcile.Request) (reconcile.Result, error) {
logger := log.WithValues("WebhookConfig", request.Name)
logger.Info("reconciling MutatingWebhookConfiguration")
// get current webhook config
currentConfig := &v1beta1.MutatingWebhookConfiguration{}
err := r.Client.Get(context.TO... |
DeliveryRuleClientPortCondition_STATUSGenerator returns a generator of DeliveryRuleClientPortCondition_STATUS instances for property testing. We first initialize deliveryRuleClientPortCondition_STATUSGenerator with a simplified generator based on the fields with primitive types then replacing it with a more complex one... | func DeliveryRuleClientPortCondition_STATUSGenerator() gopter.Gen {
if deliveryRuleClientPortCondition_STATUSGenerator != nil {
return deliveryRuleClientPortCondition_STATUSGenerator
}
generators := make(map[string]gopter.Gen)
AddIndependentPropertyGeneratorsForDeliveryRuleClientPortCondition_STATUS(generators)
... |
NewStorageConfig loads storage configuration for a S3 FileSystem service in the given namespace. If no storage config is found in that namespace, the koaljasystem namespace is used. +kubebuilder:rbac:groups=,resources=configmaps,verbs=get;list;watch | func NewStorageConfig(ctx context.Context, c client.Reader, ns string) (*StorageConfig, error) {
var configMap corev1.ConfigMap
key := client.ObjectKey{
Name: constants.ConfigMapS3Storage,
Namespace: ns,
}
if err := c.Get(ctx, key, &configMap); errors.IsNotFound(err) {
// Try koalja-system namespace
ke... |
The rados user name. Default is admin. More info: | func (o IopingSpecVolumeVolumeSourceRbdOutput) User() pulumi.StringPtrOutput {
return o.ApplyT(func(v IopingSpecVolumeVolumeSourceRbd) *string { return v.User }).(pulumi.StringPtrOutput)
} |
(Output) URI of the Service deployed. | func (o FunctionServiceConfigOutput) Uri() pulumi.StringPtrOutput {
return o.ApplyT(func(v FunctionServiceConfig) *string { return v.Uri }).(pulumi.StringPtrOutput)
} |
doTest runs a test, which involves generating the packet, sending it in the specified interface, then comparing any packets coming from the border router against the expected packets from the test. It returns true if the test was successful, ie. all expected packets and no others were received, otherwise it returns fal... | func doTest(t *BRTest, cases []reflect.SelectCase) error {
devInfo, ok := devByName[t.In.Dev]
if !ok {
return fmt.Errorf("No device information for: %s\n", t.In.Dev)
}
raw, err := t.In.Pack(devInfo.mac)
if err != nil {
return err
}
err = devInfo.handle.WritePacketData(raw)
if err != nil {
return err
}
r... |
Helper function for ComputeClassLoaderContext() that handles recursion. | func computeClassLoaderContextRec(clcs []*ClassLoaderContext) (string, string, android.Paths) {
var paths android.Paths
var clcsHost, clcsTarget []string
for _, clc := range clcs {
subClcHost, subClcTarget, subPaths := computeClassLoaderContextRec(clc.Subcontexts)
if subPaths != nil {
subClcHost = "{" + subC... |
ActiveUsers returns the current set of active users for the current timestamp. It is only valid until the following Next() call and should not be modified. | func (u *UserCalculator) ActiveUsers() []string { return u.active } |
Display nodes for testing purposes | func (s *stack) Display() {
for i := int32(0); i < s.getCount(); i++ {
fmt.Printf("NODE IN STACK: %+v %p \n", s.nodes[i], s.nodes[i])
}
fmt.Println("TOTAL COUNT:", s.getCount())
} |
AbbrevName2 third way to do it | func AbbrevName2(name string) string {
var parts []string
for _, part := range strings.Split(name, " ") {
parts = append(parts, strings.ToUpper(part[:1]))
}
return strings.Join(parts, ".")
} |
ConfigureLogging will setup the glg logging package with the correct file destination coloring, etc. as desired for the entire application. | func ConfigureLogging(level string, logPath string) {
if logPath != "" {
infolog = glg.FileWriter(logPath, 0644)
glg.Get().AddWriter(infolog)
}
glg.Get().
SetMode(glg.BOTH).
EnableColor().
SetLevelMode(glg.LOG, glg.NONE)
// Map the config log level value to an internal representation that is easier
//... |
UpdateAll updates all rows with the specified column values, using an executor. | func (o PeerSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {
ln := int64(len(o))
if ln == 0 {
return 0, nil
}
if len(cols) == 0 {
return 0, errors.New("model: update all requires at least one column argument")
}
colNames := make([]string, len(cols))
args := make([]i... |
WaitForPodSucceeded waits until the Pod status is Succeeded. | func WaitForPodSucceeded(ctx context.Context, pods corev1.PodInterface, podName string, timeout time.Duration) error {
log.Entry(ctx).Infof("Waiting for %s to be complete", podName)
w, err := pods.Watch(ctx, metav1.ListOptions{})
if err != nil {
return fmt.Errorf("initializing pod watcher: %s", err)
}
defer w.S... |
TestExecute feeds input to the CLI and validates results. scan() is implicitly tested here. | func TestExecute(t *testing.T) {
fmt.Println("TestExecute start")
var inputSource *bytes.Buffer
ipTest := []IPTest{
{"127.0.0.1", "9999", 1, 1},
{"8.8.8.8", "443", 1, 0},
{"::1", "9999", 1, 1},
{"127.0.0.1 ::1", "9999", 2, 2}}
for _, v := range ipTest {
inputSource = bytes.NewBuffer([]byte(fmt.Sprintf("se... |
MakeEndpointNodeID produces an endpoint node ID from its composite parts. | func MakeEndpointNodeID(hostID, address, port string) string {
return lookupID(hostID, address, port, func() string {
return MakeAddressNodeID(hostID, address) + ScopeDelim + port
})
} |
Generates an Authenticate mock function which will return (authenticate, err) | func authenticateGenerator(authenticate bool, err error) func(r *http.Request) (bool, error) {
return func(r *http.Request) (bool, error) {
return authenticate, err
}
} |
log writes to the io.Writer defined by Logger or standard out if Logger is not set. All input values are prefixed with "redicrypt: ". | func (rc *RediCrypt) log(input string) {
if input == "" {
return
}
output := fmt.Sprintf("redicrypt: %s", input)
if rc == nil || rc.Logger == nil {
fmt.Println(output)
return
}
rc.Logger.Write([]byte(output))
} |
Remove any values which match the specified regular expression from the PATH environment variable | func removePath(regexValue string) {
regex, _ := regexp.Compile(regexValue)
newPath := regex.ReplaceAllString(getPath(), "")
setPath(newPath)
} |
loadRates loads rate codes from JSON file. | func loadRateTable(path string) map[stay]*rate.RatePlan {
file := data.MustAsset("data/rates.json")
rates := []*rate.RatePlan{}
if err := json.Unmarshal(file, &rates); err != nil {
log.Fatalf("Failed to load json: %v", err)
}
rateTable := make(map[stay]*rate.RatePlan)
for _, ratePlan := range rates {
stay :... |
/ NewTransaction() To return new transaction data | func NewTransaction(eventType string, consumerName string, consumerId string, consumerAddress string, consumerRequire string,
consumerCharge string, consumerDischargeRate string, buyRate string, requireEventId string, supplierName string, supplierId string,
supplierAddress string, supplierToSupply string, supplierSup... |
ProfileHandler is a handler to serve up user profile data from the database | func ProfileHandler(c buffalo.Context) error {
user := models.User{}
db := c.Value("tx").(*pop.Connection)
db.Find(&user, c.Param("uid"))
return c.Render(200, r.JSON(user))
} |
Validate checks the field values on StreamAccessLogsMessage_HTTPAccessLogEntries with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations. | func (m *StreamAccessLogsMessage_HTTPAccessLogEntries) Validate() error {
return m.validate(false)
} |
Deserialize reads a DestReply from the buffer and returns the remaining buffer. | func (f *DestReply) Deserialize(buffer []byte, err *error) []byte {
if *err != nil {
return nil
}
if len(buffer) != 4 {
*err = errDeserialize
return nil
}
return buffer
} |
KhanhTNG SetReceived returns the state to issued | func (cp *CustomerOrder) SetReceived() {
cp.state = RECEIVED
// Add some new value
//cp.Owner = ''
cp.ReceivedDate = time.Now()
} |
New create a new format marshaler/unmarshaler from name. | func New(name string) (Format, error) {
if name == "" {
return nil, NewErrFormatNameIsEmpty()
}
if synonym, ok := synonyms[name]; ok {
name = synonym
}
switch name {
case JSON:
return NewJSON(), nil
case YAML:
return NewYAML(), nil
case TOML:
return NewTOML(), nil
case HEX:
return NewHEX(), nil
... |
plateHoles2D returns 4 holes to attach the plate to the gear stack. | func plateHoles2D() (sdf.SDF2, error) {
d := 17.0
h, err := sdf.Circle2D(1.2)
if err != nil {
return nil, err
}
s0 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{d, d}))
s1 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{-d, -d}))
s2 := sdf.Transform2D(h, sdf.Translate2d(v2.Vec{-d, d}))
s3 := sdf.Transform2D(h, sd... |
SetCollections sets one or more collections. | func (m *MongoDB) SetCollections(names ...string) error {
if m.db == nil {
return fmt.Errorf("database is not configured yet")
}
for _, name := range names {
m.coll[name] = m.db.Collection(name)
}
return nil
} |
InsertOffset inserts a new offset associated with the given source application key sk. ak is the 'owner' application key. It returns false if the row already exists. | func (driver) InsertOffset(
ctx context.Context,
tx *sql.Tx,
ak, sk string,
n uint64,
) (_ bool, err error) {
defer sqlx.Recover(&err)
return sqlx.TryExecRow(
ctx,
tx,
`INSERT INTO stream_offset SET
app_key = ?,
source_app_key = ?,
next_offset = ?
ON DUPLICATE KEY UPDATE
app_key = app_key`, /... |
UnmarshalYAML satisfies the yaml.Unmarshaler interface. This is done to maintain backward compatibility of accepting a plain string value for java_package_prefix. | func (e *ExternalJavaPackagePrefixConfigV1) UnmarshalYAML(unmarshal func(interface{}) error) error {
return e.unmarshalWith(unmarshal)
} |
VisitTerminal is called when a terminal node is visited. | func (s *BaseBrainfuckListener) VisitTerminal(node antlr.TerminalNode) {} |
Insert is a function for inserting a record | func (s *Stock) Insert(stockModel model.Model) *errors.Error {
stockModelObj, ok := stockModel.(*model.Stock)
if false == ok {
return errors.Wrap(fmt.Errorf("Failed asserting to *model.Stock"), 0)
}
foundModel, _ := s.FindByID(stockModel.GetID())
if foundModel != nil {
return errors.Wrap(fmt.Errorf("cannot ins... |
GetFieldDeserializers the deserialization information for the current model | func (m *ManagementTemplateStepTenantSummary) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["assignedTenantsCount"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be145220... |
Storage Policy Based Management (SPBM) profile name. | func (o FioSpecVolumeVolumeSourceVsphereVolumePtrOutput) StoragePolicyName() pulumi.StringPtrOutput {
return o.ApplyT(func(v *FioSpecVolumeVolumeSourceVsphereVolume) *string {
if v == nil {
return nil
}
return v.StoragePolicyName
}).(pulumi.StringPtrOutput)
} |
extraHeaders may be nil waitForContinue may be nil | func write(req *http.Request, w io.Writer, usingProxy bool, extraHeaders http.Header, waitForContinue func() bool) (err error) {
trace := httptrace.ContextClientTrace(req.Context())
if trace != nil && trace.WroteRequest != nil {
defer func() {
trace.WroteRequest(httptrace.WroteRequestInfo{
Err: err,
})
... |
GetTriggers indicates an expected call of GetTriggers. | func (mr *ClientMockRecorder) GetTriggers(arg0, arg1 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTriggers", reflect.TypeOf((*Client)(nil).GetTriggers), arg0, arg1)
} |
AbsRect makes a rectangle centered at x,y within a container | func AbsRect(cont *fyne.Container, x, y, w, h int, color color.RGBA) {
fx, fy, fw, fh := float32(x), float32(y), float32(w), float32(h)
r := &canvas.Rectangle{FillColor: color}
r.Move(fyne.Position{X: fx - (fw / 2), Y: fy - (fh / 2)})
r.Resize(fyne.Size{Width: fw, Height: fh})
cont.AddObject(r)
} |
ConfigFromEndpointConfig returns identity config implementation of given endpoint config and backend | func ConfigFromEndpointConfig(endpointConfig fab.EndpointConfig, coreBackend ...core.ConfigBackend) (msp.IdentityConfig, error) {
//create identity config
config := &IdentityConfig{endpointConfig: endpointConfig,
backend: lookup.New(coreBackend...),
caMatchers: make(map[int]*regexp.Regexp)}
//compile CA mat... |
Running shows the state of execution | func (o Iperf3StatusPtrOutput) Running() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Iperf3Status) *bool {
if v == nil {
return nil
}
return &v.Running
}).(pulumi.BoolPtrOutput)
} |
DeleteRemoteBranch deletes the remote branch in the given given directory Faked out | func (g *GitLocal) DeleteRemoteBranch(dir string, remoteName string, branch string) error {
return g.GitFake.DeleteRemoteBranch(dir, remoteName, branch)
} |
this schedule a task that itself produces a promise, and returns a promise wrapping the produced promise | func scheduleAndUnwrap(scheduler scheduler, do func(ctx context.Context) (dependency, error)) promise {
completionSource := &completionSource{
done: make(chan struct{}),
}
scheduler.schedule(func(ctx context.Context) error {
p, err := do(ctx)
if err != nil {
completionSource.err = err
close(completionSou... |
GetColumnProjectCard of a specific issue or PR for a specific column in a board/project This method requires the URL of the issue/pr to compare the issue with the content_url field of the card. See | func (c *client) GetColumnProjectCard(org string, columnID int, issueURL string) (*ProjectCard, error) {
cards, err := c.GetColumnProjectCards(org, columnID)
if err != nil {
return nil, err
}
for _, card := range cards {
if card.ContentURL == issueURL {
return &card, nil
}
}
return nil, nil
} |
The syntax is command:comma,separated,args | func processCommand(id int, message string, gv *GameVariables) error {
var err error = nil
// preallocate the update group
var u UpdateGroup
u.TileUpdates = make([]Tile, 0, 16)
u.WeaponHits = make([]HitInfo, 0, 1)
u.TargetUpdates = make([]Target, 0, 1)
i := strings.Index(message, ":")
if i < 0 {
return error... |
Validate implementation of ozzovalidation Validate interface | func (code Code) Validate() error {
if _, ok := ByCodeStr(string(code)); !ok {
return fmt.Errorf("'%s' is not valid ISO-4217 code", code)
}
return nil
} |
DeliveryRuleActionGenerator returns a generator of DeliveryRuleAction instances for property testing. | func DeliveryRuleActionGenerator() gopter.Gen {
if deliveryRuleActionGenerator != nil {
return deliveryRuleActionGenerator
}
generators := make(map[string]gopter.Gen)
AddRelatedPropertyGeneratorsForDeliveryRuleAction(generators)
// handle OneOf by choosing only one field to instantiate
var gens []gopter.Gen
... |
Call dynamically executes a method in the provider associated with a component resource. | func (p *googleCloudProvider) Call(_ context.Context, _ *rpc.CallRequest) (*rpc.CallResponse, error) {
return nil, status.Error(codes.Unimplemented, "Call is not yet implemented")
} |
VolumeName is the humanreadable name of the StorageOS volume. Volume names are only unique within a namespace. | func (o IopingSpecVolumeVolumeSourceStorageosOutput) VolumeName() pulumi.StringPtrOutput {
return o.ApplyT(func(v IopingSpecVolumeVolumeSourceStorageos) *string { return v.VolumeName }).(pulumi.StringPtrOutput)
} |
FrameworkMessage is called when the framework sends some message to the executor | func (k *KubernetesExecutor) FrameworkMessage(driver bindings.ExecutorDriver, message string) {
if k.isDone() {
return
}
if !k.isConnected() {
log.Warningf("Ignore framework message because the executor is disconnected\n")
return
}
log.Infof("Receives message from framework %v\n", message)
//TODO(jdef) mas... |
SetFollowerIds gets a reference to the given string and assigns it to the FollowerIds field. | func (o *InlineResponse200115) SetFollowerIds(v string) {
o.FollowerIds = &v
} |
InternalAPI gets a URL base to send HTTP requests to. | func (c *Context) InternalAPI() *url.URL { return c.internalAPI } |
Compute inputs a number in a given position | func (op *Op3) Compute(pc *Computer, input int64) (int64, bool, error) {
if err := checkMemoryRange(pc, op.ArgLen); err != nil {
return 0, false, err
}
pc.Memory[pc.Memory[pc.ptr+1]] = input
pc.ptr += op.ArgLen + 1
return 0, false, nil
} |
OK, nothing special here | func Hash(data []byte) [blake2b.Size]byte {
return blake2b.Sum512(data)
} |
HistoryLoad loads history from a file. | func (l *Linenoise) HistoryLoad(fname string) {
info, err := os.Stat(fname)
if err != nil {
return
}
if !info.Mode().IsRegular() {
log.Printf("%s is not a regular file\n", fname)
return
}
f, err := os.Open(fname)
if err != nil {
log.Printf("%s error on open %s\n", fname, err)
return
}
b := bufio.NewR... |
get parameter as int | func (f *linkFrame) GetParamInt(k string) (i int64, err error) {
v, ok := f.param[k]
if ok {
switch v.(type) {
case int64:
i = v.(int64)
break
default:
err = errors.New("param value "+k+" not int")
}
} else {
err = errors.New("params don't have "+k)
}
return
} |
Deprecated: Use GetGatewayMiningHealthRequest.ProtoReflect.Descriptor instead. | func (*GetGatewayMiningHealthRequest) Descriptor() ([]byte, []int) {
return file_wallet_proto_rawDescGZIP(), []int{5}
} |
Json uses ReadConfig to read configuration from an inmemory JSON string. | func Json(data string) ViperBuilder {
return ReadConfig("json", strings.NewReader(data))
} |
ruleCheck implements a simple rule checker. It checks the rule for a key and a value. The value is returned by a get function. a rule is a string formatted with following syntax and meaning: ':' or '=' True if key has value equal to . ':' is kept for compatibility but is obsolete. '!=' True if key has a value NOT equal... | func ruleCheck(get func(string) (string, bool), rule []string) (found bool, err error) {
return
} |
CLUBELOCATIONADDRESSEqualFold applies the EqualFold predicate on the "CLUBE_LOCATION_ADDRESS" field. | func CLUBELOCATIONADDRESSEqualFold(v string) predicate.Location {
return predicate.Location(func(s *sql.Selector) {
s.Where(sql.EqualFold(s.C(FieldCLUBELOCATIONADDRESS), v))
})
} |
log writes the log message | func (ui *UI) log(message string, isError bool) error {
if isError {
message = decorate(message, "red")
} else {
message = decorate(message, "green")
}
return ui.writeContent(LOG_PANEL, message)
} |
GetTestStrategy returns the used test strategy | func (a GetSLITriggeredAdapter) GetTestStrategy() string {
return ""
} |
SetLastReportedDateTime sets the lastReportedDateTime property value. Last modified date time of an intent report | func (m *DeviceManagementIntentDeviceState) SetLastReportedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("lastReportedDateTime", value)
if err != nil {
panic(err)
}
} |
Mutex must be locked before calling write | func (c *cache) write(key string, val interface{}) {
c.Fields[key] = val
} |
ByteCeilToGib Convert Byte to Gib | func ByteCeilToGib(nByte int64) int {
if nByte <= 0 {
return 0
}
res := nByte / Gib
if res*Gib < nByte {
res += 1
}
return int(res)
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.