text
stringlengths
11
6.3k
embedding
listlengths
768
768
func UnmarshalConfigUpdateEnvelope(data []byte) (*cb.ConfigUpdateEnvelope, error) { configUpdateEnvelope := &cb.ConfigUpdateEnvelope{} err := proto.Unmarshal(data, configUpdateEnvelope) if err != nil { return nil, err } return configUpdateEnvelope, nil }
[ -0.7012807726860046, -0.01507306657731533, 0.4018677771091461, -0.2729000747203827, -1.1489077806472778, 0.10384165495634079, 0.10334841907024384, 0.6747133731842041, -0.4188809096813202, 1.6453373432159424, -0.4788433909416199, -0.17675204575061798, -1.2189745903015137, 0.0510183610022068...
func UnmarshalConfigUpdateEnvelopeOrPanic(data []byte) *cb.ConfigUpdateEnvelope { result, err := UnmarshalConfigUpdateEnvelope(data) if err != nil { panic(err) } return result }
[ -0.13793586194515228, -0.22192449867725372, 0.4649409353733063, 0.027819979935884476, -0.9377309679985046, 0.5906462669372559, -0.2115926295518875, 0.2066679149866104, -0.10355402529239655, 1.5515363216400146, 0.1405407041311264, -0.5801922678947449, -0.706426203250885, -0.2734763324260711...
func UnmarshalConfigEnvelope(data []byte) (*cb.ConfigEnvelope, error) { configEnv := &cb.ConfigEnvelope{} err := proto.Unmarshal(data, configEnv) if err != nil { return nil, err } return configEnv, nil }
[ -0.6275264024734497, 0.7710250020027161, 0.23443114757537842, 0.16923531889915466, -1.3144361972808838, -0.3341088891029358, 0.1694859266281128, 0.7530755400657654, -1.1231995820999146, 1.036306619644165, -0.40029627084732056, -0.5151788592338562, -0.9300046563148499, 0.24726495146751404, ...
func UnmarshalConfigEnvelopeOrPanic(data []byte) *cb.ConfigEnvelope { result, err := UnmarshalConfigEnvelope(data) if err != nil { panic(err) } return result }
[ 0.22030240297317505, 0.40203821659088135, 0.36181819438934326, 0.24995499849319458, -0.9961128234863281, 0.16083058714866638, -0.08434884995222092, 0.3572129011154175, -0.4356313943862915, 1.1987122297286987, 0.0583619587123394, -0.8396852612495422, -0.6098666191101074, -0.3372237384319305...
func UnmarshalConfigUpdateFromPayload(payload *cb.Payload) (*cb.ConfigUpdate, error) { configEnv, err := UnmarshalConfigEnvelope(payload.Data) if err != nil { return nil, err } configUpdateEnv, err := protoutil.EnvelopeToConfigUpdate(configEnv.LastUpdate) if err != nil { return nil, err } return UnmarshalCo...
[ -0.24663978815078735, -0.2453501969575882, 0.6915032267570496, -0.5988062620162964, -1.1203161478042603, -0.26460567116737366, -0.41253966093063354, 0.47118350863456726, -0.24866983294487, 0.7920926809310913, 0.047479961067438126, -0.7068842649459839, -0.7819371223449707, 0.500659525394439...
func ArraysImpl() { // Once an array is declared, neither the type of data being stored nor its length can be changed var arr [5]int // When variables in Go are declared, they’re always initialized to their zero value for their respective type, and arrays are no different arr1 := [5]int{10, 20, 30, 40, 50} // s...
[ 0.015067435801029205, -0.6162066459655762, 1.1166355609893799, -0.3760429918766022, -0.582000195980072, 0.41453441977500916, 0.3875700831413269, -0.23239445686340332, 0.35846683382987976, 1.0601190328598022, -0.6348540782928467, 0.7686476111412048, -0.10960383713245392, 0.8406206965446472,...
func PassingArraysToFunctions() { // Passing an array between functions can be an expensive operation in terms of memory and performance. // When you pass variables between functions, they’re always passed by value. When your variable is an array, // this means the entire array, regardless of its size, is copied and...
[ 0.21131768822669983, -0.6059061288833618, 0.7241858839988708, 0.1907902956008911, -0.06286394596099854, 0.35876455903053284, 0.5337162017822266, -0.026236282661557198, 0.22089551389217377, 0.23421654105186462, -0.19717438519001007, 0.9626075625419617, -0.4069760739803314, -0.06277380138635...
func newfileUploadRequest(uri string, params map[string]string, paramName, xmlString string) (*http.Request, error) { bXml:=strings.NewReader(xmlString) body := &bytes.Buffer{} writer := multipart.NewWriter(body) hs,_:=hash_string_md5(xmlString) finename := "DFEServicioConsulta_"+ strings.ToUpper(hs) +".XML" ...
[ -0.42522868514060974, -0.05098196864128113, 0.7880373597145081, -0.1922343373298645, -0.47027072310447693, -0.5137532353401184, -0.8448683023452759, 0.2636316418647766, -1.3192026615142822, 0.32445478439331055, 0.20761333405971527, -0.3127042353153229, 0.056391846388578415, 0.2403346598148...
func (PrescriptionStatus) EnumDescriptor() ([]byte, []int) { return file_heyrenee_v1_messages_prescription_proto_rawDescGZIP(), []int{0} }
[ -0.9816011190414429, 0.4076451361179352, 0.34179505705833435, -0.9576462507247925, 0.41661912202835083, -0.40704020857810974, -0.20105519890785217, 0.6384743452072144, 0.6172201037406921, 1.0831735134124756, -0.13769152760505676, 0.6367900371551514, 0.17295201122760773, 0.8092877864837646,...
func (*Prescription) Descriptor() ([]byte, []int) { return file_heyrenee_v1_messages_prescription_proto_rawDescGZIP(), []int{0} }
[ -0.7403152585029602, 0.7500571608543396, 0.48522254824638367, -0.34359726309776306, 0.22316844761371613, -0.4887605309486389, 0.04855389520525932, 0.12022432684898376, -0.024335965514183044, 0.31777626276016235, -0.10257931798696518, 0.09794213622808456, -0.12525378167629242, -0.0315043255...
func saveToFile(path string, data *[]byte) bool { // Open file for writing file, err := os.OpenFile(path, os.O_WRONLY, 0666) if err != nil { log.Fatal(err) return false } defer file.Close() // Create a buffered writer from the file bufferedWriter := bufio.NewWriter(file) // Write bytes to buffer _, err =...
[ 0.3672240674495697, 0.028815610334277153, 1.022797703742981, -0.4559008479118347, 0.7731801867485046, 1.0467088222503662, -0.01022778544574976, 0.2235240936279297, -0.8799393177032471, 0.3597041070461273, -1.3577392101287842, -0.41415661573410034, -0.7638586163520813, -0.31620556116104126,...
func loadFileData(path string) ([]byte, error) { //Open File file, err := os.Open(path) if err != nil { log.Fatal(err) return nil, err } defer file.Close() fileInfo, err := file.Stat() if err != nil { log.Fatal(err) return nil, err } byteSlice := make([]byte, fileInfo.Size()) bytesRead, err := file...
[ 0.28074872493743896, -0.3327714204788208, 0.9397553205490112, -1.0614924430847168, -0.4133417308330536, 1.1378706693649292, -0.4423481523990631, 0.05488499999046326, -0.7037045359611511, -0.4145118296146393, -0.3344360888004303, 0.14393915235996246, -0.574147641658783, 0.614415168762207, ...
func (c *Config) ValidateConfig(cfg *ini.File, section string) error { configSection, err := cfg.GetSection(section) if err != nil { return ErrNoSuchSection } if !configSection.HasKey("server") { return ErrNoServerEntries } return nil }
[ 0.1469784379005432, 0.10160044580698013, 0.5158088207244873, -0.014474534429609776, -0.14000795781612396, 0.147433802485466, 0.29603394865989685, 0.8908209204673767, -0.4782980978488922, 0.26692894101142883, -0.2785358726978302, -0.3577767610549927, 0.12344885617494583, 1.6777228116989136,...
func (c *Config) GetRbls(cfg *ini.File) []string { return cfg.Section("rbl").Key("server").ValueWithShadows() }
[ 0.24227572977542877, 0.08953709900379181, 0.40658852458000183, 0.4392505884170532, 0.6492633819580078, 0.6631970405578613, -0.4216449558734894, -0.5798913836479187, 0.35045719146728516, 0.5664263367652893, -0.8146622180938721, 1.221307635307312, -0.9419581890106201, 1.1909154653549194, 1...
func (c *Config) GetTargets(cfg *ini.File) []string { return cfg.Section("targets").Key("server").ValueWithShadows() }
[ -0.5816643834114075, -0.19361969828605652, 0.39470210671424866, 0.4795452952384949, 1.0362310409545898, -0.05869658291339874, -0.3981034457683563, 0.07566871494054794, -0.12688924372196198, 0.49925586581230164, -0.5879122614860535, 0.9680901169776917, -0.40937983989715576, 0.93744194507598...
func BestSquare(size int) (nrow, ncol int) { nrow = -1 // not found ncol = -1 // not found for x := 1; x <= size; x++ { if (x * x) >= size { if (x * x) == size { nrow = x ncol = x return } for y := x; y >= 1; y-- { if (x * y) == size { nrow = x ncol = y return } } }...
[ -0.5578896999359131, -0.7283053398132324, 0.7239749431610107, -0.10151533782482147, -0.8465138077735901, -1.1251623630523682, 0.5124021172523499, -0.8197746276855469, 0.4464860260486603, 0.13743337988853455, -0.3922715485095978, 0.37962040305137634, -0.12378815561532974, 0.6744174957275391...
func BestSquareApprox(size int) (nrow, ncol int) { fsize := float64(size) ncol = int(math.Floor(math.Sqrt(fsize))) nrow = int(math.Ceil(fsize / float64(ncol))) return }
[ 0.25795742869377136, -0.2817603051662445, 0.5529342293739319, -0.33390405774116516, -1.5010751485824585, -1.2220758199691772, -0.15885747969150543, 0.2497245967388153, 1.1927566528320312, -0.009617977775633335, -0.19911399483680725, 0.18749791383743286, 0.2923119366168976, 0.69236272573471...
func Iabs(a int) int { if a < 0 { return -a } return a }
[ -0.7200537323951721, -0.5093992352485657, 0.49575066566467285, -1.0646016597747803, -0.874679446220398, 0.8629970550537109, -0.24835214018821716, -0.7026866674423218, 0.5226078629493713, 0.04817969352006912, 1.0115962028503418, 0.8501965999603271, 0.35610431432724, 0.06852417439222336, 0...
func Imin(a, b int) int { if a < b { return a } return b }
[ -0.25230148434638977, -0.5091031789779663, 0.5359463691711426, -0.5093034505844116, -1.0434759855270386, 0.48538756370544434, -0.6475611329078674, -0.9584813714027405, -0.5274903178215027, 0.10506255179643631, 0.4256872236728668, 1.1013779640197754, -0.71298748254776, -0.4096275866031647, ...
func Imax(a, b int) int { if a > b { return a } return b }
[ -0.579805314540863, -0.012496450915932655, 0.3881634473800659, 0.28523847460746765, -0.43154260516166687, 0.298836886882782, -1.3679578304290771, -0.25794878602027893, -0.5618851184844971, 0.21886314451694489, 0.29119673371315, 1.3325297832489014, -0.32287466526031494, -0.42704176902770996...
func Min(a, b float64) float64 { if a < b { return a } return b }
[ 0.9218641519546509, -0.023754490539431572, 0.2081843614578247, 0.2775133550167084, -0.6056455373764038, 0.17884045839309692, -1.1387953758239746, -1.075580358505249, -0.512453556060791, -0.46041879057884216, 1.2925018072128296, 1.0794061422348022, -0.06803573668003082, 0.10148205608129501,...
func Max(a, b float64) float64 { if a > b { return a } return b }
[ 0.9293367266654968, 0.6851827502250671, 0.2160082757472992, 0.9576435089111328, 0.10072509944438934, 0.07525637745857239, -1.3216090202331543, -0.591590166091919, -0.7466525435447693, 0.1068907380104065, 1.0896724462509155, 1.7083497047424316, -0.12551864981651306, 0.035039450973272324, ...
func Swap(a, b *float64) { *a, *b = *b, *a }
[ -0.6531478762626648, -0.05383589118719101, 0.4914243817329407, 0.7690784335136414, 0.6268539428710938, -0.013670729473233223, -0.5189568996429443, 0.02619469165802002, -0.3027573227882385, -0.783458411693573, 0.4799928069114685, 1.2936540842056274, 0.3526586890220642, -0.8829917907714844, ...
func DayFromTime(t time.Time) Day { year, month, day := t.Date() return Day{year, day, month, TimeZone(t.Location().String())} }
[ -0.14644202589988708, -0.719523549079895, 0.2209981083869934, 0.6071773171424866, -0.526540994644165, 0.801519513130188, -0.7333988547325134, -0.4801839292049408, -0.18291039764881134, -0.5461426377296448, -0.7952859401702881, -0.48559969663619995, 0.5365979075431824, 0.4497952461242676, ...
func (d Day) ToTime() time.Time { return time.Date(d.Year, d.Month, d.Day, 0, 0, 0, 0, MustLoadLoc(d.TimeZone)) }
[ -0.20706132054328918, 0.37771332263946533, 0.5864399671554565, 0.2789892852306366, 0.7953774333000183, 0.5801389813423157, -0.45615673065185547, -0.5254442691802979, 0.35882529616355896, 0.46528226137161255, -0.3775760531425476, -1.0646826028823853, -0.08894004672765732, 0.5617175102233887...
func (d Day) String() string { return d.ToTime().Format("2006-01-02 MST") }
[ -0.14854887127876282, -0.8550487160682678, 0.5241019129753113, -0.23562981188297272, -0.9087074995040894, 1.140969157218933, -0.27451568841934204, -1.6043155193328857, -0.312987744808197, 0.08050276339054108, 0.40928977727890015, 0.3068161904811859, 0.6958107352256775, 0.6659159660339355, ...
func (d Day) ShortString() string { return d.ToTime().Format("2006-01-02") }
[ -0.28473523259162903, -0.5359340906143188, 0.6841930150985718, -0.3495122790336609, -0.9518922567367554, 0.9800180196762085, -0.05236092209815979, -1.2854903936386108, 0.790612518787384, -0.1404455155134201, 1.2353073358535767, 0.825049102306366, 1.1617438793182373, 0.14734667539596558, ...
func MustLoadLoc(tz TimeZone) *time.Location { loc, err := time.LoadLocation(string(tz)) if err != nil { log.Fatalf("bad location %q: %v\n", tz, err) } return loc }
[ -0.4232788383960724, -0.6232002973556519, 0.3952801823616028, -0.33977070450782776, -0.9445599317550659, 0.5426910519599915, -0.019461384043097496, -0.5624602437019348, 0.4490415155887604, 0.1327849179506302, 0.06432662159204483, -0.1505984663963318, 0.27737972140312195, 0.5892861485481262...
func MustParseDuration(s string) time.Duration { d, err := time.ParseDuration(s) if err != nil { log.Fatalf("bad duration %q: %v\n", s, err) } return d }
[ -0.10137888044118881, -1.0537117719650269, 0.4109169542789459, -0.11246669292449951, -0.4552951753139496, 0.8108373880386353, -0.867926299571991, 0.09985452890396118, 0.8123022317886353, -0.2193538248538971, -0.13904017210006714, 0.1907065510749817, -0.30274587869644165, 1.0707045793533325...
func Must(t time.Time, err error) time.Time { if err != nil { log.Fatalf("got err: %v\n", err) } return t }
[ -0.22833135724067688, -0.39871978759765625, 0.29886776208877563, -0.22217825055122375, 0.014515775255858898, 1.0806875228881836, -1.286851406097412, -0.041597433388233185, 0.31730324029922485, 0.31437259912490845, 0.32253026962280273, 1.1413296461105347, 0.35578101873397827, 0.863774478435...
func AsMillis(t time.Time, offset int) int { return int(t.UTC().UnixNano()/1000000) + offset*1000 }
[ -0.25571519136428833, -0.5456005930900574, 0.3574630916118622, -0.8240762948989868, -1.147836446762085, -0.07605244964361191, -2.1009390354156494, 0.6447078585624695, 0.6208464503288269, 0.24771742522716522, 0.11003603786230087, 0.9080960154533386, 0.9871363043785095, 0.15750008821487427, ...
func ParseStd(value string) (time.Time, error) { return time.Parse(StdLayout, value) }
[ 0.6180639863014221, 0.07509681582450867, 0.43843019008636475, -0.38417136669158936, -2.007441997528076, 0.2346966564655304, 0.27568382024765015, -0.4683038890361786, -0.2323053777217865, -0.014550082385540009, -0.14291197061538696, -0.8487772345542908, -0.29492902755737305, 1.2138302326202...
func daysIn(m time.Month, year int) int { // This is equivalent to the unexported time.daysIn(m, year). return time.Date(year, m+1, 0, 0, 0, 0, 0, time.UTC).Day() }
[ 0.10179592669010162, 0.2877790629863739, 0.46953484416007996, -0.2966068983078003, -1.6356217861175537, 0.773052990436554, -0.17017200589179993, -0.10635195672512054, -0.5172379612922668, -0.36581405997276306, -0.26105281710624695, 0.6763799786567688, -0.9051010608673096, 0.122030854225158...
func Weekday(d time.Weekday) int { day := (d - 1) % 7 if day < 0 { day += 7 } return int(day) }
[ -2.019493341445923, 1.5330561399459839, 0.6033694744110107, -0.1722167283296585, -0.8199422955513, -0.4433898627758026, 0.43342509865760803, 0.03321164473891258, 0.2918315827846527, -1.1479300260543823, -0.03478028252720833, -0.5634010434150696, 0.23936864733695984, 1.0491647720336914, 0...
func StartOfWeek(t time.Time) time.Time { // Figure out number of days to back up until Mon: // Sun is 0 -> 6, Sat is 6 -> 5, etc. toMon := Weekday(t.Weekday()) y, m, d := t.AddDate(0, 0, -int(toMon)).Date() // Result is 00:00:00 on that year, month, day. return time.Date(y, m, d, 0, 0, 0, 0, t.Location()) }
[ 0.1318296641111374, 0.4355289340019226, 0.6126388311386108, -0.6208748817443848, -0.40862905979156494, -0.7991907596588135, 0.3958423137664795, -0.8592971563339233, 0.8406445980072021, 0.3390677273273468, -0.21035653352737427, -0.37198880314826965, 0.8422374725341797, 0.06938253343105316, ...
func Parse(year, month, day, hourMinute string, loc *time.Location) (time.Time, error) { now := time.Now().In(loc) y64, err := strconv.ParseInt(year, 10, 0) y := int(y64) if err != nil { return time.Time{}, err } if y < now.Year()-1000 { return time.Time{}, fmt.Errorf("bad year; %d is too far in the past", y...
[ 0.15467365086078644, -0.4194768965244293, 1.0234297513961792, -0.33083778619766235, -0.789496898651123, 0.20926710963249207, -0.8829909563064575, -0.1458626389503479, -0.43247857689857483, 0.7233378887176514, 0.24911940097808838, -0.049491796642541885, -0.5690062642097473, 0.09089677780866...
func (s *Selector) Create(from time.Time) { days := make([]int, 31) for d := 0; d < 31; d++ { // TODO: Actual number of days / month (change dynamically on selection?). days[d] = d + 1 } numYears := 5 years := make([]int, numYears) for i := 0; i < numYears; i++ { years[i] = from.Year() - i } *s = Selector{ ...
[ -0.6748022437095642, 0.1374398022890091, 0.5863217115402222, -0.3387044072151184, -0.036753591150045395, 0.20456840097904205, -0.12036626785993576, -0.6741707921028137, 0.02759905718266964, -0.3160908818244934, -0.2094178944826126, -0.18428412079811096, 0.12540604174137115, 0.5598305463790...
func DescDuration(d time.Duration) string { if d < time.Minute { return fmt.Sprintf("%0.1f sec ago", d.Seconds()) } else if d < time.Hour { return fmt.Sprintf("%0.1f min ago", d.Minutes()) } else if d < time.Hour*24 { return fmt.Sprintf("%0.1f hrs ago", d.Hours()) } else { return fmt.Sprintf("%0.1f days ago...
[ -0.4763921797275543, 0.461630254983902, 0.7839087843894958, -1.060869574546814, -1.0478665828704834, 0.3639608323574066, -0.39570677280426025, -0.4789840281009674, -0.10303252935409546, 0.4773196876049042, 1.2493629455566406, 0.05018887296319008, 0.809016764163971, 0.5862200260162354, 0....
func CreateBooksPath() string { return fmt.Sprintf("/books") }
[ 0.22208210825920105, -0.2673415243625641, 0.2169734239578247, 0.5086644887924194, 0.38775405287742615, 1.3648704290390015, -0.10413289070129395, -0.9868859648704529, -1.3569482564926147, 0.2684756815433502, 0.741356372833252, -0.5210313200950623, -0.613934338092804, 0.9983006715774536, -...
func (c *Client) NewCreateBooksRequest(ctx context.Context, path string, payload *CreateBooksPayload, contentType string) (*http.Request, error) { var body bytes.Buffer if contentType == "" { contentType = "*/*" // Use default encoder } err := c.Encoder.Encode(payload, &body, contentType) if err != nil { retur...
[ -0.6221697926521301, 0.09614741802215576, 0.7609036564826965, 0.15789783000946045, -0.6641477346420288, -0.552579402923584, -0.6569887399673462, -1.3126866817474365, -0.6780222654342651, 0.7898869514465332, 0.18217891454696655, 0.06478098779916763, -0.45827242732048035, 0.9504455327987671,...
func DeleteBooksPath(bookID int) string { param0 := strconv.Itoa(bookID) return fmt.Sprintf("/books/%s", param0) }
[ -0.5081225037574768, -0.6483181715011597, 0.24525614082813263, 0.7287079095840454, 0.18837924301624298, 0.8415132761001587, 0.2992652952671051, -0.24586932361125946, -0.5702568292617798, 0.35837769508361816, 0.35281237959861755, -0.43026211857795715, -0.6098182201385498, 1.3996775150299072...
func (c *Client) DeleteBooks(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewDeleteBooksRequest(ctx, path) if err != nil { return nil, err } return c.Client.Do(ctx, req) }
[ -1.1085401773452759, 0.31495964527130127, 0.4785466492176056, 0.7671360373497009, 0.08011084049940109, -0.25770583748817444, 0.45910075306892395, -0.763653039932251, 0.5635334849357605, -0.02424151450395584, -0.1661442220211029, 0.3497936427593231, -1.2045749425888062, 0.2541099190711975, ...
func (c *Client) NewDeleteBooksRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { scheme = "http" } u := url.URL{Host: c.Host, Scheme: scheme, Path: path} req, err := http.NewRequest("DELETE", u.String(), nil) if err != nil { return nil, err } if c.JWTSec...
[ -0.8443805575370789, -0.14626851677894592, 0.5667803287506104, 0.38128864765167236, -0.8187190294265747, -0.7946165800094604, -0.6624172329902649, -0.7361795902252197, -0.40661612153053284, 0.32041916251182556, 0.41085824370384216, 0.15792809426784515, -0.2594315707683563, 0.80243378877639...
func IsbnSearchBooksPath() string { return fmt.Sprintf("/books/add") }
[ -0.7611919641494751, 0.1519046276807785, 0.4832479655742645, 0.9804880023002625, 0.6606926918029785, 1.1072146892547607, 0.12932348251342773, -0.5327248573303223, -0.7173165082931519, 0.26274818181991577, 0.05512509122490883, -0.8894150257110596, -1.1237083673477173, -0.06266165524721146, ...
func (c *Client) IsbnSearchBooks(ctx context.Context, path string, bookIsbn string) (*http.Response, error) { req, err := c.NewIsbnSearchBooksRequest(ctx, path, bookIsbn) if err != nil { return nil, err } return c.Client.Do(ctx, req) }
[ -1.745013952255249, 0.513853907585144, 0.39767852425575256, 1.6368958950042725, 0.22378651797771454, -0.08443007618188858, -0.03166843205690384, -0.3120574355125427, -0.0970260426402092, 0.19913972914218903, -0.9081325531005859, -0.22798098623752594, -1.7938430309295654, -0.251083761453628...
func (c *Client) NewIsbnSearchBooksRequest(ctx context.Context, path string, bookIsbn string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { scheme = "http" } u := url.URL{Host: c.Host, Scheme: scheme, Path: path} values := u.Query() values.Set("book_isbn", bookIsbn) u.RawQuery = values.Encode()...
[ -1.3173593282699585, 0.06769976764917374, 0.37982016801834106, 0.8546059727668762, 0.1861172318458557, -0.4826514422893524, -0.42947593331336975, -0.15768872201442719, -0.9436889886856079, 0.10928061604499817, -0.14317628741264343, 0.3701019287109375, -0.7442248463630676, -0.05761551111936...
func ListBooksPath() string { return fmt.Sprintf("/books") }
[ -0.0034633225295692682, -0.6858077049255371, 0.40314292907714844, 0.6134195923805237, 0.008273460902273655, 0.7664346694946289, -0.22192977368831635, -1.119755506515503, -0.6272611021995544, 0.46330079436302185, 0.5099835991859436, 0.018047485500574112, -0.2353895902633667, 0.8463081121444...
func (c *Client) NewListBooksRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { scheme = "http" } u := url.URL{Host: c.Host, Scheme: scheme, Path: path} req, err := http.NewRequest("GET", u.String(), nil) if err != nil { return nil, err } return req, nil ...
[ -0.9669666886329651, -0.5018347501754761, 0.5517469048500061, 0.15743698179721832, -0.7928131222724915, -0.7260522246360779, -1.030448317527771, -0.6869899034500122, -0.375169962644577, 0.14191365242004395, 0.0935983955860138, 0.7929366827011108, -0.43792736530303955, 0.36062589287757874, ...
func ShowBooksPath(bookID int) string { param0 := strconv.Itoa(bookID) return fmt.Sprintf("/books/%s", param0) }
[ -0.1696791648864746, -0.24868664145469666, 0.2098531723022461, 0.36656445264816284, -0.358346551656723, 0.7446884512901306, 0.5524563193321228, -0.07212536036968231, -0.6653603911399841, 0.4945608973503113, 0.7612236738204956, -0.015461474657058716, -0.37707650661468506, 1.487701416015625,...
func (c *Client) ShowBooks(ctx context.Context, path string) (*http.Response, error) { req, err := c.NewShowBooksRequest(ctx, path) if err != nil { return nil, err } return c.Client.Do(ctx, req) }
[ -0.7891428470611572, 0.8387948274612427, 0.41604673862457275, 0.3706774413585663, -0.42936205863952637, -0.24397946894168854, 0.4300590753555298, -0.2535119950771332, 0.1635838896036148, 0.3448514938354492, -0.043503351509571075, 0.7754354476928711, -0.624860405921936, 0.4886826276779175, ...
func (c *Client) NewShowBooksRequest(ctx context.Context, path string) (*http.Request, error) { scheme := c.Scheme if scheme == "" { scheme = "http" } u := url.URL{Host: c.Host, Scheme: scheme, Path: path} req, err := http.NewRequest("GET", u.String(), nil) if err != nil { return nil, err } return req, nil ...
[ -0.6813856363296509, 0.19305746257305145, 0.5492074489593506, -0.07952681928873062, -0.87982577085495, -0.5603339672088623, -0.14495614171028137, -0.37059924006462097, -0.25221893191337585, 0.01940849795937538, 0.7489839196205139, 1.1584017276763916, -0.2851642370223999, 0.5157185196876526...
func UpdateBooksPath(bookID int) string { param0 := strconv.Itoa(bookID) return fmt.Sprintf("/books/%s", param0) }
[ -1.2181153297424316, -1.0189310312271118, 0.3539012670516968, 0.5538992881774902, -0.2637398838996887, 0.7458570003509521, 0.2889500856399536, -0.31140756607055664, -0.8159804344177246, 0.8853557109832764, 0.209980309009552, -0.34290266036987305, -0.8375967741012573, 1.1393747329711914, ...
func (c *Client) UpdateBooks(ctx context.Context, path string, payload *UpdateBooksPayload, contentType string) (*http.Response, error) { req, err := c.NewUpdateBooksRequest(ctx, path, payload, contentType) if err != nil { return nil, err } return c.Client.Do(ctx, req) }
[ -1.8764839172363281, -0.46463316679000854, 0.6014941334724426, 0.45496711134910583, -0.24050459265708923, 0.016329705715179443, 0.18644115328788757, -0.646621823310852, -0.156751349568367, 0.8070136904716492, -0.34033340215682983, 0.5159018635749817, -1.321566104888916, -0.1015139073133468...
func (c *Client) NewUpdateBooksRequest(ctx context.Context, path string, payload *UpdateBooksPayload, contentType string) (*http.Request, error) { var body bytes.Buffer if contentType == "" { contentType = "*/*" // Use default encoder } err := c.Encoder.Encode(payload, &body, contentType) if err != nil { retur...
[ -1.108588695526123, -0.35465919971466064, 0.911283016204834, 0.20784609019756317, -1.1355146169662476, -0.6283025741577148, -0.6457628607749939, -1.055547833442688, -0.6984104514122009, 1.0608783960342407, 0.26359620690345764, 0.28556111454963684, -0.5617735981941223, 0.5936669707298279, ...
func getFSType(path string) string { volumeNameSize, nFileSystemNameSize := uint32(260), uint32(260) var lpVolumeSerialNumber uint32 var lpFileSystemFlags, lpMaximumComponentLength uint32 var lpFileSystemNameBuffer, volumeName [260]uint16 var ps = syscall.StringToUTF16Ptr(filepath.VolumeName(path)) // Extract va...
[ 0.32429948449134827, -0.39137977361679077, 0.8594719171524048, -0.7370129823684692, -0.042097389698028564, -0.8326142430305481, -0.4711245596408844, -1.3943122625350952, -0.25982293486595154, -0.3518001437187195, 0.46481630206108093, -0.12511150538921356, -0.5829877257347107, 0.23197290301...
func NewGreedyPool(size int, close PoolFunc) *greedyPool { pool := &greedyPool{ pool: make(chan PoolFunc, size), over: make(chan struct{}), close: close, } go pool.scheduler(size) return pool }
[ -0.06857467442750931, 0.20881937444210052, 0.5674429535865784, 0.008872570469975471, -1.3860620260238647, -0.06424254179000854, 0.45035791397094727, -0.7613117694854736, -0.346371054649353, -0.3403889834880829, -0.8300387859344482, 1.095163106918335, 0.14489415287971497, -0.003781036939471...
func (g *greedyPool) Over() { close(g.over) }
[ -0.7836576700210571, -0.5936986804008484, 0.2660163640975952, 0.00825642328709364, -0.39125657081604004, 1.9796967506408691, 1.1737878322601318, -0.7186272144317627, -1.0586800575256348, 0.2036074548959732, 0.3688603937625885, 1.0436668395996094, -0.3729889988899231, 0.6193079948425293, ...
func (g *greedyPool) Send(fn PoolFunc) { g.pool <- fn }
[ -0.3567153811454773, 0.4103529155254364, 0.18136736750602722, -0.059419963508844376, 1.0742202997207642, 0.849911630153656, 0.3717647194862366, -0.959568202495575, -1.293320894241333, 0.06820325553417206, -1.2982177734375, 0.9173615574836731, 0.43082720041275024, -0.13577936589717865, -0...
func getBlackDuckMasterKey(namespace string, name string, filePath string) error { // getting the seal key secret to retrieve the seal key secret, err := util.GetSecret(kubeClient, namespace, fmt.Sprintf("%s-blackduck-upload-cache", name)) if err != nil { return fmt.Errorf("unable to find Seal key secret (%s-black...
[ -0.36846283078193665, -0.24307183921337128, 0.9534018635749817, 0.16331815719604492, 0.14411598443984985, -0.3701220452785492, -0.28666970133781433, -0.13503830134868622, -0.3354651629924774, 0.8658034801483154, -0.26006272435188293, 1.5555548667907715, -0.7870767712593079, 0.6881908178329...
func GithubStars(userOrRepo string, conf *Config) (count int, err error) { if len(userOrRepo) == 0 { return 0, errors.New("must supply a userOrRepo") } ctx := context.Background() ts := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: conf.GithubAPIKey}, ) tc := oauth2.NewClient(ctx, ts) client := githu...
[ -0.7792941331863403, 0.49954459071159363, 0.5311833024024963, -0.12413942068815231, -0.36125579476356506, -0.1706506609916687, -0.33469754457473755, 0.9327071309089661, 0.584087073802948, 0.28256815671920776, -0.20725718140602112, 0.5803228616714478, -0.4274587035179138, 0.6565137505531311...
func (a *AnnotationsService) Create(annotation *Annotation) (*Annotation, *http.Response, error) { u := fmt.Sprintf("annotations/%s", *annotation.Name) req, err := a.client.NewRequest("POST", u, annotation) if err != nil { return nil, nil, err } an := new(Annotation) resp, err := a.client.Do(req, an) if err !...
[ -0.4416244328022003, -0.012601049616932869, 0.3062169551849365, 0.458650141954422, 0.24107375741004944, -0.03492317348718643, -0.06553768366575241, -0.4857501983642578, 0.037734001874923706, 0.30380892753601074, -0.8748576641082764, 0.27119654417037964, -0.9381579160690308, 0.3982870578765...
func getPath() string { return os.Getenv(pathEnvVar) }
[ 0.5889549255371094, -0.668134331703186, 0.2080756574869156, 0.8187317848205566, 0.2314058542251587, 1.268553614616394, 1.016926884651184, -1.1158738136291504, -0.7819138765335083, 0.3461301624774933, 0.20601193606853485, 0.476489394903183, -0.5189225077629089, 0.9244195818901062, 0.81016...
func setPath(value string) { os.Setenv(pathEnvVar, value) }
[ 0.8644989132881165, -0.41162341833114624, 0.23228740692138672, 0.27855753898620605, -0.4567375183105469, 2.0308005809783936, 0.9677835702896118, -0.800252377986908, -1.1249293088912964, 0.2821117043495178, -0.5532214045524597, 0.08968283236026764, -0.07345708459615707, 1.3092643022537231, ...
func prependPath(value string) { originalPath := getPath() newPath := fmt.Sprintf("%s%c%s", value, os.PathListSeparator, originalPath) setPath(newPath) }
[ 0.5016837120056152, -0.050014566630125046, 0.44902944564819336, -0.0742681547999382, -0.2624846398830414, 0.8572038412094116, 0.4584200084209442, 0.5692417025566101, 0.3750859797000885, 0.06716512143611908, 0.31460264325141907, -0.44106313586235046, 0.03662200644612312, 0.7460834383964539,...
func removePath(regexValue string) { regex, _ := regexp.Compile(regexValue) newPath := regex.ReplaceAllString(getPath(), "") setPath(newPath) }
[ -0.0911102145910263, -0.7770171165466309, 0.5814747214317322, -0.26428744196891785, -0.3833283483982086, 0.056152306497097015, 0.9831252694129944, 1.008856177330017, -0.03140813484787941, -0.16376908123493195, 0.1002136617898941, 0.002690777415409684, -0.8687497973442078, -0.13435128331184...
func StatesEq(a *State, b *State) bool { return reflect.DeepEqual(a, b) }
[ -1.6783177852630615, 0.0441349595785141, 0.5750386714935303, 0.01934049464762211, -0.519187867641449, -0.22339315712451935, -0.28840136528015137, -0.25089871883392334, -0.12372827529907227, 0.5084443092346191, -1.0147992372512817, -0.3650500476360321, 0.4486406147480011, -0.447290480136871...
func (*Dimension) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Dimension_DecimalValue)(nil), (*Dimension_LongValue)(nil), (*Dimension_StringValue)(nil), } }
[ -0.8276396989822388, 0.15896040201187134, 0.46063995361328125, 0.4526507258415222, 0.3613041937351227, 0.1592281013727188, -0.144605815410614, -0.8376846313476562, 0.5070120096206665, 0.044776152819395065, -0.20920860767364502, 0.43569403886795044, 0.010710373520851135, 1.294036626815796, ...
func (*Tag) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Tag_DecimalValue)(nil), (*Tag_LongValue)(nil), (*Tag_StringValue)(nil), } }
[ -0.7282711863517761, 0.037375558167696, 0.40869203209877014, 0.15674342215061188, 0.908290445804596, -0.13090991973876953, -0.25653359293937683, -0.9099446535110474, 0.32200103998184204, -0.3051474094390869, -0.5438282489776611, -0.11679264903068542, 0.3470636010169983, 1.5836586952209473,...
func (*Bit) XXX_OneofWrappers() []interface{} { return []interface{}{ (*Bit_DecimalValue)(nil), (*Bit_LongValue)(nil), } }
[ -1.0974785089492798, 0.3074358105659485, 0.3861529529094696, 0.5160064101219177, 0.6592462062835693, 0.26076531410217285, -0.037939298897981644, -0.9997950196266174, 0.5519312620162964, -0.47597992420196533, -0.3169421851634979, 0.48814138770103455, 0.06151751056313515, 1.4135926961898804,...
func NewClient(ctx context.Context, url string, insecure bool) (*Client, error) { if url == "" { return nil, errors.New("vcenter url is empty") } if ctx == nil { return nil, errors.New("context is nil") } parsedurl, err := soap.ParseURL(url) if err != nil { return nil, err } govmomiClient, govmomiErr :...
[ 0.108596071600914, -0.32588106393814087, 0.5278590321540833, 0.2931099534034729, -0.43268516659736633, -0.14600041508674622, -0.10376943647861481, -0.08437013626098633, 0.9996552467346191, 0.7294320464134216, 0.14932525157928467, 0.9978898763656616, -1.335146188735962, -0.5823975205421448,...
func (vc *Client) GetContext() context.Context { return vc.context }
[ 0.7700654864311218, 0.12278243899345398, 0.3846084177494049, 0.6597723364830017, 0.23366694152355194, 0.27220335602760315, 0.42661768198013306, -0.6639230251312256, 0.9863973259925842, -0.1791168600320816, -0.11360569298267365, 1.1396795511245728, -1.626555323600769, -0.46207183599472046, ...
func NewWriter(buf []byte) *Writer { return &Writer{buf[:0]} }
[ 0.26700320839881897, -0.1410009115934372, -0.17947083711624146, 0.6526810526847839, 0.37270164489746094, -0.8000181913375854, 0.43269988894462585, 0.14606374502182007, 0.2683154046535492, -0.009897677227854729, -0.1946040391921997, -0.5404807329177856, -0.6340858936309814, -0.1192960441112...
func (w *Writer) Put1(n int) *Writer { if n < 0 || 1<<8 <= n { panic("stor.Writer.Put1 value outside range") } w.buf = append(w.buf, byte(n)) return w }
[ -0.8062351942062378, 1.1535422801971436, 0.37616831064224243, 0.30831751227378845, -0.6632174253463745, 0.87408047914505, 0.5842534303665161, -0.723682701587677, -0.36563950777053833, 0.1561708152294159, -0.16162173449993134, -0.07429026067256927, -0.9728356599807739, 0.32979103922843933, ...
func (w *Writer) Put2(n int) *Writer { if n < 0 || 1<<16 <= n { panic("stor.Writer.Put2 value outside range") } w.buf = append(w.buf, byte(n), byte(n>>8)) return w }
[ -0.5365577340126038, 0.5447292327880859, 0.5564893484115601, -0.3033353388309479, -0.9744285345077515, 0.47953206300735474, -0.14483624696731567, -1.4512869119644165, -1.0993260145187378, -0.7234634160995483, -0.48792004585266113, 0.11550570279359818, -0.4934370517730713, 0.403185755014419...
func (w *Writer) Put3(n int) *Writer { if n < 0 || 1<<24 <= n { panic("stor.Writer.Put3 value outside range") } w.buf = append(w.buf, byte(n), byte(n>>8), byte(n>>16)) return w }
[ -0.8038705587387085, 1.3391531705856323, 0.5108164548873901, -0.35072416067123413, -0.38814887404441833, 1.0901894569396973, -0.503220796585083, -0.9929742813110352, 0.021961811929941177, -0.29674890637397766, -0.6727170348167419, -0.1306474208831787, -1.2646067142486572, -0.44033178687095...
func (w *Writer) Put4(n int) *Writer { if n < 0 || 1<<32 <= n { panic("stor.Writer.Put4 value outside range") } w.buf = append(w.buf, byte(n), byte(n>>8), byte(n>>16), byte(n>>24)) return w }
[ -0.7024575471878052, 0.963840663433075, 0.5617578029632568, -0.3960671126842499, -0.39214691519737244, 0.4904157221317291, 0.20768196880817413, -1.5967658758163452, -0.9484580159187317, -0.6206151843070984, -0.7636959552764893, -0.5975010991096497, -1.5464448928833008, 0.352150559425354, ...
func (w *Writer) Put5(n uint64) *Writer { if n >= 1<<40 { panic("stor.Writer.Put5 value outside range") } w.buf = append(w.buf, byte(n), byte(n>>8), byte(n>>16), byte(n>>24), byte(n>>32)) return w }
[ -1.077735424041748, 1.17741060256958, 0.3104025721549988, -0.5384601354598999, -0.9663962125778198, 0.5836238265037537, 0.9407672882080078, -1.6799821853637695, -0.8598167300224304, -0.08774365484714508, -1.3882746696472168, -0.39109545946121216, -0.9369196891784668, 0.2913394272327423, ...
func (w *Writer) PutStr(s string) *Writer { w.Put2(len(s)) w.buf = append(w.buf, s...) return w }
[ 0.11673671007156372, 0.6669718623161316, 0.44507086277008057, -0.782946765422821, -0.06596517562866211, -0.11636867374181747, 0.7795242667198181, -0.41453468799591064, -0.1385641247034073, -1.5094726085662842, -0.9148294925689697, 0.13790766894817352, -0.028716502711176872, -0.325576335191...
func LenStr(s string) int { return 2 + len(s) }
[ -0.24642372131347656, -0.5136040449142456, 0.42104652523994446, -0.7259116768836975, -0.7577044367790222, -0.08035218715667725, -0.6493970155715942, -0.1762845665216446, 0.9429168701171875, -0.9831607937812805, -0.4281609356403351, 0.14272965490818024, 0.3037034571170807, -0.71275836229324...
func (w *Writer) PutStrs(ss []string) *Writer { w.Put2(len(ss)) for _, col := range ss { w.PutStr(col) } return w }
[ -0.7203152775764465, 0.8372297883033752, 0.3701810836791992, -0.832687497138977, 0.20686772465705872, -0.22151434421539307, 0.3519308567047119, -0.6945181488990784, -0.5362255573272705, -0.24652044475078583, 0.300235778093338, 0.380854994058609, -0.04123661294579506, 0.23758642375469208, ...
func LenStrs(ss []string) int { n := 2 for _, s := range ss { n += LenStr(s) } return n }
[ -0.0959441289305687, -0.7528122663497925, 0.45994487404823303, -0.8113569021224976, 0.1558559536933899, -0.5910166501998901, -0.3671068549156189, -0.4772423207759857, 0.5990610122680664, -0.25257107615470886, -0.045250535011291504, 0.478853315114975, 0.21707652509212494, 0.4810987412929535...
func (w *Writer) Len() int { return len(w.buf) }
[ 0.2057107836008072, -0.14645007252693176, -0.06023119390010834, -0.6246722936630249, 0.630923330783844, -0.7857908010482788, 1.6853207349777222, 1.0466796159744263, -0.8133832812309265, -0.9828431606292725, -1.3995155096054077, -0.5434396266937256, 0.16552752256393433, 0.15179266035556793,...
func (r *Reader) Get1() int { n := int(r.buf[0]) r.buf = r.buf[1:] return n }
[ -0.3299816846847534, 0.21499593555927277, 0.7561904788017273, -0.041112758219242096, -0.17798319458961487, -0.3534235656261444, 0.8345815539360046, 0.053859662264585495, -0.6960350871086121, -0.5225148797035217, -0.502999484539032, 1.2358267307281494, -1.0094995498657227, -0.18014746904373...
func (r *Reader) Get2() int { n := int(r.buf[0]) + int(r.buf[1])<<8 r.buf = r.buf[2:] return n }
[ -0.016154158860445023, -0.43003717064857483, 0.8182427883148193, -0.47323739528656006, -0.4831424057483673, -0.46148958802223206, 0.021382728591561317, -0.6182970404624939, -0.7797825932502747, -1.0766515731811523, -0.8807419538497925, 1.0970245599746704, -0.5725836157798767, -0.0556813515...
func (r *Reader) Get3() int { n := int(r.buf[0]) + int(r.buf[1])<<8 + int(r.buf[2])<<16 r.buf = r.buf[3:] return n }
[ 0.1348586082458496, 0.4618346691131592, 0.7352975606918335, -0.3379259407520294, -0.06644728779792786, 0.17846709489822388, -0.024152450263500214, -0.25233808159828186, 0.0650663897395134, -0.7289654612541199, -0.9609321355819702, 0.859906017780304, -0.8852289915084839, -1.255796194076538,...
func (r *Reader) Get4() int { n := int(r.buf[0]) + int(r.buf[1])<<8 + int(r.buf[2])<<16 + int(r.buf[3])<<24 r.buf = r.buf[4:] return n }
[ 0.07755791395902634, -0.19422954320907593, 0.7969033718109131, -0.6604651808738708, 0.06260824203491211, -0.5819214582443237, 0.4642271399497986, -0.621787428855896, -0.5001363158226013, -1.0997424125671387, -0.6662341356277466, 0.5879408717155457, -1.3873522281646729, -0.22111983597278595...
func (r *Reader) Get5() uint64 { n := uint64(r.buf[0]) + uint64(r.buf[1])<<8 + uint64(r.buf[2])<<16 + uint64(r.buf[3])<<24 + uint64(r.buf[4])<<32 r.buf = r.buf[5:] return n }
[ -0.2597247362136841, 0.14482149481773376, 0.6842128038406372, -0.6166483163833618, -0.332867294549942, -0.5386638045310974, 1.2884522676467896, -0.8105369806289673, -0.33559659123420715, -0.6213105916976929, -0.9847862124443054, 0.48830246925354004, -1.16832435131073, -0.3958311378955841, ...
func (r *Reader) GetStr() string { n := r.Get2() s := string(r.buf[:n]) r.buf = r.buf[n:] return s }
[ 0.2906703054904938, -0.4089844524860382, 0.39921432733535767, -0.10206764191389084, -0.0023730993270874023, -0.1980457752943039, -0.06622298806905746, -0.8046630024909973, -0.5030032396316528, -1.462038516998291, -0.0768020823597908, 0.7077494859695435, -0.09513788670301437, -0.40262928605...
func (r *Reader) GetStrs() []string { n := r.Get2() ss := make([]string, n) for i := 0; i < n; i++ { ss[i] = r.GetStr() } return ss }
[ -0.3787236213684082, -0.24095574021339417, 0.49803537130355835, -0.3115101158618927, 0.2654399871826172, -0.5203010439872742, -0.8653584122657776, -0.793329119682312, -0.05038776993751526, -0.5287779569625854, 0.34930646419525146, 1.450840950012207, -0.5073497295379639, 0.4695695638656616,...
func (r *Reader) Remaining() int { return len(r.buf) }
[ -0.06806810945272446, -1.1015043258666992, 0.4477141797542572, -0.9341674447059631, 0.11600541323423386, 0.3915649652481079, -0.42843928933143616, -0.7937846779823303, -0.15626853704452515, -1.0625256299972534, -1.2442057132720947, -0.46870630979537964, -0.8940484523773193, 0.4831608831882...
func (adapter Adapter) AddPage(page core.Page) (core.Page, error) { cleanAddPageInput(&page) errs := page.Validate() if len(errs) > 0 { return core.Page{}, core.ErrNotValidated } page.CreatedAt = adapter.GetCurrentTime() page.UpdatedAt = adapter.GetCurrentTime() _, err := adapter. Session. Model(&page). ...
[ -1.134385347366333, 0.069529689848423, 0.8665290474891663, -0.10698039829730988, -0.09735783189535141, 0.5933376550674438, -0.06638402491807938, -0.38487565517425537, 0.43308937549591064, -0.2917761504650116, 0.8234994411468506, -1.182007908821106, -1.1237291097640991, 0.3152563273906708, ...
func (adapter Adapter) AddPageFromTemplate( page core.PageInput, templateID int, ) (core.Page, error) { template, err := adapter.GetTemplate(templateID) if err != nil { return core.Page{}, err } var fields []core.PageField for _, field := range template.Fields { fields = append(fields, core.PageField{ Na...
[ -0.1429658830165863, -0.3031204044818878, 0.43394237756729126, -0.7688214778900146, -0.42685770988464355, -0.020866164937615395, -0.7839423418045044, -0.08362243324518204, 0.03943796828389168, -0.09452786296606064, 0.348906934261322, -1.2138898372650146, -0.4710167646408081, 0.399359166622...
func (adapter Adapter) AddPageField(pageID int, field core.PageField) error { errs := field.Validate() if len(errs) > 0 { return core.ErrNotValidated } field.PageID = pageID field.CreatedAt = adapter.GetCurrentTime() field.UpdatedAt = adapter.GetCurrentTime() _, err := adapter. Session. Model(&field). ...
[ -0.9260284900665283, -0.372891902923584, 0.7679137587547302, -0.4450971782207489, 0.2497963160276413, 0.6886594295501709, -0.40555495023727417, -0.3332573175430298, -0.11449021846055984, 0.4266335368156433, -0.3251519203186035, -0.9662187695503235, -0.7743654251098633, 0.39049363136291504,...
func (adapter Adapter) GetPage(id int) (core.Page, error) { page := core.Page{} err := adapter. Session. Model(&page). Where("id = ?", id). Relation("Fields"). Select() return page, err }
[ -0.0014535851078107953, 0.6420987248420715, 0.6249596476554871, -0.14230795204639435, 0.37322351336479187, -0.51200932264328, 0.1888321489095688, -0.8887251019477844, 0.36299076676368713, -0.14263826608657837, 0.8633183240890503, -0.5857356190681458, -0.7068067193031311, -0.256581455469131...
func (adapter Adapter) GetPageBySlug(slug string) (core.Page, error) { page := core.Page{} err := adapter. Session. Model(&page). Where("slug = ?", slug). Relation("Fields"). Select() return page, err }
[ 0.19714808464050293, -0.21652044355869293, 0.3988793194293976, 0.05980728194117546, 0.2185399979352951, -0.5647874474525452, 0.04823831841349602, -0.03474606201052666, 0.05395948514342308, 0.08508490771055222, 0.10662523657083511, -0.4620400667190552, -0.6229328513145447, -0.23306018114089...
func (adapter Adapter) GetPagesFromDirectory(id int) ([]core.Page, error) { pages := []core.Page{} err := adapter. Session. Model(&pages). Where("parent_id = ?", id). Relation("Fields"). Select() return pages, err }
[ 0.05060981586575508, 0.16134080290794373, 0.580845296382904, 0.010458892211318016, 0.6137948632240295, -0.5434120893478394, -0.09145137667655945, -1.115442156791687, 0.8679715991020203, -0.14314070343971252, 0.09104947000741959, 0.4387226700782776, 0.5040637254714966, 0.8111633062362671, ...
func (adapter Adapter) UpdatePage(id int, data core.PageInput) error { if len(data.Validate()) > 0 { return core.ErrNotValidated } page := core.Page{} page.ID = id page.UpdatedAt = adapter.GetCurrentTime() query := adapter. Session. Model(&page). Column("updated_at") if data.IsPublished != nil { pag...
[ -1.333900809288025, -0.928254246711731, 0.5017363429069519, -0.2973847985267639, -0.21616190671920776, 0.0706193670630455, -0.20299069583415985, 0.13438533246517181, -0.3968833088874817, 0.292309433221817, 0.26228785514831543, -0.6563925743103027, -0.5123680233955383, 0.32857072353363037, ...
func (adapter Adapter) UpdatePageField(id int, data core.PageFieldInput) error { if len(data.Validate()) > 0 { return core.ErrNotValidated } pageField := core.PageField{} pageField.ID = id pageField.UpdatedAt = adapter.GetCurrentTime() query := adapter. Session. Model(&pageField). Column("updated_at") ...
[ -1.4122244119644165, -1.1931594610214233, 0.5557084679603577, -0.39618638157844543, -0.8991349935531616, 0.6935827732086182, -0.3084319531917572, -0.505763590335846, -0.13855749368667603, 0.9754117727279663, -0.7046434283256531, -0.41212648153305054, -0.6314361095428467, 0.0448639839887619...
func (adapter Adapter) RemovePage(id int) error { _, err := adapter. Session. Exec("DELETE FROM pages WHERE id = ?", id) return err }
[ -0.9793465733528137, 0.3219437301158905, 0.37263983488082886, -0.2515793442726135, 0.06805093586444855, -0.5123900175094604, -0.4209764301776886, -0.07174576073884964, 0.6436952352523804, 0.471014142036438, 0.6328355669975281, -1.2450495958328247, -0.7524295449256897, -0.19617672264575958,...
func (adapter Adapter) RemovePageField(id int) error { pageField := core.PageField{} pageField.ID = id err := adapter. Session. Model(&pageField). WherePK(). Select() if err != nil { return err } _, err = adapter. Session. Model(&pageField). WherePK(). Delete() if err != nil { return err ...
[ -0.896507978439331, -0.6405197978019714, 0.5570274591445923, -0.4478708803653717, -0.5721375346183777, 0.05786057561635971, -0.009666197001934052, 0.2687154710292816, -0.051738228648900986, 0.993843674659729, -0.617411196231842, -0.9509986042976379, -1.068342924118042, 0.1713825911283493, ...