text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func New(options ...Option) *Router {
serveMux := mux.NewRouter()
chain := filter.NewChain()
chain.Add(serveMux)
r := &Router{
serveMux: serveMux,
filterChain: chain,
}
for _, opt := range options {
opt(r)
}
return r
} | [
-0.4820680618286133,
0.05544089898467064,
0.4524872303009033,
0.5365583300590515,
-0.1000630185008049,
-0.15211842954158783,
-0.2280927449464798,
-0.4048958718776703,
-0.7853835225105286,
-0.14075277745723724,
0.034445423632860184,
1.047908067703247,
-0.1300656795501709,
0.4983058273792267... |
func (h *Router) Handle(method, pattern string, handler http.Handler) {
r := h.serveMux.NewRoute()
r.Handler(handler)
if method != "" && method != "*" {
r.Methods(method)
}
if strings.HasSuffix(pattern, "*") {
r.PathPrefix(pattern[:len(pattern)-1])
} else {
r.Path(pattern)
}
// log endpoint
endpoint := f... | [
-0.44961389899253845,
0.5944699645042419,
0.8064383864402771,
0.004869985859841108,
0.39634522795677185,
0.34817010164260864,
0.18697138130664825,
0.26936009526252747,
-0.3059261739253998,
-0.7291742563247681,
0.07717299461364746,
0.5917097330093384,
-0.08412904292345047,
0.109704442322254... |
func (h *Router) PathPrefix() string {
return h.pathPrefix
} | [
0.215774267911911,
-0.14846208691596985,
0.45187458395957947,
1.0308880805969238,
0.1545918881893158,
0.605613112449646,
0.2812732458114624,
0.5714670419692993,
0.18852844834327698,
0.2872300148010254,
-0.40748831629753113,
-0.269459068775177,
-0.7233556509017944,
0.4032851457595825,
0.6... |
func (h *Router) Endpoints() []string {
return h.endpoints
} | [
-0.02231016382575035,
0.04423891007900238,
0.09999115020036697,
0.8484464287757874,
1.0870447158813477,
0.6041564345359802,
-0.8030269145965576,
0.6456510424613953,
0.5619434118270874,
-0.03827347233891487,
-0.3461470603942871,
0.3538118898868561,
-0.7945294380187988,
0.18377546966075897,
... |
func (h *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if h.pathPrefix != "" {
p := strings.TrimPrefix(r.URL.Path, h.pathPrefix)
if p == "" {
p = "/"
}
r.URL.Path = p
}
h.filterChain.ServeHTTP(w, r)
} | [
0.2443443387746811,
0.22181665897369385,
0.5262681245803833,
0.2733376622200012,
0.12623925507068634,
-0.20584872364997864,
0.5862345695495605,
-0.03565937280654907,
-0.33671054244041443,
0.43176260590553284,
0.4907425045967102,
0.35597679018974304,
-0.31169959902763367,
0.4993396103382110... |
func (h *Router) AddFilter(f filter.Filter) {
// Filter f is always added before the last filter, which is server mux.
h.filterChain.Insert(f, h.filterChain.Length()-1)
} | [
-0.8126830458641052,
0.9583402872085571,
0.7335382103919983,
1.2206523418426514,
0.3558003008365631,
0.10374552011489868,
-0.780102550983429,
-0.13804523646831512,
-0.3189808428287506,
-1.0735375881195068,
-0.5256940722465515,
0.5491353273391724,
-0.3631998598575592,
0.8294104337692261,
... |
func WithPathPrefix(prefix string) Option {
prefix = strings.TrimSpace(prefix)
if prefix != "" {
// Clean and add leading slash if necessary
prefix = path.Clean(prefix)
if prefix[0] != '/' {
prefix = "/" + prefix
}
}
return func(r *Router) {
r.pathPrefix = prefix
}
} | [
0.2911091446876526,
-0.7529786825180054,
0.7826807498931885,
-0.3270390033721924,
-0.7891162633895874,
-0.5074937343597412,
0.45135006308555603,
-0.3721057176589966,
0.630890429019928,
0.569634199142456,
-0.5416837930679321,
-0.7266068458557129,
0.5744786858558655,
0.14543326199054718,
-... |
func PathParams(r *http.Request) map[string]string {
return mux.Vars(r)
} | [
-1.2432684898376465,
-0.6523708701133728,
0.5226812362670898,
-0.052695080637931824,
-0.8998057842254639,
0.28879493474960327,
0.10666558146476746,
-0.6500139236450195,
-0.6402527689933777,
0.8080868124961853,
-0.17861755192279816,
-0.5414315462112427,
-0.18880020081996918,
1.0449090003967... |
func (c *Client) AddDraftAppVersionResourceMappings(ctx context.Context, params *AddDraftAppVersionResourceMappingsInput, optFns ...func(*Options)) (*AddDraftAppVersionResourceMappingsOutput, error) {
if params == nil {
params = &AddDraftAppVersionResourceMappingsInput{}
}
result, metadata, err := c.invokeOperati... | [
-1.3808542490005493,
0.06868641078472137,
0.7149403691291809,
0.2967226207256317,
-0.26472365856170654,
0.9363816380500793,
0.1815924346446991,
-0.6252760887145996,
1.0919263362884521,
-0.07549309730529785,
-0.7759422659873962,
0.1622362732887268,
0.47562938928604126,
0.1194237768650055,
... |
func (s ServerDHParamsFail) construct() ServerDHParamsClass { return &s } | [
0.20963530242443085,
-0.224385067820549,
0.1544821411371231,
0.27692854404449463,
0.022389069199562073,
0.875700831413269,
-0.3164297342300415,
-0.6868497729301453,
-1.2444398403167725,
-0.7084993720054626,
-0.016686011105775833,
-0.03011161834001541,
-0.08672519773244858,
1.69673907756805... |
func (s ServerDHParamsOk) construct() ServerDHParamsClass { return &s } | [
0.38787269592285156,
-0.4318837821483612,
0.15249782800674438,
0.03904490917921066,
0.03750648349523544,
0.597808301448822,
-0.028552008792757988,
-0.47023990750312805,
-1.213710904121399,
-0.23270803689956665,
0.04536692053079605,
-0.3027310073375702,
-0.003112585749477148,
1.852194428443... |
func DecodeServerDHParams(buf *bin.Buffer) (ServerDHParamsClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case ServerDHParamsFailTypeID:
// Decoding server_DH_params_fail#79cb045d.
v := ServerDHParamsFail{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Error... | [
-0.16973160207271576,
-0.6561815142631531,
0.480823278427124,
0.14647506177425385,
-0.2846456468105316,
0.3448651134967804,
0.18118639290332794,
-0.830128014087677,
-0.12359891086816788,
-0.2787739932537079,
-0.7514241933822632,
0.5386329889297485,
-0.6295212507247925,
1.0728673934936523,
... |
func (b *ServerDHParamsBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode ServerDHParamsBox to nil")
}
v, err := DecodeServerDHParams(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.Server_DH_Params = v
return nil
} | [
0.09447755664587021,
0.5745055675506592,
0.4501682221889496,
0.2904513478279114,
0.2550751566886902,
0.3863879442214966,
0.17845278978347778,
-0.566172182559967,
-0.6301111578941345,
-0.4911968410015106,
-0.8543703556060791,
0.7341837882995605,
-0.560309886932373,
1.6794885396957397,
0.0... |
func (b *ServerDHParamsBox) Encode(buf *bin.Buffer) error {
if b == nil || b.Server_DH_Params == nil {
return fmt.Errorf("unable to encode ServerDHParamsClass as nil")
}
return b.Server_DH_Params.Encode(buf)
} | [
-0.35150983929634094,
0.43239521980285645,
0.40636053681373596,
0.7295479774475098,
0.5204700231552124,
0.8334003686904907,
0.16557368636131287,
-1.0660865306854248,
-0.3544237017631531,
-0.11289049685001373,
-0.34012219309806824,
0.6059406995773315,
-0.554743230342865,
1.9523001909255981,... |
func (p *PlayerEntity) Move(offset shared.FloatVector) {
p.position.X += offset.X
p.position.Y += offset.Y
} | [
-1.291285514831543,
-0.8471037149429321,
0.7483134269714355,
-0.4029989242553711,
0.5016291737556458,
1.489763617515564,
-0.20674951374530792,
-0.017398690804839134,
0.14962488412857056,
-0.1505521535873413,
0.02192823961377144,
-0.35660549998283386,
-0.012060369364917278,
-0.6171692609786... |
func CreatePlayerEntity(id int64, initialPos shared.FloatVector) *PlayerEntity {
return &PlayerEntity{
position: initialPos,
entityId: id,
lastSeq: 0,
}
} | [
-0.40605464577674866,
-1.923515796661377,
0.4849345088005066,
-0.1735420525074005,
0.7544000148773193,
0.6541329622268677,
-0.003304182318970561,
-0.20070992410182953,
0.16600415110588074,
0.28394371271133423,
-0.2371436506509781,
-1.1955268383026123,
-0.9511481523513794,
0.465558618307113... |
func EncodeAccelVP8180PI420(ctx context.Context, s *testing.State) {
encode.RunAllAccelVideoTests(ctx, s, encode.TestOptions{Profile: videotype.VP8Prof, Params: encode.Tulip180P, PixelFormat: videotype.I420, InputMode: encode.SharedMemory})
} | [
0.7805801630020142,
-0.37878233194351196,
0.20638270676136017,
-1.1523497104644775,
0.6320236921310425,
0.10136012732982635,
0.1842150092124939,
-0.0017186367185786366,
1.397747278213501,
0.7319733500480652,
-0.37365245819091797,
1.5499902963638306,
-0.17795924842357635,
0.3166606426239013... |
func TestInsert(t *testing.T) {
b := New()
t.Log(b.Delete(5))
t.Log(b)
b.Insert(1)
t.Log(b.Delete(11))
t.Log(b)
t.Log(b.Delete(1))
t.Log(b)
b.Insert(3)
t.Log(b)
b.Insert(4)
b.Insert(2)
b.Insert(5)
t.Log(b)
t.Log(b.Find(3))
t.Log(b.Find(30))
t.Log(b.Delete(4))
t.Log(b)
t.Log(b.Delete(5))
t.Log(b)
... | [
-0.1311018466949463,
0.7382857799530029,
0.8817046880722046,
0.5112085342407227,
0.5265018939971924,
-0.3359196186065674,
1.3484488725662231,
-0.4264380633831024,
0.004328333307057619,
-0.04120051488280296,
-0.5405926704406738,
-0.366900771856308,
-1.2066086530685425,
0.08870843797922134,
... |
func NewCmdPreviewCreate() (*cobra.Command, *Options) {
o := &Options{}
cmd := &cobra.Command{
Use: "create",
Short: "Creates a preview",
Long: cmdLong,
Example: fmt.Sprintf(cmdExample, rootcmd.BinaryName),
Run: func(cmd *cobra.Command, args []string) {
err := o.Run()
helper.CheckErr(err)
... | [
0.11435288935899734,
-0.46772709488868713,
0.6412654519081116,
-0.13403525948524475,
-0.9407867789268494,
-0.13066650927066803,
-0.3890661299228668,
0.31199774146080017,
-0.3252481520175934,
-0.8551949262619019,
0.3034798204898834,
-0.32148677110671997,
-0.14952394366264343,
0.553662180900... |
func (o *Options) Run() error {
err := o.Validate()
if err != nil {
return errors.Wrapf(err, "failed to validate options")
}
pr, err := o.discoverPullRequest()
if err != nil {
return errors.Wrapf(err, "failed to discover pull request")
}
log.Logger().Infof("found PullRequest %s", pr.Link)
preview, _, err... | [
0.18822796642780304,
0.3197680413722992,
0.7240318059921265,
-0.20890237390995026,
0.5938796997070312,
0.031111134216189384,
0.5006916522979736,
0.1885206550359726,
-0.09063471853733063,
-0.04744532331824303,
-0.053430281579494476,
-0.43791189789772034,
-0.4413851201534271,
0.0452062375843... |
func (o *Options) Validate() error {
err := o.Options.Validate()
if err != nil {
return errors.Wrapf(err, "failed to validate repository options")
}
if o.PreviewHelmfile == "" {
return options.MissingOption("helmfile")
}
if o.Number <= 0 {
prName := os.Getenv("PULL_NUMBER")
if prName != "" {
o.Number,... | [
0.20040850341320038,
0.3773159682750702,
0.5369254946708679,
-0.13060171902179718,
0.5401701331138611,
-0.12713386118412018,
0.26746833324432373,
-0.5418144464492798,
0.10581698268651962,
-0.7742813229560852,
0.5563052296638489,
-0.11795889586210251,
-0.03442937508225441,
1.031665325164795... |
func InfoFromPath(configFilePath string) (*Info, error) {
configSpecDir := filepath.Dir(configFilePath)
repo := filepath.Base(configSpecDir)
if repo == "." || repo == "/" {
return nil, fmt.Errorf("could not extract repo from '%s' (expected path like '.../ORG/REPO/ORGANIZATION-COMPONENT-BRANCH.yaml", configFilePath... | [
0.3865368664264679,
-0.8489908576011658,
0.37796178460121155,
-0.6068174242973328,
-0.39113932847976685,
0.02477392740547657,
0.13218331336975098,
0.0775582492351532,
-1.1651854515075684,
0.5598410964012146,
0.049614787101745605,
-0.7048874497413635,
0.16918262839317322,
-0.488011002540588... |
func OperateOnCIOperatorConfig(path string, callback ConfigIterFunc) error {
info, err := InfoFromPath(path)
if err != nil {
logrus.WithField("source-file", path).WithError(err).Error("Failed to resolve info from CI Operator configuration path")
return err
}
jobConfig, err := readCiOperatorConfig(path, *info)
... | [
-0.9554461240768433,
-0.31415146589279175,
0.6581754684448242,
0.0808417797088623,
-0.8334046602249146,
-0.24375176429748535,
1.1829928159713745,
1.111840844154358,
-1.1566485166549683,
1.0523074865341187,
0.005932270083576441,
-1.2531828880310059,
-0.3397778272628784,
0.21310082077980042,... |
func OperateOnCIOperatorConfigDir(configDir string, callback ConfigIterFunc) error {
return OperateOnCIOperatorConfigSubdir(configDir, "", callback)
} | [
-1.4828518629074097,
0.061808209866285324,
0.22535119950771332,
0.907745361328125,
-1.3795664310455322,
-0.8384644985198975,
1.133363127708435,
1.2166380882263184,
-0.25990161299705505,
0.4522326588630676,
0.36858415603637695,
-1.0156910419464111,
0.24961403012275696,
1.1053500175476074,
... |
func New(s pb.AppServer) (engine *bm.Engine, err error) {
var (
cfg bm.ServerConfig
bbr bbr.Config
keep keepConfig
ct paladin.TOML
)
err = paladin.Get("http.toml").Unmarshal(&ct)
helper.Panic(err)
err = config.Env(&ct, &cfg, "Server")
helper.Panic(err)
err = config.Env(&ct, &bbr, "Bbr")
helper.Panic... | [
0.7884904742240906,
-0.3242775797843933,
0.8330346941947937,
0.5066221356391907,
0.04190002754330635,
0.13709670305252075,
-0.49158328771591187,
-0.16244351863861084,
-0.5637969374656677,
0.1307806372642517,
0.3219560980796814,
0.7769188284873962,
0.030333025380969048,
0.7576234340667725,
... |
func keepAlive(cfg *keepConfig) bm.HandlerFunc {
return func(c *bm.Context) {
header := c.Writer.Header()
if cfg.Keep == "also" {
header.Set("Connection", "keep-alive")
} else {
header.Set("Keep-Alive", fmt.Sprintf("timeout=%s", cfg.Keep))
}
c.Next()
}
} | [
0.16388371586799622,
-0.9879963397979736,
0.6863898038864136,
0.33090463280677795,
0.02905457839369774,
-0.11198151111602783,
-0.00014007309800945222,
-0.13404959440231323,
-0.7906651496887207,
1.2344692945480347,
0.10291443020105362,
-1.1011481285095215,
-0.6468257308006287,
-0.3807728588... |
func Index(w http.ResponseWriter, r *http.Request) {
// Fill out the page data for index
pd := PageData{
Title: "Index Page",
Body: "This is the body of the index page.",
}
// Render a template with our page data
tmpl, err := render(pd)
// if we get an error, write it out and exit
if err != nil {
w.Writ... | [
0.12652704119682312,
-0.13870975375175476,
0.5187952518463135,
-0.389329731464386,
0.09033554792404175,
0.5508015751838684,
0.09348594397306442,
0.8299649357795715,
-0.4440384805202484,
0.34321311116218567,
0.4009639024734497,
0.2449752688407898,
-0.26975542306900024,
-0.46960145235061646,... |
func Contains(h []string, n string) bool {
for _, s := range h {
if s == n {
return true
}
}
return false
} | [
0.17335741221904755,
-0.5022856593132019,
0.29299768805503845,
0.030689671635627747,
-0.2617190480232239,
-0.15191993117332458,
-1.7227782011032104,
-0.33347079157829285,
-0.9527233242988586,
0.19833920896053314,
-0.4329555630683899,
0.5918959975242615,
-0.15969720482826233,
0.524199128150... |
func ContainsInt(sl []int, v int) bool {
for _, vv := range sl {
if vv == v {
return true
}
}
return false
} | [
0.5129548907279968,
-0.3737228810787201,
0.30609792470932007,
-0.5071436166763306,
-0.6344860792160034,
0.41584834456443787,
-1.164099931716919,
-0.7337188124656677,
0.22418104112148285,
0.7445405125617981,
-0.898878276348114,
0.2021574229001999,
-0.7130894660949707,
-0.1546785682439804,
... |
func (z data) Msgsize() (s int) {
s = msgp.MapHeaderSize
if z != nil {
for zobc, zsnv := range z {
_ = zsnv
s += msgp.StringPrefixSize + len(zobc) + msgp.GuessSize(zsnv)
}
}
return
} | [
-0.07027323544025421,
0.3934897482395172,
0.6431558728218079,
-0.21259784698486328,
-0.2056622952222824,
-0.4649474024772644,
0.20622345805168152,
-0.23487655818462372,
0.8566380739212036,
-0.2705013155937195,
-0.35315242409706116,
0.024978995323181152,
-0.8275340795516968,
0.5590925216674... |
func HasStatusCode(err error, statusCode ...int) bool {
e, ok := err.(statusCodedError)
if !ok {
return false
}
for _, num := range statusCode {
if e.statusCode == num {
return true
}
}
return false
} | [
-0.13585451245307922,
-0.44892093539237976,
0.3500966429710388,
1.358819842338562,
-0.26945945620536804,
-0.913617730140686,
-0.7377737760543823,
1.372045636177063,
0.012386055663228035,
-0.12216426432132721,
-0.6462134122848511,
-0.2541566491127014,
0.21272264420986176,
0.448091983795166,... |
func IsErrInvalidRequest(err error) bool {
return HasStatusCode(err, 400)
} | [
-1.168516993522644,
-0.2805841565132141,
0.393270879983902,
0.7940639853477478,
-0.5535379648208618,
0.3900821805000305,
-1.4839744567871094,
0.3195030987262726,
0.5452176332473755,
-0.4589526951313019,
-0.04513886198401451,
-0.5291403532028198,
-0.717435359954834,
0.8773868083953857,
-0... |
func IsErrUnauthorized(err error) bool {
return HasStatusCode(err, 401)
} | [
-1.4391049146652222,
-0.2130017727613449,
0.20514076948165894,
1.5399571657180786,
-1.1106984615325928,
-0.43565917015075684,
-0.28594523668289185,
1.1853986978530884,
0.7633729577064514,
0.1622776985168457,
0.04477374255657196,
1.1098337173461914,
-0.3248749375343323,
0.6006798148155212,
... |
func IsErrForbidden(err error) bool {
return HasStatusCode(err, 403)
} | [
-0.6051246523857117,
0.4322611093521118,
0.059510037302970886,
1.254044532775879,
-0.7933067679405212,
-0.4534648656845093,
-0.6992223262786865,
-0.11687859892845154,
0.3753993809223175,
0.009977568872272968,
0.06211618334054947,
0.06105528399348259,
-0.4181164801120758,
0.9748722910881042... |
func IsErrUnique(err error) bool {
return HasErrorNum(err, 1210)
} | [
-1.044326663017273,
0.47664976119995117,
0.37919819355010986,
0.2113427370786667,
-0.00964469276368618,
-0.6280665397644043,
-0.5222579836845398,
0.5481188893318176,
0.5744974613189697,
0.37203463912010193,
-1.2620010375976562,
0.1733880341053009,
-0.49641916155815125,
0.5048327445983887,
... |
func IsErrNotFound(err error) bool {
return HasStatusCode(err, 404) || HasErrorNum(err, 1202, 1203)
} | [
-1.6149150133132935,
-0.156404510140419,
0.14488564431667328,
0.37125277519226074,
0.08819463849067688,
0.10973944514989853,
-0.28845295310020447,
0.5038154721260071,
0.75168377161026,
0.074338398873806,
-0.15168777108192444,
-0.024167582392692566,
-0.25529009103775024,
1.3989828824996948,... |
func (helpers *Helpers) GetEnv() string {
env := os.Getenv(constants.EnvVariableName)
if len(env) == 0 {
env = constants.ProductionEnv
}
return env
} | [
-0.3557050824165344,
-0.29205968976020813,
0.348712295293808,
1.2162033319473267,
0.4701543152332306,
0.5207774639129639,
0.5703738331794739,
-0.4607621431350708,
-1.0203841924667358,
0.24998518824577332,
0.64670729637146,
1.3197119235992432,
-0.04692329838871956,
0.12274816632270813,
0.... |
func (helpers *Helpers) GetCurrentUserHomeDir() (string, error) {
user, err := user.Current()
if err != nil {
return "", err
}
return user.HomeDir, nil
} | [
-0.17729002237319946,
-0.9626070261001587,
0.4919341206550598,
1.3885090351104736,
-1.3613295555114746,
0.5879434943199158,
1.067016839981079,
-0.42294928431510925,
-0.18314756453037262,
-0.07582253217697144,
0.6251152157783508,
1.0033425092697144,
-0.2788374423980713,
0.19857078790664673,... |
func (helpers *Helpers) Exists(pathToCheck string) bool {
_, err := os.Stat(pathToCheck)
if err != nil && os.IsNotExist(err) {
return false
}
return true
} | [
-0.4888276755809784,
-0.14288334548473358,
0.40188276767730713,
-0.044878795742988586,
1.6096100807189941,
1.2536582946777344,
0.2530536651611328,
0.0019234559731557965,
-1.1065232753753662,
-0.6429566740989685,
0.4669906497001648,
-0.6362401843070984,
0.4320586621761322,
0.468667775392532... |
func (helpers *Helpers) EnsureDirExists(dir string, fileMode os.FileMode) error {
if !helpers.Exists(dir) {
return os.MkdirAll(dir, fileMode)
}
return nil
} | [
-0.18368978798389435,
-0.31065693497657776,
0.4913538992404938,
-0.10357973724603653,
0.9079610109329224,
0.8155809640884399,
-0.028546523302793503,
-0.4174746572971344,
-0.18076522648334503,
-0.8288400769233704,
-0.5640049576759338,
-0.7267792820930481,
0.17929112911224365,
-0.26703664660... |
func NewHashMap(name string, client *Client) HashMap {
return HashMap{name: name, c: client}
} | [
1.1407570838928223,
0.06465673446655273,
0.2589136064052582,
-0.009035106748342514,
-0.925204873085022,
0.5761879682540894,
-0.5468884706497192,
-0.18496519327163696,
-0.5823144316673279,
0.4807501435279846,
0.06463516503572464,
0.38799262046813965,
-0.38542866706848145,
-0.456914514303207... |
func (hm HashMap) Name() string { return hm.name } | [
-0.1929650753736496,
-0.7206242084503174,
0.12176492810249329,
0.5987344980239868,
-0.46930497884750366,
0.5624887943267822,
-0.14079934358596802,
-0.18795593082904816,
-0.4722638726234436,
0.5143126249313354,
0.07967492192983627,
-0.2639516294002533,
-0.30381426215171814,
0.56719261407852... |
func (hm HashMap) Delete(ctx context.Context, fields ...string) (int64, error) {
req := newRequestSize(2+len(fields), "\r\n$4\r\nHDEL\r\n$")
req.addStringAndStrings(hm.name, fields)
return hm.c.cmdInt(ctx, req)
} | [
-0.09952148050069809,
1.0103679895401,
0.7865006923675537,
0.33683061599731445,
0.8969261646270752,
0.4212730824947357,
0.20198780298233032,
-0.07366634160280228,
-0.6134119629859924,
-0.0796041414141655,
-0.5589767694473267,
0.12668204307556152,
-1.9545767307281494,
-0.25693485140800476,
... |
func (hm HashMap) Exists(ctx context.Context, field string) (bool, error) {
req := newRequest("*3\r\n$7\r\nHEXISTS\r\n$")
req.addString2(hm.name, field)
res, err := hm.c.cmdInt(ctx, req)
return res == 1, err
} | [
-1.0985382795333862,
0.47142329812049866,
0.8010119795799255,
-0.10137496143579483,
0.5855532288551331,
0.9257919788360596,
-1.0792852640151978,
-0.2686079144477844,
-0.4912255108356476,
-0.25660762190818787,
-0.36351969838142395,
0.04412432387471199,
-1.2274137735366821,
0.089695908129215... |
func (hm HashMap) Get(ctx context.Context, field string) (string, error) {
req := newRequest("*3\r\n$4\r\nHGET\r\n$")
req.addString2(hm.name, field)
return hm.c.cmdString(ctx, req)
} | [
-0.6772667765617371,
0.5307608246803284,
0.683208167552948,
-0.03227459639310837,
0.485296368598938,
0.30788421630859375,
-0.8722050786018372,
-0.912132740020752,
-0.6400474309921265,
-0.15901391208171844,
0.1944650560617447,
0.9902445077896118,
-1.3837732076644897,
-0.19186978042125702,
... |
func (hm HashMap) GetAll(ctx context.Context) (map[string]string, error) {
req := newRequest("*2\r\n$7\r\nHGETALL\r\n$")
req.addString(hm.name)
ss, err := hm.c.cmdStrings(ctx, req)
if err != nil {
return nil, err
}
res := make(map[string]string, len(ss)/2)
for i := 0; i < len(ss); i += 2 {
res[ss[i]] = ss[i+... | [
0.08932077139616013,
0.20730838179588318,
0.8990266919136047,
0.7977916598320007,
0.07867304235696793,
0.1348143368959427,
-0.6586769819259644,
-0.4371888339519501,
-0.053616657853126526,
-0.1897335946559906,
-0.296911358833313,
1.0723304748535156,
-1.1004421710968018,
0.665317714214325,
... |
func (hm HashMap) IncBy(ctx context.Context, field string, delta int64) (int64, error) {
req := newRequest("*4\r\n$7\r\nHINCRBY\r\n$")
req.addString2AndInt(hm.name, field, delta)
return hm.c.cmdInt(ctx, req)
} | [
-0.39895808696746826,
0.8802744746208191,
0.8711835741996765,
0.29852867126464844,
-0.22661921381950378,
0.18407772481441498,
0.6571117639541626,
-0.19761084020137787,
-1.1350975036621094,
-0.22463902831077576,
-0.12374579906463623,
-0.030200332403182983,
-1.9355528354644775,
-0.3695064485... |
func (hm HashMap) IncByFloat(ctx context.Context, field string, delta float64) (float64, error) {
req := newRequest("*4\r\n$12\r\nHINCRBYFLOAT\r\n$")
// TODO(oleg): must encode as float
req.addString2AndInt(hm.name, field, int64(delta))
return hm.c.cmdFloat(ctx, req)
} | [
0.2931559383869171,
1.1623562574386597,
0.8913652896881104,
0.2091195434331894,
0.175634503364563,
0.5977097749710083,
0.8034180402755737,
-0.5687649250030518,
-1.4922891855239868,
-0.8242225646972656,
-0.49650636315345764,
-0.08847694098949432,
-1.5317367315292358,
0.20330595970153809,
... |
func (hm HashMap) Keys(ctx context.Context) ([]string, error) {
req := newRequest("*2\r\n$5\r\nHKEYS\r\n$")
req.addString(hm.name)
return hm.c.cmdStrings(ctx, req)
} | [
-0.7216228246688843,
0.46735477447509766,
0.4017084836959839,
0.2890024781227112,
0.440182089805603,
-0.29290780425071716,
-1.2767364978790283,
-0.5376064777374268,
0.005429721437394619,
-0.0011005774140357971,
-0.4105741083621979,
0.5849056839942932,
-1.4063663482666016,
0.385195791721344... |
func (hm HashMap) Len(ctx context.Context) (int64, error) {
req := newRequest("*2\r\n$4\r\nHLEN\r\n$")
req.addString(hm.name)
return hm.c.cmdInt(ctx, req)
} | [
-0.003989802207797766,
0.4590829014778137,
0.39257338643074036,
0.35957765579223633,
0.32017797231674194,
-0.46391916275024414,
0.341506689786911,
-0.12055355310440063,
-0.6008191704750061,
-0.5716692209243774,
-0.9026951193809509,
0.2741500437259674,
-0.6069405674934387,
0.299858778715133... |
func (hm HashMap) MultiGet(ctx context.Context, fields ...string) ([]Value, error) {
req := newRequestSize(2+len(fields), "\r\n$5\r\nHMGET\r\n$")
req.addStringAndStrings(hm.name, fields)
return hm.c.cmdStrings(ctx, req)
} | [
-1.4467127323150635,
0.23772405087947845,
0.7016097903251648,
0.5327327847480774,
0.761929988861084,
-0.3592187166213989,
-1.8662883043289185,
-0.5466166138648987,
-0.5923910737037659,
-0.6983665823936462,
-0.5826783180236816,
-0.05177311226725578,
-0.8365765810012817,
0.6274157762527466,
... |
func (hm HashMap) MultiSet(ctx context.Context, fields map[string]Value) error {
req := newRequestSize(2+2*len(fields), "\r\n$5\r\nHMSET\r\n$")
req.addStringAndMap(hm.name, fields)
return hm.c.cmdSimple(ctx, req)
} | [
-1.1411187648773193,
0.6000242233276367,
0.42586973309516907,
0.3400863707065582,
0.10285577923059464,
-0.3634408414363861,
-0.378778338432312,
-0.8005845546722412,
-0.14935609698295593,
-0.5741921663284302,
-0.7564295530319214,
0.0915883332490921,
-0.8012995719909668,
0.29516810178756714,... |
func (hm HashMap) Set(ctx context.Context, field string, value Value) error {
req := newRequest("*4\r\n$4\r\nHSET\r\n$")
req.addString3(hm.name, field, value)
_, err := hm.c.cmdInt(ctx, req)
return err
} | [
-0.2168738692998886,
0.58209627866745,
0.5296068787574768,
-0.15929320454597473,
0.308035284280777,
1.2197051048278809,
-0.6326695084571838,
-0.7202547192573547,
-0.6865098476409912,
0.029179178178310394,
-0.33445966243743896,
0.5716316103935242,
-1.4187753200531006,
-0.12111973762512207,
... |
func (hm HashMap) SetNotExist(ctx context.Context, field string, value Value) (bool, error) {
req := newRequest("*4\r\n$6\r\nHSETNX\r\n$")
req.addString3(hm.name, field, value)
res, err := hm.c.cmdInt(ctx, req)
return res == 1, err
} | [
-0.5956692695617676,
0.6321296691894531,
0.9586721658706665,
-0.05242236703634262,
0.5468277335166931,
0.6235040426254272,
-0.8560144901275635,
-0.7544113397598267,
-0.7082606554031372,
0.9207452535629272,
-0.3880561292171478,
-0.6066197752952576,
-1.6106213331222534,
0.34974077343940735,
... |
func (hm HashMap) Strlen(ctx context.Context, key string) (int64, error) {
req := newRequest("*3\r\n$7\r\nHSTRLEN\r\n$")
req.addString2(hm.name, key)
return hm.c.cmdInt(ctx, req)
} | [
-0.07312977313995361,
0.301509827375412,
0.5609852075576782,
-0.017397664487361908,
-0.278573215007782,
-0.5618631839752197,
-0.5343988537788391,
0.12341922521591187,
-0.27938729524612427,
0.4325600564479828,
-0.8165118098258972,
0.2324346899986267,
-0.7937018871307373,
-0.0720217451453208... |
func (hm HashMap) Values(ctx context.Context) ([]string, error) {
req := newRequest("*2\r\n$5\r\nHVALS\r\n$")
req.addString(hm.name)
return hm.c.cmdStrings(ctx, req)
} | [
-0.4514195919036865,
0.5754734873771667,
0.44555795192718506,
0.4224110543727875,
0.9585097432136536,
0.01231323927640915,
-1.2646838426589966,
-0.9709131121635437,
-0.2255062311887741,
-0.43200039863586426,
-0.16294950246810913,
0.3960858881473541,
-1.0382556915283203,
1.1656122207641602,... |
func NewPostGistsCreated() *PostGistsCreated {
return &PostGistsCreated{}
} | [
0.9816551208496094,
-0.2696065306663513,
-0.29471248388290405,
0.5755863189697266,
-0.2668260931968689,
0.31039905548095703,
-0.2289869487285614,
0.22398577630519867,
-0.6957576870918274,
-0.982628345489502,
-0.29213592410087585,
-0.27644801139831543,
-0.5086981654167175,
0.696644961833953... |
func (o *PostGistsCreated) WithPayload(payload *models.Gist) *PostGistsCreated {
o.Payload = payload
return o
} | [
0.6989548802375793,
0.3508172631263733,
-0.2516811192035675,
-0.6085253953933716,
-0.20655010640621185,
0.6348779201507568,
-0.3806361258029938,
-0.37592026591300964,
-0.041736483573913574,
-0.6353260278701782,
0.08723355829715729,
-0.7357742190361023,
-0.1364060491323471,
0.32913327217102... |
func (o *PostGistsCreated) SetPayload(payload *models.Gist) {
o.Payload = payload
} | [
0.30841949582099915,
0.4030446708202362,
-0.3238106667995453,
-0.7569003105163574,
-0.03397576883435249,
0.893709123134613,
-0.30366402864456177,
-0.18340104818344116,
-0.2296493649482727,
-0.28527677059173584,
-0.46073007583618164,
-0.19753505289554596,
-0.7451216578483582,
0.562963485717... |
func (o *PostGistsCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(201)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
} | [
-0.00902905035763979,
0.47266507148742676,
0.03536077216267586,
0.5422341227531433,
0.7391998171806335,
0.0019883171189576387,
0.46095898747444153,
-0.38305020332336426,
0.017783189192414284,
0.1924111396074295,
-0.049888040870428085,
-0.3536325693130493,
-0.413787841796875,
-0.04936029762... |
func NewPostGistsForbidden() *PostGistsForbidden {
return &PostGistsForbidden{}
} | [
0.9408857822418213,
0.35214126110076904,
-0.14479580521583557,
0.9216404557228088,
-1.1606836318969727,
-0.1045975312590599,
0.38946476578712463,
-0.053412966430187225,
-0.48297417163848877,
-0.7097640037536621,
-0.16882860660552979,
0.46522194147109985,
-1.3015475273132324,
-0.51229745149... |
func (o *PostGistsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(403)
} | [
0.25089648365974426,
0.10431629419326782,
0.1008339375257492,
0.2372151017189026,
0.6751658916473389,
-0.10955381393432617,
0.8182520866394043,
-0.4823160767555237,
0.004522341303527355,
0.11678534746170044,
0.3083561360836029,
0.20764942467212677,
-1.4827051162719727,
-0.4778885543346405,... |
func Stream(ctx context.Context, wC etcd.WatchChan) <-chan *etcd.Event {
eC := make(chan *etcd.Event, 1024)
go func(ctx context.Context, ec chan *etcd.Event) {
// this unblocks any callers ranging on ec
defer close(ec)
// etcd client will close this channel if error occurs
for wResp := range wC {
if ok, ... | [
0.05847828835248947,
-0.006036824081093073,
0.5422859787940979,
-0.34326887130737305,
-0.5262788534164429,
0.9574999809265137,
-0.10111534595489502,
-0.5642989873886108,
0.22873686254024506,
-0.06946434825658798,
0.8864248394966125,
0.9096226692199707,
0.006051785312592983,
0.3270302414894... |
func GenerateRandomIntSlice(length int, maxValue int, specialValues ...int) []int {
if length < 10 {
length = 10
}
intSlice := make([]int, length) // length: big(10, 'length')
i := 0
for ; i < len(intSlice) && i < len(specialValues); i++ { // special values if given
intSlice[i] = s... | [
-1.5116746425628662,
0.08716162294149399,
0.458830326795578,
-0.3026770353317261,
-0.3279881775379181,
0.20455144345760345,
-0.6326432824134827,
1.0978893041610718,
-0.3063860833644867,
0.16173546016216278,
-0.4897291958332062,
0.3007131516933441,
0.015743786469101906,
0.3777216672897339,
... |
func (d *Director) collectCheckStats() {
llog := d.Log.WithField("method", "collectCheckStats")
d.CheckStatsLooper.Loop(func() error {
// To avoid a potential race here; all members have a count of how many
// checks each member is assigned.
// This will *probably* be switched to utilize `state` later on.
ch... | [
0.035705987364053726,
0.2620796263217926,
0.31787607073783875,
0.06751272827386856,
-0.10395145416259766,
0.5357667803764343,
0.4631670415401459,
-1.0425455570220947,
-0.2523098289966583,
-0.5294198393821716,
0.19955235719680786,
0.7124826312065125,
0.45435023307800293,
1.1071991920471191,... |
func (d *Director) performCheckDistribution(members map[string][]string, checkKeys map[string]string) error {
llog := d.Log.WithField("method", "distributeChecks")
memberList := d.convertMembersMap(members)
for tag, memList := range memberList {
checks := d.filterCheckKeysByTag(checkKeys, tag)
checksPerMember ... | [
-0.37438344955444336,
0.3037647008895874,
0.7295451760292053,
0.08603037893772125,
0.479216068983078,
-0.4911457598209381,
0.8354676961898804,
0.619473397731781,
-0.5921116471290588,
0.4774905741214752,
0.8261682987213135,
0.014303234405815601,
-0.4055621325969696,
1.080588936805725,
0.7... |
func (d *Director) filterCheckKeysByTag(checkKeys map[string]string, tag string) []string {
newCheckKeys := make([]string, 0)
for checkName, checkTag := range checkKeys {
// Append to list if check does not have a member tag and given tag matches '!UNTAGGED!'
if checkTag == "" && tag == UNTAGGED_MEMBER_MAP_ENTRY... | [
-0.07761888951063156,
-0.9072028398513794,
0.339889258146286,
0.9543939232826233,
-0.21299798786640167,
-0.31851279735565186,
-0.5026872158050537,
0.4949139356613159,
-0.3752020299434662,
0.852216899394989,
-0.19462670385837555,
0.400515615940094,
-0.7415956258773804,
1.1311612129211426,
... |
func (d *Director) convertMembersMap(members map[string][]string) map[string][]string {
newMemberMap := make(map[string][]string, 0)
for memberID, tags := range members {
if len(tags) == 0 {
if _, ok := newMemberMap[UNTAGGED_MEMBER_MAP_ENTRY]; !ok {
newMemberMap[UNTAGGED_MEMBER_MAP_ENTRY] = make([]string, 0... | [
-0.25215986371040344,
-1.3958734273910522,
0.3944607079029083,
-0.04591811075806618,
0.36348143219947815,
-0.08037001639604568,
-0.6565840840339661,
-0.2805556058883667,
0.4009414315223694,
0.4899206757545471,
-0.5867778062820435,
0.1123853325843811,
-0.5743629932403564,
0.9128772616386414... |
func (d *Director) verifyMemberExistence() error {
// TODO: This can probably go into dal.GetClusterMembers()
llog := d.Log.WithField("method", "verifyMemberExistence")
// Let's wait a `heartbeatInterval`*2 to ensure that at least 1 active member
// is in the cluster (if not - there's either a bug or the system is... | [
0.28693440556526184,
-0.46459296345710754,
0.46018123626708984,
0.18564368784427643,
0.6779699325561523,
-0.19572918117046356,
-0.13337191939353943,
-0.30467697978019714,
-0.3277820646762848,
0.3055383265018463,
-0.359698623418808,
0.3425462245941162,
-0.20339077711105347,
0.77780628204345... |
func (d *Director) runCheckConfigWatcher(ctx context.Context) {
llog := d.Log.WithField("method", "runCheckConfigWatcher")
llog.Debug("Starting...")
watcher := d.DalClient.NewWatcher("monitor/", true)
// No need for a looper here since we can control the loop via the context
for {
// safety valve
if !d.amDi... | [
-0.46849462389945984,
-0.5693621039390564,
0.4614580571651459,
0.1654188334941864,
-0.5534934997558594,
-0.04884742200374603,
0.5238350033760071,
0.12711352109909058,
-0.48028701543807983,
0.9377214312553406,
0.04351728409528732,
0.5142489075660706,
0.17672789096832275,
0.8727803826332092,... |
func (d *Director) PickNextMember(checkTag string) (string, error) {
d.CheckStatsMutex.Lock()
defer d.CheckStatsMutex.Unlock()
// Check stats not yet populated, return self
if len(d.CheckStats) == 0 {
// Return ourselves if we do not have any tags configured and the check has no tags either
if checkTag == "" &... | [
1.1567256450653076,
-0.14723534882068634,
0.41937193274497986,
0.016630949452519417,
-0.606971800327301,
-0.2108297348022461,
-0.06454762816429138,
-0.7124581336975098,
-0.11921146512031555,
-0.3535960912704468,
0.6353990435600281,
0.27342984080314636,
-0.38109850883483887,
0.5061240196228... |
func (d *Director) filterMembersByTag(checkStats map[string]*dal.MemberStat, checkTag string) []string {
members := make([]string, 0)
for memberID, memberStat := range checkStats {
// Match, if the check doesn't have a tag and the member doesn't have any tags either
if len(memberStat.Tags) == 0 && checkTag == ""... | [
0.9859888553619385,
-0.5133303999900818,
0.17849569022655487,
0.6043290495872498,
-0.003050411120057106,
0.026121562346816063,
-0.8652567863464355,
-0.15861646831035614,
-0.23122210800647736,
0.08637990802526474,
0.17303532361984253,
0.6935111284255981,
-0.9807838201522827,
1.2480914592742... |
func (d *Director) ignorableWatcherEvent(resp *etcd.Response) bool {
if resp == nil {
d.Log.Debug("Received a nil etcd response - bug?")
return true
}
// Ignore `/monitor/`
if path.Base(resp.Node.Key) == "monitor" {
return true
}
return false
} | [
0.08485287427902222,
-0.14657393097877502,
0.4705047607421875,
-0.3423953652381897,
-0.39013051986694336,
0.03348767012357712,
-0.2858447730541229,
0.006296725943684578,
-0.17663344740867615,
-0.2901592552661896,
0.009156168438494205,
-1.1626063585281372,
-0.7597926259040833,
0.27483680844... |
func newSymbol(name string, thing interface{}) *Symbol {
return &Symbol{
Name: name,
props: makeProps(),
Value: Atomize(thing),
}
} | [
-0.35535910725593567,
-0.11086541414260864,
0.29867133498191833,
-0.15458427369594574,
-0.8011298775672913,
-0.3759990632534027,
-1.0497114658355713,
-0.4978165626525879,
-0.21076996624469757,
-0.44958940148353577,
-0.8878135681152344,
0.8135946989059448,
0.7029319405555725,
-1.01760566234... |
func (sym Symbol) IsAtom() bool {
return sym.Value.Type() != ConsType
} | [
-1.048021912574768,
-0.30726858973503113,
0.0745278149843216,
1.0856131315231323,
-0.06489387899637222,
-0.07018765062093735,
0.959705114364624,
-0.31436729431152344,
0.7666197419166565,
0.9910439848899841,
0.020632848143577576,
1.1033843755722046,
0.09534360468387604,
0.3669620454311371,
... |
func (sym *Symbol) Get(key string) Atom {
value := sym.props.Get(key, sym)
if value == nil {
return NilAtom
}
return Atomize(value)
} | [
-0.183850958943367,
0.1339012235403061,
0.2874290347099304,
-0.2255680412054062,
0.26838237047195435,
-1.5863488912582397,
-0.8285748958587646,
-0.2491476684808731,
-0.5988103747367859,
0.012092984281480312,
0.3832179009914398,
0.40419185161590576,
0.38971152901649475,
-0.6169183850288391,... |
func InitGlobalEnvironment() {
initOnce.Do(func() {
Defun("+", _Add, nil, GlobalEnvironment)
Defun("quote", _Quote, nil, GlobalEnvironment)
Defun("list", _ErrorMapper(errors.New("list used as function call")), _Identity,
GlobalEnvironment)
})
} | [
-0.43064969778060913,
0.4669956564903259,
0.5011450052261353,
0.6705821752548218,
0.669036328792572,
0.7721160054206848,
1.09839928150177,
0.30930018424987793,
0.4478747546672821,
0.2139168083667755,
-1.2503361701965332,
0.8421018719673157,
-0.9100551009178162,
1.545274257659912,
0.30103... |
func Defun(opname string, funcBody Mapper, quoter Mapper, env *Environment) {
opsym := GlobalEnvironment.Intern(opname, false)
opsym.Value = Atomize(&internalOp{sym: opsym, caller: funcBody, quoter: quoter})
T().Debugf("new interal op %s = %v", opsym.Name, opsym.Value)
} | [
-0.7137331366539001,
0.5561074614524841,
0.5465810894966125,
-0.09422184526920319,
0.01293249987065792,
0.2096278965473175,
0.5470563769340515,
0.7800541520118713,
-0.2593492865562439,
-0.2413329929113388,
-0.7727074027061462,
0.5676489472389221,
-0.31363433599472046,
0.10006898641586304,
... |
func (iop *internalOp) Quote(el Element, env *Environment) Element {
// TODO is env needed for internal ops?
if iop.quoter == nil {
if el.IsAtom() {
return Elem(Cons(Atomize(iop), Cons(el.AsAtom(), nil)))
}
return Elem(Cons(Atomize(iop), el.AsList()))
}
return iop.quoter(el)
} | [
-0.5828718543052673,
0.054390355944633484,
0.4385353624820709,
0.39437657594680786,
0.22403007745742798,
-0.07235800474882126,
-0.6404067277908325,
-0.35893523693084717,
0.4080117642879486,
0.4867299199104309,
1.1244237422943115,
0.033665772527456284,
-0.2524220645427704,
0.200603708624839... |
func NewEnvironment(name string, parent *Environment) *Environment {
return &Environment{
name: name,
parent: parent,
dict: make(map[string]*Symbol),
}
} | [
-0.07878395169973373,
-0.42892220616340637,
0.022488588467240334,
-0.5146149396896362,
-1.140856146812439,
-0.32117506861686707,
0.28904202580451965,
-0.2358461618423462,
-0.43297746777534485,
0.5729957818984985,
-0.7831091284751892,
0.17999280989170074,
0.2718884348869324,
0.2936352193355... |
func (env *Environment) FindSymbol(name string, inherit bool) *Symbol {
var sym *Symbol
var ok bool
for env != nil {
sym, ok = env.dict[name]
if ok {
return sym
}
if inherit {
env = env.parent
} else {
break
}
}
return nil
} | [
-0.34750738739967346,
0.6042238473892212,
0.7867815494537354,
-0.3165684640407562,
-0.5496258735656738,
0.08412249386310577,
0.3724076449871063,
-0.958014190196991,
-0.9669690132141113,
0.22726625204086304,
-0.7868310809135437,
-0.03104412741959095,
-0.5011450052261353,
0.8836384415626526,... |
func (env *Environment) Intern(name string, inherit bool) *Symbol {
sym := env.FindSymbol(name, inherit)
if sym == nil {
sym = &Symbol{Name: name}
env.dict[name] = sym
}
return sym
} | [
-0.3656075596809387,
0.4498138129711151,
0.6848337054252625,
-1.2601150274276733,
-0.921761155128479,
0.4163246750831604,
0.05087415501475334,
-0.3462574779987335,
-1.0856239795684814,
-0.2224009484052658,
-0.9478439092636108,
0.4595078229904175,
-0.453551322221756,
0.0011965710436925292,
... |
func (env *Environment) Dump() string {
var b bytes.Buffer
b.WriteString(env.String())
b.WriteString(" {\n")
for k, v := range env.dict {
b.WriteString(fmt.Sprintf(" %s = %v\n", k, v))
}
b.WriteString("}\n")
return b.String()
} | [
-0.8045343160629272,
-0.3435194194316864,
0.7131306529045105,
-1.3508621454238892,
-0.004444529768079519,
1.1693675518035889,
-0.4707760512828827,
-0.36808449029922485,
-0.7953270673751831,
0.37914884090423584,
0.5336978435516357,
0.268471360206604,
0.005642164032906294,
0.5841301083564758... |
func RegVmDynamicByAsync(nameSpaceID string, mcisID string, vmReqInfo *tbmcis.TbVmDynamicReq, c echo.Context) {
var originalUrl = "/ns/{nsId}/mcis/{mcisId}/vmDynamic"
var paramMapper = make(map[string]string)
paramMapper["{nsId}"] = nameSpaceID
paramMapper["{mcisId}"] = mcisID
urlParam := util.MappingUrlParamete... | [
-0.8424532413482666,
0.37939655780792236,
0.9952192306518555,
0.3365356922149658,
0.2025277018547058,
-0.5805536508560181,
0.20461679995059967,
-0.5645802021026611,
-0.06475690007209778,
0.40885043144226074,
-0.5052842497825623,
1.0327403545379639,
-0.3285897970199585,
0.7690709233283997,
... |
func InstallBenchmarkAgentToMcis(nameSpaceID string, mcisID string, mcisCommandInfo *tbmcis.McisCmdReq) (*tbmcis.RestPostCmdMcisResponseWrapper, model.WebStatus) {
var originalUrl = "/ns/{nsId}/installBenchmarkAgent/mcis/{mcisId}"
var paramMapper = make(map[string]string)
paramMapper["{nsId}"] = nameSpaceID
paramM... | [
-0.44336557388305664,
-0.654074490070343,
0.751953661441803,
-0.31761008501052856,
-0.2169300764799118,
-0.11530029773712158,
0.4505860507488251,
-0.36577296257019043,
0.25087210536003113,
0.5004760026931763,
-0.5187377333641052,
0.08872532844543457,
-0.9755768179893494,
0.7818049192428589... |
func RegAdaptiveNetwork(nameSpaceID string, mcisID string, networkReq *tbmcis.NetworkReq) (*tbmcis.AgentInstallContentWrapper, model.WebStatus) {
var originalUrl = "/ns/{nsId}/network/mcis/{mcisId}"
var paramMapper = make(map[string]string)
paramMapper["{nsId}"] = nameSpaceID
paramMapper["{mcisId}"] = mcisID
urlP... | [
-0.7196945548057556,
-0.23285794258117676,
1.0409150123596191,
-0.21730369329452515,
-0.2301347255706787,
-0.18727530539035797,
-0.023629069328308105,
-0.23561732470989227,
0.38519665598869324,
0.6671091318130493,
-0.28625935316085815,
0.26613494753837585,
-0.3525231182575226,
0.5123509764... |
func UpdateAdaptiveNetwork(nameSpaceID string, mcisID string, networkReq *tbmcis.NetworkReq) (*tbmcis.AgentInstallContentWrapper, model.WebStatus) {
var originalUrl = "/ns/{nsId}/network/mcis/{mcisId}"
var paramMapper = make(map[string]string)
paramMapper["{nsId}"] = nameSpaceID
paramMapper["{mcisId}"] = mcisID
u... | [
-0.7840521335601807,
-0.843264639377594,
0.9336787462234497,
-0.2827548086643219,
-0.8490851521492004,
-0.04975083842873573,
-0.22884848713874817,
-0.26895636320114136,
0.658113420009613,
0.9236765503883362,
-0.24856364727020264,
0.30451440811157227,
-0.29093730449676514,
0.714769959449768... |
func NewClient(topic string) *Client {
return &Client{
topic,
time.Now(),
make(chan *Message),
}
} | [
0.2893020212650299,
-0.7941685318946838,
0.02277189865708351,
-0.3032803535461426,
-0.412895143032074,
0.34474000334739685,
0.36263492703437805,
-1.19131600856781,
-0.8560215830802917,
0.15054243803024292,
0.23778045177459717,
0.623759925365448,
-0.639508843421936,
-0.544662594795227,
0.... |
func (c *Client) SendMessage(message *Message) {
c.messages <- message
} | [
-0.4942881464958191,
1.1882108449935913,
0.09339424967765808,
-0.00615079328417778,
0.9055827856063843,
0.45690274238586426,
0.1425471305847168,
-0.7459970712661743,
-0.28813260793685913,
-0.5037456750869751,
0.02915605716407299,
0.24679893255233765,
-1.78738534450531,
1.2488771677017212,
... |
func (c *Client) GetTopic() string {
return c.topic
} | [
0.6786161065101624,
0.6310433149337769,
0.12367291003465652,
0.7323623299598694,
0.5742344856262207,
0.5143738389015198,
0.3005867600440979,
-0.24486732482910156,
-0.5800100564956665,
-0.3052910268306732,
0.5798397064208984,
0.5756113529205322,
-0.07629798352718353,
-0.8898953795433044,
... |
func (c *Client) GetConnectedTime() time.Duration {
return time.Since(c.connectedAt)
} | [
0.23286940157413483,
-0.24634474515914917,
0.3916531801223755,
-0.14223670959472656,
-0.0592191144824028,
0.41800856590270996,
-0.5679551959037781,
-0.8375173807144165,
-0.5249546766281128,
0.6900829672813416,
-0.621433675289154,
-0.3271868824958801,
-0.626595675945282,
0.4962441027164459,... |
func NewBondedECDSAKeep(address common.Address, backend bind.ContractBackend) (*BondedECDSAKeep, error) {
contract, err := bindBondedECDSAKeep(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &BondedECDSAKeep{BondedECDSAKeepCaller: BondedECDSAKeepCaller{contract: contract}, BondedECDSA... | [
0.07935673743486404,
0.1702929586172104,
0.616849422454834,
-0.13188277184963226,
-0.1233084425330162,
0.20760181546211243,
-0.32331594824790955,
-0.2642374634742737,
-0.23974524438381195,
0.2810940742492676,
-0.04002349078655243,
0.6906484365463257,
-0.3862989544868469,
0.2573987245559692... |
func NewBondedECDSAKeepCaller(address common.Address, caller bind.ContractCaller) (*BondedECDSAKeepCaller, error) {
contract, err := bindBondedECDSAKeep(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &BondedECDSAKeepCaller{contract: contract}, nil
} | [
-0.8134730458259583,
0.15980419516563416,
0.4374285340309143,
-0.13294671475887299,
-0.5918254852294922,
0.6400679349899292,
-0.30546075105667114,
-0.40719205141067505,
0.1735110580921173,
0.5228771567344666,
-0.09526613354682922,
0.37547823786735535,
-0.14575722813606262,
0.38850247859954... |
func NewBondedECDSAKeepTransactor(address common.Address, transactor bind.ContractTransactor) (*BondedECDSAKeepTransactor, error) {
contract, err := bindBondedECDSAKeep(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &BondedECDSAKeepTransactor{contract: contract}, nil
} | [
-1.0211241245269775,
0.1368715763092041,
0.5487298965454102,
-0.6828306913375854,
-0.6295647621154785,
-0.04167339578270912,
0.054342299699783325,
-0.12497267127037048,
0.32285353541374207,
0.2743760049343109,
-0.23093518614768982,
0.484057754278183,
-0.4113328158855438,
-0.386597216129303... |
func NewBondedECDSAKeepFilterer(address common.Address, filterer bind.ContractFilterer) (*BondedECDSAKeepFilterer, error) {
contract, err := bindBondedECDSAKeep(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &BondedECDSAKeepFilterer{contract: contract}, nil
} | [
-0.8417225480079651,
-0.05023114010691643,
0.5605111122131348,
-0.004203717689961195,
-0.6016495227813721,
0.38561567664146423,
-0.13432805240154266,
-0.2598218619823456,
0.026584777981042862,
0.19063571095466614,
0.18052059412002563,
0.718993067741394,
-0.18516433238983154,
0.213412448763... |
func bindBondedECDSAKeep(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := abi.JSON(strings.NewReader(BondedECDSAKeepABI))
if err != nil {
return nil, err
}
return bind.NewBoundContract(address, par... | [
-1.055938959121704,
-0.04375862702727318,
0.6626601219177246,
-0.1300591081380844,
-0.14809496700763702,
0.19224125146865845,
-0.37427476048469543,
-0.4172786772251129,
0.2598848342895508,
0.07277735322713852,
0.4083622395992279,
1.1375231742858887,
-0.4758652448654175,
0.10075262188911438... |
func (_BondedECDSAKeep *BondedECDSAKeepRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
return _BondedECDSAKeep.Contract.BondedECDSAKeepCaller.contract.Call(opts, result, method, params...)
} | [
-1.1509705781936646,
1.1665812730789185,
0.5234454274177551,
0.4996853470802307,
-0.8273729681968689,
0.4314432740211487,
-0.31399500370025635,
-0.8842112421989441,
0.5573297142982483,
0.36286458373069763,
0.4147847592830658,
0.1883447766304016,
-0.4661363959312439,
-0.011963938362896442,
... |
func (_BondedECDSAKeep *BondedECDSAKeepRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _BondedECDSAKeep.Contract.BondedECDSAKeepTransactor.contract.Transfer(opts)
} | [
-0.8014447093009949,
0.5039514303207397,
0.3196841776371002,
0.23417671024799347,
-0.23375965654850006,
0.27708539366722107,
0.5464265942573547,
-0.476207971572876,
0.7843349575996399,
-0.3641890287399292,
0.2944338917732239,
0.2396528720855713,
-0.27859511971473694,
-0.23879554867744446,
... |
func (_BondedECDSAKeep *BondedECDSAKeepRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _BondedECDSAKeep.Contract.BondedECDSAKeepTransactor.contract.Transact(opts, method, params...)
} | [
-0.8045505285263062,
0.6828067898750305,
0.5000521540641785,
-0.7912955284118652,
0.21329568326473236,
0.014649930410087109,
0.9302207827568054,
-0.6037878394126892,
0.26170995831489563,
0.01073475368320942,
0.1425478756427765,
0.4055802822113037,
-0.03373892232775688,
0.038330018520355225... |
func (_BondedECDSAKeep *BondedECDSAKeepCallerRaw) Call(opts *bind.CallOpts, result interface{}, method string, params ...interface{}) error {
return _BondedECDSAKeep.Contract.contract.Call(opts, result, method, params...)
} | [
-1.1083393096923828,
1.201899766921997,
0.550194263458252,
0.6390949487686157,
-0.8375381231307983,
0.4887813627719879,
-0.3596668243408203,
-0.894351601600647,
0.5942463278770447,
0.2442101240158081,
0.17802195250988007,
-0.06866529583930969,
-0.5352115035057068,
0.12248389422893524,
-0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.