text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) {
return taskConfigSpec, nil
} | [
-1.3085452318191528,
0.2689343988895416,
0.3097761571407318,
0.5344617962837219,
-0.05064305663108826,
0.20033863186836243,
0.7174058556556702,
0.9645103812217712,
-0.9115697145462036,
1.5066331624984741,
-0.08194926381111145,
-1.2775520086288452,
-0.2196999043226242,
-0.3362281620502472,
... |
func (d *Driver) Capabilities() (*drivers.Capabilities, error) {
return capabilities, nil
} | [
-0.969641387462616,
-0.7183994650840759,
0.04382795840501785,
0.8322505950927734,
0.3155359625816345,
-1.0690407752990723,
-0.15191888809204102,
-0.17840518057346344,
0.9103842973709106,
-0.507047712802887,
-0.18524084985256195,
-0.3842356503009796,
-0.221253901720047,
0.7326502799987793,
... |
func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error) {
err := shelpers.Init()
if err != nil {
d.logger.Error("Could not init stats helper", "err", err)
return nil, err
}
ch := make(chan *drivers.Fingerprint)
go d.handleFingerprint(ctx, ch)
return ch, nil
} | [
0.9235174655914307,
-0.175119549036026,
0.43012717366218567,
0.36945831775665283,
1.1908318996429443,
0.1206367090344429,
0.5316539406776428,
-0.325170636177063,
0.3812737762928009,
-1.036329984664917,
0.3053414225578308,
0.18657487630844116,
-0.30715084075927734,
0.734508752822876,
1.01... |
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error {
if handle == nil {
return fmt.Errorf("error: handle cannot be nil")
}
if _, ok := d.tasks.Get(handle.Config.ID); ok {
return nil
}
var taskState TaskState
if err := handle.GetDriverState(&taskState); err != nil {
return fmt.Errorf("failed to... | [
0.16833236813545227,
-0.20360159873962402,
0.6696428060531616,
0.04463222250342369,
0.16921785473823547,
-0.32582518458366394,
0.17719689011573792,
-0.21722614765167236,
-0.2178000658750534,
-0.7569282650947571,
0.09721455723047256,
0.035561516880989075,
-0.2359173744916916,
-0.12157935649... |
func BuildContainerName(cfg *drivers.TaskConfig) string {
return fmt.Sprintf("%s-%s", cfg.Name, cfg.AllocID)
} | [
-0.5997952222824097,
-1.47015380859375,
0.4636569023132324,
0.060546159744262695,
-0.5319387316703796,
0.2598394751548767,
0.11865085363388062,
0.27151769399642944,
-0.08631870150566101,
0.9276655912399292,
0.20489391684532166,
0.27911990880966187,
0.8300995826721191,
0.3566635847091675,
... |
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error) {
if _, ok := d.tasks.Get(cfg.ID); ok {
return nil, nil, fmt.Errorf("task with ID %q already started", cfg.ID)
}
var driverConfig TaskConfig
if err := cfg.DecodeDriverConfig(&driverConfig); err != nil {
ret... | [
-0.06681559979915619,
-0.6025726199150085,
0.6506301164627075,
0.5950303077697754,
0.5344293117523193,
-0.26206961274147034,
0.44545549154281616,
0.2941838502883911,
-0.6577369570732117,
0.27643638849258423,
-0.4477155804634094,
-0.3538546860218048,
0.3333485424518585,
0.4541762173175812,
... |
func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error) {
d.logger.Debug("WaitTask called", "task", taskID)
handle, ok := d.tasks.Get(taskID)
if !ok {
return nil, drivers.ErrTaskNotFound
}
ch := make(chan *drivers.ExitResult)
go handle.runExitWatcher(ctx, ch)
return ch... | [
0.040534697473049164,
0.09197849035263062,
0.38245370984077454,
-0.2935921549797058,
0.9517589211463928,
-0.016434669494628906,
0.3261631429195404,
-0.4707084596157074,
0.3875449299812317,
-0.18926915526390076,
0.12550610303878784,
0.4104253649711609,
0.8465995192527771,
0.2899738252162933... |
func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error {
d.logger.Info("Stopping task", "taskID", taskID, "signal", signal)
handle, ok := d.tasks.Get(taskID)
if !ok {
return drivers.ErrTaskNotFound
}
// fixme send proper signal to container
err := d.podman.ContainerStop(d.ctx, hand... | [
-0.8586971759796143,
-0.3986029326915741,
0.3505023717880249,
0.7043769359588623,
0.4446760416030884,
0.0888330414891243,
0.00001038445407175459,
0.07309438288211823,
-0.27137166261672974,
0.5604922771453857,
-0.3410956859588623,
-0.1498783677816391,
0.9870008826255798,
0.32841429114341736... |
func (d *Driver) DestroyTask(taskID string, force bool) error {
handle, ok := d.tasks.Get(taskID)
if !ok {
return drivers.ErrTaskNotFound
}
if handle.isRunning() && !force {
return fmt.Errorf("cannot destroy running task")
}
if handle.isRunning() {
d.logger.Debug("Have to destroyTask but container is stil... | [
-0.5701683759689331,
-0.12702246010303497,
0.7449713349342346,
0.08743143081665039,
0.6296775937080383,
-0.46491318941116333,
0.2587961256504059,
-0.07963240891695023,
0.24168391525745392,
0.12485801428556442,
0.039186108857393265,
0.12061253190040588,
-0.10602671653032303,
1.0479857921600... |
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error) {
d.logger.Debug("InspectTask called")
handle, ok := d.tasks.Get(taskID)
if !ok {
return nil, drivers.ErrTaskNotFound
}
return handle.taskStatus(), nil
} | [
-0.6520792245864868,
-0.14433322846889496,
0.4680943787097931,
-0.6585139632225037,
0.5099133253097534,
-0.4612031579017639,
0.28358015418052673,
0.3337479829788208,
0.5582059025764465,
0.035940542817115784,
-0.5153013467788696,
0.5023871064186096,
0.19660945236682892,
0.7596880793571472,
... |
func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *drivers.TaskResourceUsage, error) {
d.logger.Debug("TaskStats called", "taskID", taskID)
handle, ok := d.tasks.Get(taskID)
if !ok {
return nil, drivers.ErrTaskNotFound
}
statsChannel := make(chan *drivers.TaskResource... | [
-0.002899306360632181,
-0.009491942822933197,
0.231355682015419,
-1.066311001777649,
-0.17908871173858643,
-0.16659918427467346,
0.2876983880996704,
-1.3676947355270386,
0.018751872703433037,
0.12905757129192352,
0.6540395617485046,
0.5889914631843567,
-0.2100827693939209,
0.53954249620437... |
func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error) {
return d.eventer.TaskEvents(ctx)
} | [
0.042874280363321304,
-0.4029161334037781,
0.5437987446784973,
0.21106687188148499,
-0.03724999725818634,
-0.0020218014251440763,
1.234234094619751,
-0.31409966945648193,
0.27241992950439453,
0.4153497517108917,
-0.7553451657295227,
0.2843724489212036,
-0.17558874189853668,
0.3423523008823... |
func (d *Driver) SignalTask(taskID string, signal string) error {
handle, ok := d.tasks.Get(taskID)
if !ok {
return drivers.ErrTaskNotFound
}
return d.podman.ContainerKill(d.ctx, handle.containerID, signal)
} | [
-0.25598931312561035,
-0.6605466604232788,
0.16151119768619537,
0.9414697885513306,
0.912619411945343,
-0.2832260727882385,
-0.37542033195495605,
-0.34549185633659363,
0.2830553352832794,
0.40803396701812744,
-0.27137941122055054,
0.23963677883148193,
0.7886889576911926,
0.5508750081062317... |
func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error) {
return nil, fmt.Errorf("Podman driver does not support exec")
} | [
-0.5282858610153198,
-0.1366017460823059,
0.6584508419036865,
1.3879977464675903,
-0.4641382396221161,
-0.17763230204582214,
-0.3363254964351654,
0.31684374809265137,
-0.19107753038406372,
0.4159083664417267,
0.22758805751800537,
-0.10157569497823715,
0.18127156794071198,
0.597898483276367... |
func expandPath(base, dir string) string {
if filepath.IsAbs(dir) {
return filepath.Clean(dir)
}
return filepath.Clean(filepath.Join(base, dir))
} | [
0.7837149500846863,
0.3332825303077698,
0.28357571363449097,
0.5887649059295654,
-0.5610872507095337,
0.6219571232795715,
-0.31781578063964844,
-0.3512892425060272,
0.1252598762512207,
0.5262972116470337,
1.528613805770874,
-0.15860049426555634,
-0.26403260231018066,
0.621253252029419,
0... |
func isParentPath(parent, path string) bool {
rel, err := filepath.Rel(parent, path)
return err == nil && !strings.HasPrefix(rel, "..")
} | [
1.323217749595642,
-0.7266484498977661,
0.536105751991272,
0.7763398289680481,
-0.35820716619491577,
0.21181899309158325,
0.031119588762521744,
-0.7782254815101624,
0.26360222697257996,
0.5970029234886169,
0.3125063478946686,
-0.1390990912914276,
-0.6078453063964844,
-0.22510729730129242,
... |
func (client *Client) GetOcJusticeTerminalCase(request *GetOcJusticeTerminalCaseRequest) (response *GetOcJusticeTerminalCaseResponse, err error) {
response = CreateGetOcJusticeTerminalCaseResponse()
err = client.DoAction(request, response)
return
} | [
0.5251898169517517,
-0.16335682570934296,
0.7016739845275879,
-0.3875521123409271,
-0.30656740069389343,
-0.7518047094345093,
-0.13479995727539062,
-0.6825536489486694,
0.14974018931388855,
0.14582473039627075,
1.3340294361114502,
0.2699248492717743,
-0.9964844584465027,
-0.998722195625305... |
func (client *Client) GetOcJusticeTerminalCaseWithChan(request *GetOcJusticeTerminalCaseRequest) (<-chan *GetOcJusticeTerminalCaseResponse, <-chan error) {
responseChan := make(chan *GetOcJusticeTerminalCaseResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
... | [
0.20734140276908875,
-0.3875308930873871,
0.7772186398506165,
-0.6642037630081177,
-0.08376210182905197,
-0.13296684622764587,
-0.2915309965610504,
-0.9935315251350403,
0.16746196150779724,
0.06394385546445847,
1.15531587600708,
0.5847089290618896,
-0.40873855352401733,
-0.4942137002944946... |
func (client *Client) GetOcJusticeTerminalCaseWithCallback(request *GetOcJusticeTerminalCaseRequest, callback func(response *GetOcJusticeTerminalCaseResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *GetOcJusticeTerminalCaseResponse
var err error
def... | [
0.3933830261230469,
-0.12797310948371887,
0.9360296130180359,
-0.43511003255844116,
-0.3542849123477936,
-0.4855966567993164,
-0.08503524959087372,
-0.6015915274620056,
0.8366629481315613,
0.39758944511413574,
1.283029556274414,
-0.17020633816719055,
-0.11427001655101776,
-0.35052889585494... |
func CreateGetOcJusticeTerminalCaseRequest() (request *GetOcJusticeTerminalCaseRequest) {
request = &GetOcJusticeTerminalCaseRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("dt-oc-info", "2022-08-29", "GetOcJusticeTerminalCase", "", "")
request.Method = requests.POST
return
} | [
0.4216817021369934,
-0.5613788366317749,
0.7158282399177551,
-0.0777055025100708,
0.2858153283596039,
-0.39918622374534607,
-0.1345590502023697,
-0.7651165723800659,
-0.7368397116661072,
-0.061246391385793686,
1.0285038948059082,
0.8797481060028076,
-0.16376961767673492,
0.2201151251792907... |
func CreateGetOcJusticeTerminalCaseResponse() (response *GetOcJusticeTerminalCaseResponse) {
response = &GetOcJusticeTerminalCaseResponse{
BaseResponse: &responses.BaseResponse{},
}
return
} | [
0.9222057461738586,
-1.311590313911438,
0.2406703680753708,
-0.2563072741031647,
0.3442218601703644,
-0.3191973865032196,
0.06102411821484566,
-1.1778558492660522,
-0.06304970383644104,
0.05018320679664612,
0.5187872052192688,
-0.6941769123077393,
-0.688919186592102,
0.04662621021270752,
... |
func GetQueryCmd(cdc *codec.Codec) *cobra.Command {
profileQueryCmd := &cobra.Command{
Use: types.ModuleName,
Short: "Querying commands for the profiles module",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.Val... | [
0.7485798001289368,
-0.28319114446640015,
0.5021299719810486,
0.16099853813648224,
0.930317223072052,
0.5663263201713562,
0.546709418296814,
-0.4400237798690796,
0.5725436806678772,
-1.3976961374282837,
0.06019625440239906,
0.7133700847625732,
-0.21421146392822266,
0.47388651967048645,
0... |
func GetCmdQueryProfile(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "profile [address_or_dtag]",
Short: "Retrieve the profile having the specified user address or profile dtag, if any.",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.N... | [
0.7493365406990051,
0.19274097681045532,
0.4347279369831085,
-0.5384495258331299,
-0.3719092905521393,
-0.22714996337890625,
0.07279221713542938,
-1.017775058746338,
-0.28457561135292053,
-0.5725361704826355,
0.2046118825674057,
0.18997645378112793,
-0.37610945105552673,
0.3420028686523437... |
func GetCmdQueryProfiles(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "all",
Short: "Retrieve all the registered profiles.",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
route := fmt.Sprintf("custom/%s/%s"... | [
0.6157603859901428,
0.32187673449516296,
0.6000407934188843,
-0.5682499408721924,
0.33009010553359985,
0.24433667957782745,
0.007933518849313259,
-0.4549182951450348,
-0.07583954185247421,
-0.688390851020813,
-0.01033132802695036,
0.5893973112106323,
-0.7454491853713989,
0.5205965638160706... |
func GetCmdQueryProfileParams(cdc *codec.Codec) *cobra.Command {
return &cobra.Command{
Use: "parameters",
Short: "Retrieve all the profile module parameters",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
cliCtx := context.NewCLIContext().WithCodec(cdc)
route := fmt.Sprin... | [
0.46926259994506836,
-0.08397846668958664,
0.41138994693756104,
-0.6745481491088867,
0.08062799274921417,
0.31958121061325073,
-0.25523391366004944,
-0.12243743985891342,
-0.536801815032959,
-0.3042305111885071,
0.13221165537834167,
0.6220602989196777,
-0.7761383652687073,
0.92748934030532... |
func Setup() *celerity.Server {
db, _ := gorm.Open("sqlite3", "./data.sqlite3")
db.LogMode(true)
db.AutoMigrate(
models.User{},
models.Room{},
models.Message{},
models.Session{},
)
var lobbyCount int
db.Model(&models.Room{}).Where("slug = ?", "lobby").Count(&lobbyCount)
if lobbyCount == 0 {
db.Creat... | [
-0.16914251446723938,
0.1049046441912651,
0.8529379963874817,
0.058367107063531876,
0.8088071942329407,
0.46128973364830017,
0.48403432965278625,
0.07088200002908707,
0.023843469098210335,
0.4274860620498657,
-0.25814229249954224,
0.32550516724586487,
-0.3080351650714874,
1.056133627891540... |
func bölme(bölünen, bölen int) (bölüm, kalan int) {
bölüm = bölünen / bölen
kalan = bölünen % bölen
return bölüm, kalan
} | [
0.19746671617031097,
0.47546303272247314,
0.5715245604515076,
0.09141354262828827,
0.18422025442123413,
-0.4584238529205322,
-1.0014569759368896,
-0.3507230281829834,
-0.9141084551811218,
-0.3198506534099579,
-0.6988056898117065,
-0.052691828459501266,
-0.826292872428894,
-0.07275767624378... |
func stringView(v []byte) string {
return string(v)
} | [
0.4038602411746979,
-0.8593636155128479,
0.31698814034461975,
-1.8069504499435425,
-1.722063660621643,
-0.16584895551204681,
-0.479919970035553,
-0.4658615291118622,
0.7129926681518555,
-0.3778268098831177,
-0.3281010091304779,
0.6030297875404358,
-0.6472910642623901,
-0.7233492732048035,
... |
func bytesView(v string) []byte {
return []byte(v)
} | [
0.2543143332004547,
-0.2197273224592209,
0.4129822254180908,
-1.8663972616195679,
-1.231695532798767,
-0.3617653548717499,
-1.2679874897003174,
-0.38745543360710144,
0.568533718585968,
-0.8911766409873962,
-0.1262846738100052,
1.019770622253418,
-0.23044340312480927,
-0.48989447951316833,
... |
func NewNode(config *Configuration) *Node {
node := new(Node)
node.config = config
node.partitions = make(map[string][]partition)
node.strategyMap = make(map[string]RoutingStrategy)
// create a http listener, do it this way to get the running port
addrStr := fmt.Sprintf(":%d", config.NodePort)
listener, err :=... | [
0.3436751961708069,
-0.41316378116607666,
0.4962587058544159,
-0.45895683765411377,
0.6261711716651917,
0.23713570833206177,
-0.04756942391395569,
0.4407152831554413,
0.017604772001504898,
0.21445298194885254,
0.4933904707431793,
0.48348069190979004,
0.1847212016582489,
0.16714270412921906... |
func (n Node) Shutdown() {
log.Info("Starting shutdown of %d partitions", len(n.partitions))
for _, parts := range n.partitions {
for _, part := range parts {
part.Close()
}
}
log.Info("Finished closing all the partitions")
} | [
-0.592396080493927,
-0.734660804271698,
0.5308407545089722,
-0.6477768421173096,
0.31640347838401794,
0.5442968010902405,
-0.26715147495269775,
0.36625829339027405,
-0.1487855166196823,
0.049191780388355255,
0.9052265882492065,
-0.010051065124571323,
-0.24695582687854767,
0.283330976963043... |
func (n *Node) Subscribe(topic string) <-chan Message {
consumer := make(chan Message)
parts := n.getPartitionsFor(topic)
var part partition
for _, p := range parts {
part = smallestOf(part, p)
}
log.Debug("Created subscriber for %s:%v", topic, part)
part.Subscribe(consumer)
return consumer
} | [
0.5254355072975159,
0.02335531823337078,
0.42406976222991943,
-0.5135955810546875,
0.330239862203598,
-0.22712402045726776,
-0.6069717407226562,
-1.0465043783187866,
-0.7790627479553223,
-0.6751759648323059,
0.8202048540115356,
0.3153279721736908,
-0.555040717124939,
0.014138809405267239,
... |
func (n *Node) SubscribeToAll(topic string) <-chan Message {
consumer := make(chan Message)
parts := n.getPartitionsFor(topic)
for _, p := range parts {
p.Subscribe(consumer)
}
return consumer
} | [
0.44068118929862976,
-0.33031830191612244,
0.7290316820144653,
-0.46879398822784424,
0.35718339681625366,
-0.1369025707244873,
-0.8903974294662476,
-0.6141828894615173,
-0.19020786881446838,
-0.21283382177352905,
0.3914644122123718,
0.6700166463851929,
-0.19699184596538544,
0.5516853928565... |
func (n *Node) RegisterStrategy(topic string, strategy RoutingStrategy) {
n.strategyMap[topic] = strategy
} | [
-0.2299833595752716,
0.08902882784605026,
0.4227759838104248,
-0.40930697321891785,
1.2175004482269287,
-0.11366403102874756,
-0.8349741697311401,
0.18334297835826874,
-0.04402998089790344,
0.10272535681724548,
-0.0021875754464417696,
0.4760349690914154,
0.4403856098651886,
0.3879570960998... |
func (n *Node) Write(topic, payload string) error {
rs := n.getStrategyFor(topic)
partID := rs.WhichPartition(payload)
parts := n.getPartitionsFor(topic)
return parts[partID].Write(payload)
} | [
-0.38513892889022827,
-0.5338422656059265,
0.31895047426223755,
-0.7158394455909729,
0.793605387210846,
-0.210637167096138,
-0.9052730798721313,
-0.2187218815088272,
-0.5583921074867249,
0.1404634714126587,
0.7354287505149841,
-0.637490451335907,
-0.7054612040519714,
-0.08780994266271591,
... |
func (n *Node) getPartitionsFor(topic string) []partition {
parts, hasParts := n.partitions[topic]
if hasParts {
return parts
}
// we haven't seen this before fetch it
log.Info("The topic %s is new -- creating it locally", topic)
// TODO fetch!!! - for now, we will just make it all local
parts = make([]part... | [
0.037799108773469925,
-0.35520264506340027,
0.5111603736877441,
-0.8940258622169495,
0.5460700392723083,
-0.4059085249900818,
-0.5533116459846497,
-0.4334435760974884,
-0.03686751425266266,
-0.5056795477867126,
0.15844090282917023,
-0.46925076842308044,
-0.2803628444671631,
0.7026459574699... |
func GetFileContentType(out *os.File) (string, error) {
// Only the first 512 bytes are used to sniff the content type.
buffer := make([]byte, 512)
_, err := out.Read(buffer)
if err != nil {
return "", err
}
// Use the net/http package's handy DectectContentType function. Always returns a valid
// content-ty... | [
0.7251081466674805,
-0.5866385698318481,
0.7808632850646973,
0.22521409392356873,
-0.9375709891319275,
-0.8382648229598999,
0.4598185122013092,
-0.6923325657844543,
-0.2456514835357666,
-0.22645409405231476,
0.5370612144470215,
-0.3811648488044739,
0.31868240237236023,
0.32601404190063477,... |
func New(name string, baseDir string) (*WALTopic, error) {
walDir := filepath.Join(baseDir, name)
oneMB := 1 * 1024 * 1024
w, err := walFactory.NewSize(nil, nil, walDir, oneMB, false)
if err != nil {
return nil, errors.Wrapf(err, "Could not create wal for topic %s", name)
}
m := make(map[int]uint64)
return &WA... | [
0.4189722239971161,
-0.3561875820159912,
0.32615381479263306,
-0.518364667892456,
-0.44111666083335876,
0.2593924105167389,
0.1951153576374054,
-0.46184444427490234,
-0.7983265519142151,
-0.05562739074230194,
0.2983766794204712,
0.10806705802679062,
0.2143246829509735,
0.5924044251441956,
... |
func Restore(name string, walDir string) (*WALTopic, error) {
w, err := walFactory.Open(nil, nil, walDir)
if err != nil {
return nil, errors.Wrapf(err, "Could no open wal for topic %s", name)
}
m := make(map[int]uint64)
return &WALTopic{name: name, walDir: walDir, wal: w, firstIndexInSegment: m}, nil
} | [
0.26902422308921814,
-0.4708961844444275,
0.34450751543045044,
-0.9399207234382629,
-0.38096994161605835,
-0.018965737894177437,
-0.29789721965789795,
-0.4737095832824707,
0.17132072150707245,
-0.38472071290016174,
0.7320797443389893,
0.06990005820989609,
-1.0344158411026,
-0.9130001664161... |
func (t *WALTopic) Append(data Data) error {
var buf bytes.Buffer
_ = gob.NewEncoder(&buf).Encode(data)
if err := t.wal.Log(buf.Bytes()); err != nil {
return errors.Wrapf(err, "Error appending to wal for topic: %s", t.name)
}
for _, a := range t.readerAlerts {
if a.waiting {
a.appendC <- true
}
}
re... | [
0.5155574083328247,
0.021643303334712982,
0.5514785051345825,
-0.15382830798625946,
-0.03354727476835251,
1.102504849433899,
-0.5898861885070801,
-0.41047078371047974,
-0.48252618312835693,
0.16683059930801392,
0.669691264629364,
0.49470654129981995,
-0.667110800743103,
0.9355107545852661,... |
func (t *WALTopic) Close() error {
return t.wal.Close()
} | [
0.42418909072875977,
-0.21012189984321594,
0.2770526707172394,
-0.3003503978252411,
0.030094925314188004,
1.593611240386963,
-0.07101678103208542,
-1.1373823881149292,
-0.8596890568733215,
-0.4735124111175537,
0.7355309724807739,
-0.3237588703632355,
-0.678067147731781,
0.7959074378013611,... |
func (t *WALTopic) NewReader(index uint64) (Reader, error) {
return t.newWalReader(index)
} | [
-0.5820742249488831,
-0.13686126470565796,
0.07306203246116638,
-0.13590775430202484,
-0.18073853850364685,
0.5050707459449768,
-0.42053717374801636,
-0.7812256813049316,
0.5575183033943176,
-0.2500642240047455,
0.2827213406562805,
0.18056555092334747,
-0.20359578728675842,
-0.007434279657... |
func (t *WALTopic) addReaderAlert(a *topicReaderAlert) {
t.readerAlerts = append(t.readerAlerts, a)
} | [
-0.8241512179374695,
-1.171030044555664,
0.2952864468097687,
-0.5402957201004028,
-0.25585103034973145,
0.613585889339447,
-0.7735493183135986,
0.03757348284125328,
-0.1478704810142517,
-0.611225426197052,
0.7386168837547302,
-0.2185523509979248,
-0.7061127424240112,
0.2944185137748718,
... |
func (r *walTopicReader) Next(ctx context.Context) (*types.AcceptedProposal, error) {
return r.next(ctx, false)
} | [
-0.14704689383506775,
0.15169189870357513,
0.1121114194393158,
0.09812285006046295,
-1.135536551475525,
1.0870805978775024,
-0.46083396673202515,
-0.5060392022132874,
0.018345311284065247,
0.6070483922958374,
0.8631550073623657,
0.43156197667121887,
-0.29506462812423706,
0.1598658114671707... |
func injectDBGorm(db *gorm.DB) gin.HandlerFunc {
return func(c *gin.Context) {
c.Set("dbConnection", db)
c.Next()
}
} | [
-0.11811128258705139,
0.6191591620445251,
0.6067789793014526,
0.010055093094706535,
0.49503377079963684,
0.4061276614665985,
0.0015952358953654766,
0.39385583996772766,
-0.4748428165912628,
-0.3178113102912903,
-0.17078562080860138,
0.8794270753860474,
-0.2471974790096283,
0.41844046115875... |
func (gtx *GuardTx) User(user *schema.User) *schema.User {
if user == nil {
user = &schema.User{
Entity: schema.Entity{DBContract: gtx.dbTx},
}
} else {
user.DBContract = gtx.dbTx
}
user.SetValidator(gtx.validator.User)
return user
} | [
0.20576755702495575,
0.6097404956817627,
0.3677592873573303,
0.526810884475708,
-0.18595169484615326,
0.47746047377586365,
0.2102546989917755,
0.003346612211316824,
1.0026018619537354,
-0.825312077999115,
-0.3150436282157898,
-0.19636663794517517,
0.30051344633102417,
-0.1226031631231308,
... |
func (gtx *GuardTx) Role(role *schema.Role) *schema.Role {
if role == nil {
role = &schema.Role{
Entity: schema.Entity{DBContract: gtx.dbTx},
}
} else {
role.DBContract = gtx.dbTx
}
role.SetValidator(gtx.validator.Role)
return role
} | [
0.357946515083313,
1.172960638999939,
0.2669655978679657,
0.08499054610729218,
0.4846155345439911,
0.22749903798103333,
-0.5204662680625916,
0.38875001668930054,
1.081251621246338,
-0.3561064600944519,
0.7005032300949097,
-0.798548698425293,
-0.6374996900558472,
-0.22437193989753723,
0.8... |
func (gtx *GuardTx) Permission(permission *schema.Permission) *schema.Permission {
if permission == nil {
return &schema.Permission{
Entity: schema.Entity{DBContract: gtx.dbTx},
}
} else {
permission.DBContract = gtx.dbTx
}
permission.SetValidator(gtx.validator.Permission)
return permission
} | [
0.268647700548172,
1.009955883026123,
0.29000791907310486,
0.5794773697853088,
0.2218332290649414,
0.45575451850891113,
-0.386118620634079,
0.19473916292190552,
1.3572626113891602,
0.12020256370306015,
0.9280117750167847,
-0.7032844424247742,
-0.39695918560028076,
-0.1817348748445511,
0.... |
func (gtx *GuardTx) Rule(rule *schema.Rule) *schema.Rule {
if rule == nil {
return &schema.Rule{
Entity: schema.Entity{DBContract: gtx.dbTx},
}
}
rule.DBContract = gtx.dbTx
rule.SetValidator(gtx.validator.Rule)
return rule
} | [
0.6402247548103333,
0.9893686771392822,
0.2891710102558136,
-0.1849352866411209,
1.1403028964996338,
0.9236162900924683,
-0.44106823205947876,
0.5378230810165405,
1.1916587352752686,
-0.9774006009101868,
0.6690679788589478,
0.22028867900371552,
-0.20381613075733185,
-0.14256857335567474,
... |
func (gtx *GuardTx) GetTx() *sql.Tx {
return gtx.dbTx
} | [
0.34472954273223877,
0.7807027697563171,
0.40411004424095154,
0.3729647397994995,
0.4306180477142334,
0.3199957311153412,
-0.54487544298172,
-0.8040677905082703,
-0.03029579110443592,
-0.5334619283676147,
-0.6456507444381714,
0.02381923981010914,
-0.4306848645210266,
-0.8712432384490967,
... |
func (*text) isOutput() {
} | [
-0.11064024269580841,
-0.8749580979347229,
0.28051578998565674,
0.4144911468029022,
-1.2681646347045898,
-0.5412226915359497,
0.9710512757301331,
0.4918875992298126,
0.6284963488578796,
0.6227425932884216,
-0.49073198437690735,
-1.058208703994751,
-0.5745224952697754,
0.25379452109336853,
... |
func (h *HTML) Class(c ...string) *HTML {
h.classes = append(h.classes, c...)
return h
} | [
-0.6871943473815918,
0.7818803191184998,
0.2373414933681488,
0.07226318120956421,
0.6028940677642822,
1.2292789220809937,
-0.6040581464767456,
0.27710607647895813,
-0.1457204669713974,
-0.9912132024765015,
0.04973528906702995,
0.35776033997535706,
-0.12446120381355286,
0.4718364179134369,
... |
func (h *HTML) On(event string, handler EventHandler) *HTML {
h.events = append(h.events, eventHandler{event, handler})
return h
} | [
0.1159256100654602,
-0.010715648531913757,
0.587953507900238,
-0.07358454167842865,
-0.7005295753479004,
0.5218378305435181,
-1.123606562614441,
1.223400592803955,
0.013533828780055046,
-0.6555493474006653,
-0.48589181900024414,
0.3330966830253601,
0.13448305428028107,
0.9246336221694946,
... |
func (*HTML) isOutput() {
} | [
-0.2832334339618683,
-0.6488112807273865,
0.29595649242401123,
0.8686975836753845,
-0.9471741914749146,
-0.5386890172958374,
1.4399915933609009,
0.07757438719272614,
0.5570998191833496,
0.47985202074050903,
-0.24438975751399994,
-0.8836143016815186,
-0.24489344656467438,
0.5660603642463684... |
func (s *State) Update() {
// fmt.Println("update")
s.render()
} | [
-0.3058431148529053,
-0.9665021300315857,
0.10869786888360977,
-0.2604280114173889,
-0.6678484678268433,
0.47652873396873474,
0.11094501614570618,
0.9899266958236694,
0.3950822055339813,
-0.671126663684845,
0.14072464406490326,
-0.03042907826602459,
-0.37326109409332275,
0.3316648304462433... |
func NewComboBoxSelector(label string, list []string) *ComboBoxSelector {
obj := new(ComboBoxSelector)
obj.SelectedItem = list[0]
// initialize widgets
obj.Cell = widgets.NewQWidget(nil, 0)
obj.box = widgets.NewQComboBox(obj.Cell)
obj.box.AddItems(list)
obj.textLabel = widgets.NewQLabel2(label, obj.Cell, 0)
/... | [
-0.5974069833755493,
-1.0037288665771484,
0.5194857120513916,
-0.3091081976890564,
0.11852429807186127,
-0.3917296528816223,
-0.24796156585216522,
0.45623674988746643,
0.6390292048454285,
-0.3656093180179596,
-1.2602440118789673,
-0.16970312595367432,
-0.6394537687301636,
-0.15689751505851... |
func sumOfLeftLeavesDFS(root *TreeNode) int {
sum := 0
var dfs func(r *TreeNode)
dfs = func(r *TreeNode) {
if r == nil {
return
}
if r.Left != nil && r.Left.Left == nil && r.Left.Right == nil {
sum += r.Left.Val
}
dfs(r.Left)
dfs(r.Right)
}
dfs(root)
return sum
} | [
0.43192169070243835,
0.3332193195819855,
0.8436576128005981,
-0.8941454887390137,
-0.543082058429718,
-0.5617830157279968,
-0.5447996854782104,
-0.46896108984947205,
0.45128941535949707,
-0.510613203048706,
-0.3013150095939636,
-0.16437329351902008,
0.5232585072517395,
1.8442130088806152,
... |
func NewFileInfo(
t *testing.T,
path string,
externalPath string,
isImport bool,
moduleIdentity bufmoduleref.ModuleIdentity,
commit string,
) bufmoduleref.FileInfo {
fileInfo, err := bufmoduleref.NewFileInfo(
path,
filepath.Clean(filepath.FromSlash(externalPath)),
isImport,
moduleIdentity,
commit,
)
... | [
1.2772107124328613,
-0.8024895191192627,
0.26328328251838684,
-0.3937624394893646,
0.18053974211215973,
0.8963435888290405,
-0.11599674820899963,
0.12627378106117249,
-0.1827257126569748,
-0.1619088351726532,
-0.5642415881156921,
0.3775111138820648,
-0.7434980869293213,
0.15602195262908936... |
func branchName(root, dirRelPath, openAPIFileName string) string {
name := filepath.Base(dirRelPath)
_, err := os.Stat(filepath.Join(root, dirRelPath, openAPIFileName))
if !os.IsNotExist(err) {
// add Pkg: prefix indicating that it is a separate package as it has
// openAPIFile
return fmt.Sprintf("Pkg: %s", na... | [
0.302573025226593,
-1.0015202760696411,
0.643586277961731,
-0.10071538388729095,
-0.5869251489639282,
0.41075360774993896,
0.13956448435783386,
0.29844462871551514,
-0.7299408912658691,
0.30456143617630005,
0.7366399765014648,
-0.6488242745399475,
0.18553335964679718,
0.21250686049461365,
... |
func (p TreeWriter) Write(nodes []*yaml.RNode) error {
switch p.Structure {
case TreeStructurePackage:
return p.packageStructure(nodes)
case TreeStructureGraph:
return p.graphStructure(nodes)
}
// If any resource has an owner reference, default to the graph structure. Otherwise, use package structure.
for _,... | [
-1.0551389455795288,
0.07507827877998352,
0.35062676668167114,
0.08960026502609253,
1.01414954662323,
-0.49792543053627014,
0.42128732800483704,
0.5351848602294922,
0.34297165274620056,
0.1613667905330658,
0.819042980670929,
0.0249406099319458,
0.05161541700363159,
0.4616495668888092,
-0... |
func (a node) Tree(root treeprint.Tree) error {
sort.Sort(a)
branch := root
var err error
// generate a node for the Resource
if a.RNode != nil {
branch, err = a.p.doResource(a.RNode, "Resource", root)
if err != nil {
return err
}
}
// attach children to the branch
for _, n := range a.children {
if... | [
0.45773863792419434,
-0.07703518122434616,
0.5491123795509338,
-0.6407940983772278,
-0.4482642114162445,
0.5956100821495056,
-0.09683094173669815,
-0.27294448018074036,
0.9098323583602905,
-0.5242033004760742,
1.1112552881240845,
0.2569708526134491,
0.1253649890422821,
1.3165147304534912,
... |
func (p TreeWriter) graphStructure(nodes []*yaml.RNode) error {
resourceToOwner := map[string]*node{}
root := &node{}
// index each of the nodes by their owner
for _, n := range nodes {
ownerVal, err := ownerToString(n)
if err != nil {
return err
}
var owner *node
if ownerVal == "" {
// no owner -- ... | [
-0.5432824492454529,
-0.22984178364276886,
0.663873553276062,
-0.44307565689086914,
0.42663097381591797,
-0.7103862762451172,
0.8840789198875427,
-0.3530665338039398,
0.10899379849433899,
-0.19257596135139465,
0.7890548706054688,
0.4188386797904968,
0.14117197692394257,
-0.2577947080135345... |
func nodeToString(node *yaml.RNode) (string, error) {
meta, err := node.GetMeta()
if err != nil {
return "", err
}
return fmt.Sprintf("%s %s/%s", meta.Kind, meta.Namespace, meta.Name), nil
} | [
-0.7320759296417236,
-0.6688907146453857,
0.35433268547058105,
-1.1071538925170898,
0.044059060513973236,
-0.16224956512451172,
-0.18786998093128204,
-0.7490876913070679,
-0.2933449149131775,
0.6720448732376099,
0.44690650701522827,
0.7051293253898621,
0.9273970723152161,
0.781284928321838... |
func ownerToString(node *yaml.RNode) (string, error) {
meta, err := node.GetMeta()
if err != nil {
return "", err
}
namespace := meta.Namespace
owners, err := node.Pipe(yaml.Lookup("metadata", "ownerReferences"))
if err != nil {
return "", err
}
if owners == nil {
return "", nil
}
elements, err := own... | [
-0.7776700258255005,
-0.5989036560058594,
0.7346577644348145,
-0.6506168246269226,
-0.17464351654052734,
-0.19249725341796875,
0.3318765163421631,
-1.0313702821731567,
-0.22031471133232117,
0.48042184114456177,
0.8543756008148193,
1.1092137098312378,
0.7911773920059204,
0.341128408908844,
... |
func (p TreeWriter) index(nodes []*yaml.RNode) map[string][]*yaml.RNode {
// index the ResourceNodes by package
indexByPackage := map[string][]*yaml.RNode{}
for i := range nodes {
meta, err := nodes[i].GetMeta()
if err != nil || meta.Kind == "" {
// not a resource
continue
}
pkg := filepath.Dir(meta.An... | [
-0.6516590118408203,
-0.4654131531715393,
0.15105770528316498,
-0.9603331089019775,
-0.10103397071361542,
-0.5295088887214661,
1.053422212600708,
1.3199305534362793,
-0.17109204828739166,
1.2203010320663452,
0.7356005907058716,
0.006061887834221125,
0.2962918281555176,
0.24856430292129517,... |
func (p TreeWriter) sort(indexByPackage map[string][]*yaml.RNode) []string {
var keys []string
for k := range indexByPackage {
pkgNodes := indexByPackage[k]
sort.Slice(pkgNodes, func(i, j int) bool { return compareNodes(pkgNodes[i], pkgNodes[j]) })
keys = append(keys, k)
}
// return the package names sorted ... | [
-0.92787766456604,
-0.03602017089724541,
0.48177650570869446,
-0.38696619868278503,
-0.23787465691566467,
-0.8206030130386353,
-0.15561847388744354,
0.04194348305463791,
-0.28518545627593994,
0.823117196559906,
0.4190601408481598,
-0.41887736320495605,
-0.16385498642921448,
0.2100180089473... |
func (p TreeWriter) getFields(leaf *yaml.RNode) (treeFields, error) {
fieldsByName := map[string]*treeField{}
// index nested and non-nested fields
for i := range p.Fields {
f := p.Fields[i]
seq, err := leaf.Pipe(&f)
if err != nil {
return nil, err
}
if seq == nil {
continue
}
if fieldsByName[f... | [
-0.29291677474975586,
0.24483440816402435,
0.7261532545089722,
-0.5108977556228638,
-0.016834352165460587,
-0.25740185379981995,
0.58192378282547,
-0.20725038647651672,
-0.5835193395614624,
-0.537746787071228,
-0.14184218645095825,
-0.34003502130508423,
-0.3029614984989166,
0.0679267644882... |
func NewCopyRecipeToMyRecipesWithChangesParams() *CopyRecipeToMyRecipesWithChangesParams {
var ()
return &CopyRecipeToMyRecipesWithChangesParams{
timeout: cr.DefaultTimeout,
}
} | [
-0.012486934661865234,
-0.2875833511352539,
0.23198504745960236,
0.28005659580230713,
-1.03224778175354,
-0.31206274032592773,
-0.3025803565979004,
0.42876219749450684,
-0.16840378940105438,
0.8668978214263916,
-0.43663015961647034,
-0.08468789607286453,
-0.49238336086273193,
0.33227294683... |
func NewCopyRecipeToMyRecipesWithChangesParamsWithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams {
var ()
return &CopyRecipeToMyRecipesWithChangesParams{
timeout: timeout,
}
} | [
0.5279785990715027,
-0.3884272575378418,
0.4030810296535492,
0.0181066133081913,
-1.0863229036331177,
0.03206700086593628,
-0.8327807188034058,
0.5302631258964539,
-0.02522842399775982,
1.44913911819458,
-0.24533914029598236,
0.6556533575057983,
-0.259688138961792,
0.33152565360069275,
-... |
func NewCopyRecipeToMyRecipesWithChangesParamsWithContext(ctx context.Context) *CopyRecipeToMyRecipesWithChangesParams {
var ()
return &CopyRecipeToMyRecipesWithChangesParams{
Context: ctx,
}
} | [
0.001850217580795288,
-0.3438801169395447,
0.7901203632354736,
-0.33142319321632385,
-0.690528929233551,
0.14080744981765747,
-0.7416351437568665,
-0.10921383649110794,
0.32859545946121216,
0.9704442024230957,
-0.3440716564655304,
0.43981117010116577,
-0.0441293828189373,
-0.14616225659847... |
func NewCopyRecipeToMyRecipesWithChangesParamsWithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams {
var ()
return &CopyRecipeToMyRecipesWithChangesParams{
HTTPClient: client,
}
} | [
-0.05671633407473564,
-0.5223535895347595,
0.5511299967765808,
-0.09837858378887177,
-0.5454707145690918,
0.10802676528692245,
0.25832486152648926,
0.46712353825569153,
-0.2527974545955658,
0.3759952783584595,
-0.928847074508667,
0.4803351163864136,
-0.10006340593099594,
-0.305522441864013... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WithTimeout(timeout time.Duration) *CopyRecipeToMyRecipesWithChangesParams {
o.SetTimeout(timeout)
return o
} | [
0.15449970960617065,
-0.03746574744582176,
0.38041171431541443,
-0.19159021973609924,
-1.3288969993591309,
-0.4637083113193512,
-0.06469433009624481,
0.512544572353363,
0.719123899936676,
1.4995169639587402,
-0.24221566319465637,
0.4428335726261139,
0.3105062246322632,
0.13727013766765594,... |
func (o *CopyRecipeToMyRecipesWithChangesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
0.024094073101878166,
0.09053333103656769,
0.2786791920661926,
0.08382350951433182,
-0.9774163961410522,
0.02109045721590519,
-0.16247960925102234,
0.9085254669189453,
0.33225199580192566,
1.4486134052276611,
-0.06932956725358963,
0.43190521001815796,
0.058707330375909805,
0.25656104087829... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WithContext(ctx context.Context) *CopyRecipeToMyRecipesWithChangesParams {
o.SetContext(ctx)
return o
} | [
-0.4590219259262085,
-0.2098151594400406,
0.5391335487365723,
-0.3150007426738739,
-1.1287628412246704,
-0.2941552400588989,
-0.09176444262266159,
-0.13949236273765564,
1.0158432722091675,
0.9362545609474182,
-0.29771342873573303,
0.2389790266752243,
-0.17325188219547272,
-0.39417904615402... |
func (o *CopyRecipeToMyRecipesWithChangesParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
-0.4740575850009918,
0.23247785866260529,
0.3209262490272522,
0.19686827063560486,
-0.5481922030448914,
0.04932400956749916,
-0.05177296698093414,
0.23972739279270172,
1.068542718887329,
0.7555598616600037,
-0.2957918643951416,
0.2322574108839035,
-0.229485884308815,
-0.016448311507701874,... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WithHTTPClient(client *http.Client) *CopyRecipeToMyRecipesWithChangesParams {
o.SetHTTPClient(client)
return o
} | [
-0.133547842502594,
-0.9848137497901917,
0.3566330373287201,
-0.6156022548675537,
-1.0050190687179565,
-0.4525447487831116,
0.48211005330085754,
-0.034080229699611664,
0.13552993535995483,
0.37410062551498413,
-0.4617687165737152,
0.4596264362335205,
0.3719586431980133,
-0.6399251222610474... |
func (o *CopyRecipeToMyRecipesWithChangesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.12012946605682373,
-0.6400757431983948,
0.25603875517845154,
-0.7932878136634827,
-0.9528536200523376,
-0.4980153739452362,
0.5323116183280945,
0.28936225175857544,
-0.4213967025279999,
0.5067843794822693,
-0.6352730393409729,
0.8300901651382446,
-0.04295126348733902,
-0.5450767874717712... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WithJSONBody(jSONBody *models.Recipe) *CopyRecipeToMyRecipesWithChangesParams {
o.SetJSONBody(jSONBody)
return o
} | [
-0.6437280178070068,
-0.3443765938282013,
0.512741208076477,
-0.02042071893811226,
-1.2531142234802246,
-1.0462297201156616,
-0.008505851961672306,
-0.22467109560966492,
1.1143561601638794,
1.028770089149475,
-0.7059764862060547,
-0.08063248544931412,
-0.026719272136688232,
0.3685728013515... |
func (o *CopyRecipeToMyRecipesWithChangesParams) SetJSONBody(jSONBody *models.Recipe) {
o.JSONBody = jSONBody
} | [
-1.0843794345855713,
-0.3375799357891083,
0.49436458945274353,
0.02559761144220829,
-1.088783621788025,
-0.7522445321083069,
0.03703545778989792,
-0.15642428398132324,
0.9747883677482605,
0.9710513949394226,
-1.136405348777771,
0.3562588393688202,
-0.3075849711894989,
0.8430549502372742,
... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WithRecipeID(recipeID string) *CopyRecipeToMyRecipesWithChangesParams {
o.SetRecipeID(recipeID)
return o
} | [
-0.16629651188850403,
-0.3661257028579712,
0.19439725577831268,
-0.2736317813396454,
-1.3557713031768799,
-0.06734069436788559,
0.004276239778846502,
0.4426176846027374,
1.283565640449524,
1.6085444688796997,
-0.21782706677913666,
0.013398705050349236,
0.5641990900039673,
0.689810276031494... |
func (o *CopyRecipeToMyRecipesWithChangesParams) SetRecipeID(recipeID string) {
o.RecipeID = recipeID
} | [
-0.5123146772384644,
-0.20955754816532135,
0.1991928517818451,
0.19101160764694214,
-1.241133213043213,
0.2671670615673065,
0.034679681062698364,
0.9972864389419556,
0.8217117190361023,
1.4319207668304443,
-0.3027452528476715,
0.47480878233909607,
0.09683182090520859,
1.3310130834579468,
... |
func (o *CopyRecipeToMyRecipesWithChangesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if o.JSONBody != nil {
if err := r.SetBodyParam(o.JSONBody); err != nil {
return err
}
}
// path param reci... | [
-1.077008605003357,
-0.18355676531791687,
0.9310333728790283,
-0.30666327476501465,
0.3632727563381195,
-0.45790740847587585,
0.8622263073921204,
0.36399152874946594,
-0.08598361164331436,
0.7555723190307617,
0.27253586053848267,
0.3016907572746277,
-0.2520446479320526,
0.27566587924957275... |
func initializedBaseTokenSource() (oauth2.TokenSource, error) {
baseTokenSourceOnce.Do(func() {
baseTokenSource, baseTokenSourceErr = google.DefaultTokenSource(context.Background(), cloudPlatformScope)
})
return baseTokenSource, baseTokenSourceErr
} | [
-0.5180194973945618,
-0.32616016268730164,
0.12281675636768341,
-0.46944093704223633,
0.4888494312763214,
-0.7407718300819397,
-0.7227675914764404,
0.06647230684757233,
-0.027931585907936096,
-0.24552105367183685,
-1.541568636894226,
1.2422698736190796,
0.01892411708831787,
0.3735058307647... |
func (c *Credentials) TokenSource(ctx context.Context) (oauth2.TokenSource, error) {
switch c.Type {
case CredentialsTypeADC:
return initializedBaseTokenSource()
case CredentialsTypeServiceAccountJSON:
cred, err := google.CredentialsFromJSON(ctx, c.ServiceAccountJSON, cloudPlatformScope)
if err != nil {
ret... | [
-0.5148447155952454,
-0.18224909901618958,
0.20111247897148132,
-0.4007873237133026,
-0.37679049372673035,
-0.5441215634346008,
-0.21352697908878326,
0.02433205582201481,
0.48426076769828796,
0.31241580843925476,
-0.33992379903793335,
1.2104299068450928,
-0.3493492901325226,
0.208728671073... |
func New(
ctx context.Context,
ctrlClient ctrlclient.Client,
namespacedName types.NamespacedName,
projectID string,
instanceID string,
credentials *Credentials,
recorder record.EventRecorder,
opts ...Option,
) (Syncer, error) {
ts, err := credentials.TokenSource(ctx)
if err != nil {
return nil, err
}
log... | [
0.9292974472045898,
0.08559431880712509,
0.6029115915298462,
-0.44020703434944153,
-0.707775890827179,
0.4493376612663269,
-0.13697019219398499,
-0.36435845494270325,
-0.6001187562942505,
0.020657189190387726,
-0.187073215842247,
0.6132280826568604,
-0.0005691390251740813,
0.71507054567337... |
func (s *syncer) UpdateTarget(projectID, instanceID string, credentials *Credentials) bool {
updated := false
if s.projectID != projectID {
updated = true
s.projectID = projectID
}
if s.instanceID != instanceID {
updated = true
s.instanceID = instanceID
}
// TODO: Consider deepCopy
if !reflect.DeepEqu... | [
-1.3574470281600952,
-0.38766756653785706,
0.5086413621902466,
-0.5558307766914368,
-0.2900868058204651,
0.5046650767326355,
-0.34644579887390137,
0.14090575277805328,
-0.08111551403999329,
0.2581554055213928,
0.7582963109016418,
0.651993989944458,
-0.676314651966095,
-0.33889228105545044,... |
func NewPoller(url string, interval time.Duration, out chan PollMsg, shutdown chan *sync.WaitGroup) *Poller {
return &Poller{
URL: url,
Interval: interval,
Out: out,
Shutdown: shutdown,
}
} | [
-0.5748569965362549,
-0.4180571138858795,
0.34784746170043945,
0.34870782494544983,
-1.0294628143310547,
0.6429900527000427,
-0.533840537071228,
-0.11199072003364563,
-0.25394755601882935,
-0.013905121944844723,
0.5242012143135071,
-0.2714419662952423,
-0.7522181868553162,
0.51654648780822... |
func (p *Poller) Start() {
go func(url string, interval time.Duration, out chan<- PollMsg, shutdown <-chan *sync.WaitGroup) {
wg := &sync.WaitGroup{}
defer func() {
wg.Done()
}()
ticker := time.NewTicker(interval)
msg := PollMsg{}
resp, err := http.Get(url)
if err != nil {
msg.Error = append(msg.E... | [
-0.47493597865104675,
0.1847252994775772,
0.7601635456085205,
-0.3515227735042572,
-0.47216305136680603,
0.3886912763118744,
-0.12090784311294556,
-0.5661598443984985,
-1.204879641532898,
0.7257331013679504,
0.26650455594062805,
0.598231852054596,
-0.17188459634780884,
0.9946861863136292,
... |
func (p *Poller) Stop() {
wg := &sync.WaitGroup{}
wg.Add(1)
p.Shutdown <- wg
wg.Wait()
} | [
-1.1747187376022339,
0.35257208347320557,
0.4858645796775818,
0.4351607859134674,
0.09460553526878357,
1.1920802593231201,
-0.3440845012664795,
0.2328926920890808,
-0.6533108353614807,
0.5912506580352783,
-0.2474808692932129,
-0.5336244702339172,
-1.3419206142425537,
0.48578211665153503,
... |
func (r *inMemoryFileshareRepository) GetAndDelete(key string) (PendingFileshare, bool) {
r.Lock()
defer r.Unlock()
fileshare, ok := r.pendingFileshares[key]
if !ok {
return PendingFileshare{}, false
}
delete(r.pendingFileshares, key)
return fileshare, true
} | [
0.20913688838481903,
-0.234892338514328,
0.666978657245636,
0.1600094884634018,
-0.18858426809310913,
-0.77921462059021,
-0.31460651755332947,
0.7981034517288208,
-0.4140055775642395,
0.02871638536453247,
0.8990612626075745,
-0.7549828886985779,
-1.2006057500839233,
0.5456250905990601,
0... |
func (r *inMemoryFileshareRepository) Set(key string, fd PendingFileshare) bool {
r.Lock()
defer r.Unlock()
if _, ok := r.pendingFileshares[key]; ok {
return false // Key already exists.
}
if r.pendingFileshares == nil {
r.pendingFileshares = make(map[string]PendingFileshare)
}
r.pendingFileshares[key] = ... | [
-0.35293474793434143,
0.12158668041229248,
0.5268800258636475,
-0.7300552129745483,
-0.20187929272651672,
0.10405843704938889,
-0.3992345333099365,
0.4617682099342346,
-1.3983021974563599,
-0.37477874755859375,
0.49571317434310913,
-0.7618921995162964,
-0.6822441220283508,
0.68279767036437... |
func New(t LoggerReporter, baseURL string) *Expect {
return WithConfig(Config{
BaseURL: baseURL,
Reporter: NewAssertReporter(t),
Printers: []Printer{
NewCompactPrinter(t),
},
})
} | [
0.23500658571720123,
-1.0386738777160645,
0.17584963142871857,
-0.6185033917427063,
-0.6051079630851746,
-0.48283517360687256,
-0.4405739903450012,
0.5035901665687561,
-0.5450511574745178,
-0.3631461560726166,
0.24480421841144562,
0.3366113007068634,
0.03128800168633461,
0.8464502096176147... |
func (e *Expect) Env() *Environment {
return e.chain.env()
} | [
0.21339571475982666,
-0.2720499634742737,
0.24474774301052094,
0.4510034918785095,
0.5222309827804565,
0.8089795112609863,
0.5253828763961792,
-0.2744046151638031,
-0.20935600996017456,
-0.4716566503047943,
1.0234878063201904,
1.9635653495788574,
-0.25235334038734436,
0.27910760045051575,
... |
func (e *Expect) Request(method, path string, pathargs ...interface{}) *Request {
opChain := e.chain.enter("Request(%q)", method)
defer opChain.leave()
req := newRequest(opChain, e.config, method, path, pathargs...)
for _, builder := range e.builders {
builder(req)
}
for _, matcher := range e.matchers {
re... | [
-0.7909215092658997,
0.20953354239463806,
0.45021525025367737,
0.7008071541786194,
0.6841627359390259,
-0.13306991755962372,
0.27122962474823,
-0.12831170856952667,
0.018041374161839485,
-1.071273922920227,
0.8729147911071777,
1.0610400438308716,
-0.34705761075019836,
0.428753137588501,
... |
func (e *Expect) OPTIONS(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodOptions, path, pathargs...)
} | [
-0.6376730799674988,
0.24938683211803436,
0.43616801500320435,
-0.5807189345359802,
0.6815592646598816,
-0.5260975360870361,
-0.4932926893234253,
-0.9734131693840027,
-0.14839226007461548,
-0.2775592505931854,
1.1752833127975464,
0.6028376221656799,
0.04645484685897827,
0.24529054760932922... |
func (e *Expect) HEAD(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodHead, path, pathargs...)
} | [
-0.8314821124076843,
-0.20618057250976562,
0.4517861306667328,
0.28312331438064575,
0.20241953432559967,
0.7063930034637451,
-0.5118725299835205,
-0.4901541471481323,
-0.17081114649772644,
0.06224723532795906,
0.8172721266746521,
1.3753042221069336,
-0.03482476994395256,
-0.285383492708206... |
func (e *Expect) GET(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodGet, path, pathargs...)
} | [
-0.4406648874282837,
-0.3458932042121887,
0.4192853271961212,
-0.7698472142219543,
0.644432783126831,
-0.2674645483493805,
-0.5751715898513794,
-0.48357540369033813,
-0.9177665114402771,
-0.32341259717941284,
0.7801507115364075,
1.532010555267334,
-0.09273149818181992,
-0.14887802302837372... |
func (e *Expect) POST(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodPost, path, pathargs...)
} | [
-0.18236735463142395,
-0.2246500700712204,
0.40080228447914124,
0.27393171191215515,
-0.1075320616364479,
0.09931885451078415,
-0.38972169160842896,
-0.38263270258903503,
-0.674405038356781,
-1.066770076751709,
0.46203622221946716,
0.2707137167453766,
-0.2195388674736023,
0.318415105342865... |
func (e *Expect) PUT(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodPut, path, pathargs...)
} | [
-0.5916593074798584,
-0.2111656665802002,
0.3607873022556305,
-1.067299246788025,
0.0641203299164772,
0.349810928106308,
0.2508113384246826,
-0.19441382586956024,
-0.7897619009017944,
0.01657768338918686,
0.5733160972595215,
0.9452841877937317,
-0.6103914380073547,
-0.27785199880599976,
... |
func (e *Expect) PATCH(path string, pathargs ...interface{}) *Request {
return e.Request(http.MethodPatch, path, pathargs...)
} | [
-0.4151361286640167,
-0.4985347390174866,
0.37168756127357483,
-0.7324657440185547,
-0.4229319989681244,
0.3802002966403961,
-0.2212076187133789,
-0.07180111110210419,
-0.06924039125442505,
-0.3499695360660553,
0.8818880319595337,
1.5126160383224487,
0.04943195730447769,
0.2710345089435577... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.