text
stringlengths
11
6.3k
embedding
listlengths
768
768
func LexItems(items ...lex.Item) <-chan lex.Item { ch := make(chan lex.Item) go func() { for _, item := range items { ch <- item } close(ch) }() return ch }
[ 0.45819398760795593, 0.037191033363342285, 0.5806061625480652, 0.05298599973320961, -0.1167553961277008, 0.29666662216186523, -1.3817346096038818, -0.27269208431243896, -0.9998760223388672, -0.2302432507276535, -0.26089969277381897, 0.23267795145511627, -0.4184568226337433, -0.406414210796...
func LoadLocation(name string) *time.Location { loc, err := time.LoadLocation(name) if err != nil { panic(err) } return loc }
[ -0.09646366536617279, 0.2102702260017395, 0.5569236874580383, -0.025820575654506683, -1.5265398025512695, -0.4799623489379883, 0.3906642198562622, -0.2987174391746521, 0.5823475122451782, 0.8812537789344788, -0.7796048521995544, -0.5861622095108032, -0.3517651855945587, 0.20248250663280487...
func NewMothership(host, username, password, binary string, port int, notls, verifytls bool, env environment.Environment) (*Mothership, error) { m := &Mothership{Host: host, Port: port, NoTLS: notls, VerifyTLS: verifytls, Username: username, Password: password, Binary: binary} // Push the uplink to the mothership u...
[ 0.23767031729221344, -0.9593494534492493, 0.5893262624740601, 0.13836674392223358, -0.27598968148231506, -0.05526520311832428, -0.3591372072696686, -0.0725451409816742, 0.054434988647699356, -0.09139537066221237, -0.20445728302001953, 0.5365667939186096, -0.1444852203130722, 0.768060266971...
func (m *Mothership) bin(request string) (string, error) { commandList := strings.Split(m.CLICommand(), " ") commandList = append(commandList, strings.Split(request, " ")...) cmd := exec.Command(commandList[0], commandList[1:]...) logrus.Debugf("mothership command: %v", cmd.Args) byteOutput, err := cmd.CombinedOu...
[ -0.5500972270965576, -0.5447853803634644, 1.1101864576339722, 0.7970497012138367, -0.44360676407814026, 0.14275555312633514, -0.6735788583755493, -1.2824053764343262, 0.1710667759180069, -0.21630245447158813, 0.8221363425254822, 0.6187801957130432, -0.0391666404902935, 1.1077417135238647, ...
func (m *Mothership) CLICommand() string { tlsFlag := "" if m.NoTLS { tlsFlag = "--notls" } var tlsInsecureFlag string if !m.VerifyTLS { tlsInsecureFlag = "--tlsInsecureSkipVerify" } bin := fmt.Sprintf("%s --username %s --password %s --host %s --port %d %s %s", m.Binary, m.Username, m.Password, m.Hos...
[ 0.8045859932899475, -0.23686061799526215, 0.9174100160598755, 0.4118306636810303, 0.43054187297821045, 0.7231644988059998, -0.5500087141990662, 0.04275701940059662, -0.5811800360679626, 0.9438114166259766, -0.059423256665468216, 0.4776982367038727, 0.05235011875629425, 0.39984261989593506,...
func InitRotateCluster(cluster *model.Cluster, rotatorMetadata *RotatorMetadata, logger *logrus.Entry) (*RotatorMetadata, error) { rotatorMetadata, err := RotateCluster(cluster, logger, rotatorMetadata) if err != nil { logger.WithError(err).Error("failed to rotate cluster") return rotatorMetadata, err } return...
[ -0.427117258310318, -0.23113714158535004, 0.45650577545166016, -0.268050879240036, 0.5966320037841797, -0.09780635684728622, -0.26692813634872437, -0.43032532930374146, -0.12449563294649124, 0.2541530728340149, -0.2015613466501236, 1.452086329460144, -0.5817796587944031, -0.407374322414398...
func RotateCluster(cluster *model.Cluster, logger *logrus.Entry, rotatorMetadata *RotatorMetadata) (*RotatorMetadata, error) { clientset, err := getk8sClientset(cluster) if err != nil { return rotatorMetadata, err } if rotatorMetadata.MasterGroups == nil && rotatorMetadata.WorkerGroups == nil { err = rotatorMe...
[ -0.8842039108276367, -0.12493683397769928, 0.6165819764137268, -0.5661404132843018, 0.7647871971130371, -0.11874312907457352, 0.3320672810077667, -0.059996481984853745, -0.61061030626297, 0.572586178779602, 0.15949977934360504, 1.0240147113800049, -0.5339032411575317, 0.09353315085172653, ...
func FinalCheck(autoscalingGroup *AutoscalingGroup, clientset *kubernetes.Clientset, logger *logrus.Entry) error { asg, err := awsTools.AutoScalingGroupReady(autoscalingGroup.Name, autoscalingGroup.DesiredCapacity, logger) if err != nil { return errors.Wrap(err, "Failed to get AutoscalingGroup ready") } asgNodes...
[ -0.22804312407970428, 0.4786268174648285, 0.559173047542572, -0.15076641738414764, 0.21839165687561035, 0.5923709273338318, 0.2647457420825958, -0.6965380907058716, -1.0228679180145264, 0.6588582396507263, 0.848735511302948, 0.802010715007782, 0.8804042339324951, 0.6057857275009155, 1.17...
func MasterNodeRotation(cluster *model.Cluster, autoscalingGroup *AutoscalingGroup, clientset *kubernetes.Clientset, logger *logrus.Entry) error { for len(autoscalingGroup.Nodes) > 0 { logger.Infof("The number of nodes in the ASG to be rotated is %d", len(autoscalingGroup.Nodes)) nodesToRotate := []string{autosc...
[ -0.36524078249931335, 0.45717865228652954, 0.799798846244812, -1.104427695274353, 0.20375630259513855, -0.544256329536438, 0.3659634292125702, 0.017092864960432053, -0.31719711422920227, 1.3344732522964478, -0.28713735938072205, 0.48571136593818665, -0.38132575154304504, -0.368904381990432...
func WorkerNodeRotation(cluster *model.Cluster, autoscalingGroup *AutoscalingGroup, clientset *kubernetes.Clientset, logger *logrus.Entry) error { for len(autoscalingGroup.Nodes) > 0 { logger.Infof("The number of nodes in the ASG to be rotated is %d", len(autoscalingGroup.Nodes)) var nodesToRotate []string if...
[ -0.5758113265037537, 0.7427866458892822, 0.777030348777771, -1.2140295505523682, 0.2940610647201538, -0.3924568295478821, 0.5913590788841248, -0.5215488076210022, -0.6122170686721802, 0.9919993877410889, -0.17479579150676727, 0.3825834095478058, -0.24954432249069214, -0.566550076007843, ...
func NewAgentPool(l logger.Logger, workers []*AgentWorker) *AgentPool { return &AgentPool{ logger: l, workers: workers, } }
[ -0.3253282904624939, -1.5180401802062988, 0.05586310476064682, 0.22418862581253052, -0.868715226650238, 0.14762574434280396, -0.23714584112167358, -0.09524622559547424, 0.09148608148097992, 0.36685702204704285, -0.1366216093301773, 0.4340308904647827, 0.18430939316749573, 0.222993403673172...
func (r *AgentPool) Start() error { var wg sync.WaitGroup var spawn int = len(r.workers) var errs = make(chan error, spawn) // Spawn goroutines for each parallel worker for _, worker := range r.workers { wg.Add(1) go func(worker *AgentWorker) { defer wg.Done() if err := r.runWorker(worker); err != nil...
[ 0.04227537661790848, -0.7928729057312012, 0.4601697027683258, -0.08219560235738754, 0.443990021944046, 0.1923079490661621, 0.275845468044281, 0.16615886986255646, -0.5685186982154846, 0.7223924994468689, -0.26447972655296326, 0.6913747191429138, 0.03445710986852646, 0.11083029210567474, ...
func ShowBanner(l logger.Logger, conf AgentConfiguration) { welcomeMessage := "\n" + "%s _ _ _ _ _ _ _ _\n" + " | | (_) | | | | (_) | | |\n" + " | |__ _ _ _| | __| | | ___| |_ ___ __ _ __ _ ___ _ __ | |_\n" + ...
[ 1.092400074005127, -0.569211483001709, 1.2672641277313232, 0.28782835602760315, -0.5363144874572754, -0.2814226448535919, 0.4809955954551697, 0.7385671138763428, -0.3288877308368683, 0.4292851686477661, -0.4044394791126251, 0.609761655330658, 0.345181405544281, 0.9488996267318726, 1.2025...
func (d *db) UpdateReposUntrusted() error { logrus.Info("updating all repos to untrusted") // set all repos to untrusted err := d.Gorm.Exec(UpdateReposTableSetUntrusted).Error if err != nil { return fmt.Errorf("unable to update %s table: %v", constants.TableRepo, err) } logrus.Info("successfully updated all rep...
[ -0.6868159770965576, -0.12426670640707016, 0.3384036421775818, -0.40872007608413696, 0.19271546602249146, 0.07472208142280579, 0.4428238272666931, 0.23497605323791504, -0.3057965636253357, 0.48225417733192444, -0.5817065834999084, 0.4374472200870514, -0.33100348711013794, 0.296617686748504...
func NewLdap(addr, sf, bDN string) (l *Ldap) { l = &Ldap{Addr: addr, BaseDN: bDN, Suff: sf} return }
[ 1.2434192895889282, -0.68071448802948, 0.4928824305534363, -0.1353272944688797, -0.5421943664550781, 0.6374924182891846, -0.5217629671096802, 0.7306445837020874, 0.2717614471912384, -0.4964587688446045, 0.24839822947978973, 0.8270453214645386, 0.19129641354084015, -0.3531213104724884, 0....
func NewLdapWithAcc(addr, sf, bDN, user, pass string) (l *Ldap) { l = &Ldap{ Addr: addr, BaseDN: bDN, Suff: sf, User: user, Pass: pass, } return }
[ 0.5603333711624146, -0.48724642395973206, 0.5960179567337036, -0.559229850769043, -0.6736911535263062, 0.6543712019920349, 0.37489280104637146, 0.7185159921646118, 0.24429291486740112, -0.49741125106811523, 0.06984101235866547, 0.5752081274986267, 0.1461033821105957, -0.39097654819488525, ...
func (l *Ldap) newConn(u, p string) (c *ldap.Conn, e error) { var cfg *tls.Config cfg = &tls.Config{InsecureSkipVerify: true} c, e = ldap.DialTLS("tcp", l.Addr, cfg) if e == nil { e = c.Bind(string(u)+l.Suff, p) } return }
[ 0.046366773545742035, -0.31803950667381287, 0.5218608379364014, -0.029491718858480453, -0.7659211754798889, 0.4203721582889557, -0.3828280568122864, 1.4072329998016357, 0.7110492587089539, -0.12038030475378036, -0.4955350458621979, 0.6782368421554565, 0.3951658606529236, -0.013921586796641...
func (l *Ldap) Authenticate(u, p string) (e error) { var c *ldap.Conn c, e = l.newConn(u, p) if e == nil { c.Close() } return }
[ -0.923458993434906, -0.1578443944454193, 0.5064979791641235, -0.14445573091506958, 0.1948307305574417, 0.24968335032463074, -0.5564602017402649, 0.46047139167785645, 0.27626171708106995, -0.1699771285057068, 0.031079214066267014, 0.5971472859382629, -1.0705430507659912, -0.8260046243667603...
func (l *Ldap) MembershipCNs(mp map[string][]string) (m []string, e error) { ms, ok := mp[MemberOf] if !ok { e = fmt.Errorf("Couldn't get membership of %s", mp[SAMAccountName]) } if e == nil { m = make([]string, 0) for _, j := range ms { if strings.HasPrefix(j, cnPref) { ns := strings.TrimLeft(j, c...
[ -0.72822505235672, -0.25904393196105957, 0.6415446996688843, -0.1845099776983261, 0.4813440442085266, -0.5640873908996582, -0.37684446573257446, -0.7949603199958801, 1.5458260774612427, 0.662739634513855, -0.0038120783865451813, 0.35825663805007935, -0.12919054925441742, 0.1816343516111374...
func (l *Ldap) DNFirstGroup(mp map[string][]string) (d string, e error) { m, ok := mp[DistinguishedName] if !ok { e = fmt.Errorf("Couldn't get DN of %s", mp[SAMAccountName]) } if e == nil && len(m) > 0 { i, ms, ok := 0, strings.Split(m[0], ","), false for !ok && i != len(ms) { ok = strings.HasPrefix(ms...
[ -0.11155460774898529, 0.24737504124641418, 0.5286350846290588, -0.6630057692527771, -0.9116042256355286, -1.3065094947814941, -0.4014054834842682, -0.21782077848911285, 0.7109139561653137, -0.027813438326120377, 0.7374089956283569, 0.5288997888565063, 0.35220813751220703, 0.801017880439758...
func (l *Ldap) FullName(mp map[string][]string) (m string, e error) { s, ok := mp[CN] if ok && len(s) == 1 { m = s[0] } else if !ok { e = fmt.Errorf("Full name not found (CN field in AD record)") } else if len(s) != 1 { e = fmt.Errorf("Full name field length is %d instead of 1", len(s)) } return }
[ 0.2840401828289032, -0.3073021471500397, 0.8100187182426453, -0.15437601506710052, -0.9338032007217407, 0.12319187074899673, 0.017046760767698288, 0.21725094318389893, 0.23155204951763153, 0.9088189005851746, 0.5104964375495911, -0.004955212585628033, -0.5277910828590393, 0.332989364862442...
func (l *Ldap) FullRecord(user, pass, usr string) (m map[string][]string, e error) { var n *ldap.Entry var filter string var atts []string filter, atts = fmt.Sprintf("(&(objectClass=user)(sAMAccountName=%s))", usr), []string{} n, e = l.SearchOne(user, pass, filter, atts) if e == nil { m = make(map[strin...
[ 0.02381369099020958, 0.034175608307123184, 0.6270138025283813, -0.2515903413295746, -1.2684093713760376, -0.3433532118797302, -0.10943235456943512, 0.433616042137146, 0.32605746388435364, 0.4205426573753357, -0.01748480834066868, 0.26037758588790894, 0.11605919897556305, 0.7383816242218018...
func (l *Ldap) SearchOne(user, pass, f string, ats []string) (n *ldap.Entry, e error) { var ns []*ldap.Entry ns, e = l.SearchFilter(user, pass, f, ats) if e == nil { if len(ns) == 1 { n = ns[0] } else { e = fmt.Errorf("Result length = %d", len(ns)) } } return }
[ -1.207615852355957, 0.964443564414978, 0.6423527002334595, 0.31503450870513916, 0.16044162213802338, -0.592831552028656, -0.3633369207382202, -0.6017901301383972, -0.3730805516242981, -0.2753453254699707, -0.21953900158405304, 0.22590035200119019, -0.42951732873916626, 0.22398507595062256,...
func (l *Ldap) SearchFilter(user, pass, f string, ats []string) (n []*ldap.Entry, e error) { var ( scope = ldap.ScopeWholeSubtree deref = ldap.NeverDerefAliases sizel = 0 timel = 0 tpeol = false //TypesOnly conts []ldap.Control //[]Control ) s := ldap.NewSearchRequest(l.BaseDN, scope, deref, si...
[ -1.0072417259216309, 0.19056914746761322, 0.7070630788803101, -0.2745233476161957, -0.11500158905982971, -0.8527632355690002, -0.6361567378044128, -0.560123085975647, -0.43774935603141785, -0.15038582682609558, 0.08377936482429504, 0.6067001223564148, -0.08177930116653442, 0.65935456752777...
func describeURL(URL string) { // http get resp, err := http.Get(URL) if err != nil { tools.ErrorLogger.Fatalln(err) } dom, err1 := goquery.NewDocumentFromReader(resp.Body) defer resp.Body.Close() if err1 != nil { tools.ErrorLogger.Fatalln(err) } // <script type="application/ld\+json">\n(.*\n)+?</script> ...
[ 0.0004906107787974179, 0.2552029490470886, 0.8254905939102173, -0.31138911843299866, 0.5610653758049011, 0.394687294960022, -0.00808066874742508, -0.1337321698665619, -0.31987085938453674, 0.5342388153076172, -0.049525078386068344, 1.0909913778305054, 0.1787583827972412, 0.8571151494979858...
func TestDbLog(t *testing.T) { l := &mockLogger{} opt := Options{Logger: l} opt.Errorf("test") require.Equal(t, "ERROR: test", l.output) opt.Infof("test") require.Equal(t, "INFO: test", l.output) opt.Warningf("test") require.Equal(t, "WARNING: test", l.output) }
[ 0.056514985859394073, 0.8094055652618408, 0.6024572849273682, -0.19820693135261536, 0.48588278889656067, 0.1703817993402481, 0.16081520915031433, -0.3255024254322052, -0.2925613820552826, -0.5281574726104736, -1.128869891166687, -0.5377292037010193, -0.06982146203517914, 0.7661147117614746...
func TestNoDbLog(t *testing.T) { l := &mockLogger{} opt := Options{} opt.Logger = l opt.Errorf("test") require.Equal(t, "ERROR: test", l.output) opt.Infof("test") require.Equal(t, "INFO: test", l.output) opt.Warningf("test") require.Equal(t, "WARNING: test", l.output) }
[ -0.16536901891231537, 0.9726392030715942, 0.4993303418159485, -0.3635460138320923, 0.49201008677482605, 0.19927704334259033, 0.2035709172487259, -0.6606863141059875, -0.3565906882286072, -0.6259832978248596, -1.1715946197509766, -0.15220336616039276, -0.39085760712623596, 1.152074098587036...
func PidfdSendSignal(pidfd uintptr, signum unix.Signal) error { // the runtime OS thread must be locked to safely enter namespaces. runtime.LockOSThread() defer runtime.UnlockOSThread() // setns with pidfd requires at least kernel version 5.8.0 err := unix.Setns(int(pidfd), unix.CLONE_NEWPID) if err != nil { re...
[ -0.8161123394966125, -0.05847793072462082, 0.5001802444458008, 0.07110153138637543, -0.4715035855770111, -0.1249859407544136, -0.2654040455818176, -0.5880721211433411, 0.3238491714000702, 0.26219096779823303, -0.5124655961990356, 0.3154750466346741, -0.5216929316520691, 0.45350897312164307...
func handleCommand(ctx context.Context, client *mongo.Client) { coDetailsCmd := flag.NewFlagSet("companydetails", flag.ExitOnError) coCIK := coDetailsCmd.String("cik", "", "cik") coDetailsCmd.Usage = func() { fmt.Println("cik flag not provided") fmt.Println("Usage: -cik string") } if len(os.Args) < 2 { // A...
[ 0.783413827419281, 0.24778516590595245, 0.9864288568496704, 0.6302412152290344, 0.8905143737792969, 0.01930616796016693, 0.6830523610115051, 0.4879404902458191, -0.09508863836526871, -0.2197670191526413, 0.1499597728252411, -0.40813133120536804, -0.5056228041648865, 1.0950801372528076, 0...
func GetOrEnsureBucket(tx *bolt.Tx, key []byte) *bolt.Bucket { if tx.Writable() { b, _ := tx.CreateBucketIfNotExists(key) return b } return tx.Bucket(key) }
[ 0.2677724063396454, 0.9731102585792542, 0.5869070291519165, -0.049891188740730286, 0.5809900164604187, -0.21882762014865875, 0.19825144112110138, -0.1708393096923828, -0.030512947589159012, -0.38528934121131897, 1.1465593576431274, 0.6373159885406494, -0.29876989126205444, -0.0097242584452...
func (u UserUpload) TableName() string { return "user_uploads" }
[ 0.5145963430404663, -0.050302013754844666, 0.4506515562534332, 1.1866867542266846, -0.41661927103996277, 0.11204265803098679, 0.7091430425643921, 0.3053770065307617, -0.3223792016506195, 0.31707563996315, -0.4647221565246582, -0.10110999643802643, 0.8976880311965942, -0.037349652498960495,...
func UploadsFromUserUploads(db *pop.Connection, userUploads UserUploads) (Uploads, error) { var uploads Uploads for _, userUpload := range userUploads { var upload Upload err := db.Q().Where("uploads.deleted_at is null").Find(&upload, userUpload.UploadID) if err != nil { if errors.Cause(err).Error() == Recor...
[ 0.8013045191764832, 0.004183406010270119, 0.49160367250442505, 0.5254121422767639, -0.01658163219690323, -0.40396302938461304, -0.30076584219932556, -1.1311436891555786, -0.09880024194717407, 0.5974060297012329, 0.020017115399241447, -0.733450174331665, 0.03618149086833, 0.4447129666805267...
func UploadsFromUserUploadsNoDatabase(userUploads UserUploads) (Uploads, error) { var uploads Uploads for _, userUpload := range userUploads { if userUpload.UploadID != uuid.Nil { uploads = append(uploads, userUpload.Upload) } else { return Uploads{}, errors.New("error invalid UploadID in UserUpload") } ...
[ -0.28112614154815674, 0.19492340087890625, 0.412530779838562, 0.6969264149665833, -0.20749104022979736, -0.4302404522895813, -0.1450960636138916, -0.45933935046195984, -0.07746639102697372, 0.773580014705658, -0.5343957543373108, -0.8969044089317322, -0.5386926531791687, 0.9598642587661743...
func (u *UserUpload) Validate(_ *pop.Connection) (*validate.Errors, error) { return validate.Validate( &validators.UUIDIsPresent{Field: u.UploaderID, Name: "UploaderID"}, ), nil }
[ -0.1737075299024582, 0.13716235756874084, 0.4689226746559143, 0.15256693959236145, 0.14622433483600616, -0.014936556108295918, -0.32081273198127747, 0.02906017377972603, -0.4226420819759369, 0.5881419777870178, 0.0536198690533638, -0.6116213202476501, -1.2002818584442139, 0.652959644794464...
func FetchUserUpload(db *pop.Connection, session *auth.Session, id uuid.UUID) (UserUpload, error) { var userUpload UserUpload err := db.Q(). Where("deleted_at is null").Eager("Document", "Upload").Find(&userUpload, id) if err != nil { if errors.Cause(err).Error() == RecordNotFoundErrorString { return UserUplo...
[ 0.5861308574676514, -0.16195903718471527, 0.5399872064590454, 0.6647902131080627, -0.9924261569976807, -0.697346568107605, 0.20512013137340546, -1.3592859506607056, 0.7486067414283752, -0.07831113785505295, 0.39347290992736816, -0.051333531737327576, -0.014853281900286674, 0.59784775972366...
func FetchUserUploadFromUploadID(db *pop.Connection, session *auth.Session, uploadID uuid.UUID) (UserUpload, error) { var userUpload UserUpload err := db.Q(). Join("uploads AS ups", "ups.id = user_uploads.upload_id"). Where("ups.ID = $1 and user_uploads.deleted_at is null", uploadID).Eager("Document", "Upload").F...
[ 0.7775123715400696, -0.42209765315055847, 0.4959365725517273, 0.710726797580719, -0.8479531407356262, -0.5228023529052734, 0.22203610837459564, -1.6377958059310913, 0.8605126142501831, 0.04809202253818512, 0.7220786213874817, -0.1757003366947174, -0.29293492436408997, 0.6344140768051147, ...
func DeleteUserUpload(dbConn *pop.Connection, userUpload *UserUpload) error { if dbConn.TX != nil { err := utilities.SoftDestroy(dbConn, userUpload) if err != nil { return err } } else { return dbConn.Transaction(func(db *pop.Connection) error { err := utilities.SoftDestroy(db, userUpload) if err != ...
[ -0.028959423303604126, 0.63129723072052, 0.6664294004440308, 0.9577192068099976, -0.8726296424865723, -0.6845788955688477, 0.1467650979757309, 0.3596406579017639, 0.42472028732299805, 0.1516246199607849, -0.18162855505943298, -1.0926003456115723, -0.7880986332893372, 0.28805699944496155, ...
func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate { cu.predicates = append(cu.predicates, ps...) return cu }
[ 0.1950291097164154, -0.9062969088554382, 0.38576874136924744, -0.03310723602771759, -0.22143277525901794, 0.5367502570152283, 0.009595749899744987, 0.07555069774389267, -0.8515505790710449, -0.3257833421230316, 0.45273393392562866, 0.6273836493492126, -0.42946600914001465, -0.8085367083549...
func (cu *CommentUpdate) SetUniqueInt(i int) *CommentUpdate { cu.unique_int = &i cu.addunique_int = nil return cu }
[ 0.49341604113578796, -0.1813405454158783, 0.07124637067317963, -0.9902145862579346, -0.08907905966043472, 0.320822149515152, 0.6465985178947449, 0.16925163567066193, -0.38326242566108704, -0.3021709620952606, -0.950461745262146, -0.49317511916160583, -0.5646587014198303, -0.196501269936561...
func (cu *CommentUpdate) AddUniqueInt(i int) *CommentUpdate { if cu.addunique_int == nil { cu.addunique_int = &i } else { *cu.addunique_int += i } return cu }
[ -0.3281838595867157, 0.12050873041152954, 0.4811907112598419, -0.9833817481994629, -0.13285613059997559, 0.5289341807365417, 0.15183591842651367, -0.07882940769195557, 0.3447149693965912, -0.35381004214286804, -0.4680289328098297, -0.5418088436126709, -0.8966986536979675, -0.20269671082496...
func (cu *CommentUpdate) SetUniqueFloat(f float64) *CommentUpdate { cu.unique_float = &f cu.addunique_float = nil return cu }
[ 0.45929357409477234, 0.4424850642681122, 0.40415552258491516, 0.4016488194465637, 0.2193002700805664, -0.4891015589237213, 0.8799912333488464, 0.9691107869148254, -0.2636546492576599, -1.1241629123687744, -1.2303276062011719, 0.1919904500246048, -0.6647545099258423, 0.7471747398376465, -...
func (cu *CommentUpdate) AddUniqueFloat(f float64) *CommentUpdate { if cu.addunique_float == nil { cu.addunique_float = &f } else { *cu.addunique_float += f } return cu }
[ 0.01564737781882286, 0.4798269271850586, 0.5631105899810791, 0.4484541714191437, 0.3531368672847748, -0.0761491060256958, 0.34972646832466125, 0.6198938488960266, 0.08216592669487, -1.1407736539840698, -0.9425220489501953, 0.2090889811515808, -0.6830646991729736, 0.479045033454895, -1.11...
func (cu *CommentUpdate) SetNillableInt(i int) *CommentUpdate { cu.nillable_int = &i cu.addnillable_int = nil return cu }
[ 0.8365699052810669, 0.05404170975089073, -0.14987032115459442, -0.6252333521842957, -0.7427440285682678, 1.0258333683013916, 0.33001765608787537, 0.08127942681312561, -0.848080039024353, 0.1461525559425354, -0.48842504620552063, -0.9639293551445007, -0.6889222860336304, 0.2103847861289978,...
func (cu *CommentUpdate) SetNillableNillableInt(i *int) *CommentUpdate { if i != nil { cu.SetNillableInt(*i) } return cu }
[ 0.24698233604431152, 0.08188614249229431, -0.07633104175329208, -0.3836207389831543, -0.739648163318634, 0.8066239356994629, 0.01818520575761795, -0.27419525384902954, -0.42571499943733215, 0.5269022583961487, -0.3931548297405243, -1.7053433656692505, -1.1234852075576782, 0.367123961448669...
func (cu *CommentUpdate) AddNillableInt(i int) *CommentUpdate { if cu.addnillable_int == nil { cu.addnillable_int = &i } else { *cu.addnillable_int += i } return cu }
[ 0.14365825057029724, 0.46800193190574646, 0.30474135279655457, -0.481123149394989, -1.077980399131775, 0.9165367484092712, -0.26533105969429016, -0.4583898186683655, -0.1101040169596672, -0.035603687167167664, -0.47160059213638306, -1.0524476766586304, -1.029335856437683, -0.03717975318431...
func (cu *CommentUpdate) ClearNillableInt() *CommentUpdate { cu.nillable_int = nil cu.clearnillable_int = true return cu }
[ 0.8750579357147217, -0.03424825519323349, 0.00003757802187465131, -0.16813984513282776, -1.0510774850845337, 0.6947397589683533, -0.3065560460090637, -0.6962361931800842, -0.6266685128211975, 0.6796319484710693, 0.1494305431842804, -0.36655187606811523, -0.5884265303611755, 0.1570507884025...
func (cu *CommentUpdate) Save(ctx context.Context) (int, error) { switch cu.driver.Dialect() { case dialect.MySQL, dialect.Postgres, dialect.SQLite: return cu.sqlSave(ctx) case dialect.Gremlin: return cu.gremlinSave(ctx) default: return 0, errors.New("ent: unsupported dialect") } }
[ -0.7881433963775635, -0.2523422837257385, 0.6713052988052368, 0.009380136616528034, 0.6467036604881287, -0.7075169682502747, 0.2531425654888153, 0.0564785860478878, -0.241554856300354, 0.9537237882614136, -0.2791103720664978, -0.6570999622344971, -1.2295808792114258, -0.03781603276729584, ...
func (cu *CommentUpdate) SaveX(ctx context.Context) int { affected, err := cu.Save(ctx) if err != nil { panic(err) } return affected }
[ -0.5974472165107727, 0.7506714463233948, 0.763742983341217, 0.44329509139060974, -0.26738181710243225, 0.54488205909729, -0.21987827122211456, 0.5917682647705078, 0.5602017641067505, 0.36802077293395996, -1.0414596796035767, -0.4044698178768158, -1.0346583127975464, -0.4617740511894226, ...
func (cu *CommentUpdate) Exec(ctx context.Context) error { _, err := cu.Save(ctx) return err }
[ 0.12618546187877655, -0.3325101137161255, 0.7553710341453552, 0.3625630736351013, 0.632939338684082, 1.0195215940475464, -0.20262353122234344, 0.025599084794521332, -0.39972126483917236, 0.6198424696922302, -0.20415900647640228, -0.3178207576274872, -0.6079115867614746, -0.820913553237915,...
func (cu *CommentUpdate) ExecX(ctx context.Context) { if err := cu.Exec(ctx); err != nil { panic(err) } }
[ 0.6872501373291016, 0.2388492077589035, 0.7746620178222656, 0.3522661626338959, 0.3271830081939697, 1.1383790969848633, -0.6007529497146606, 0.17124733328819275, 0.17613813281059265, 0.15672168135643005, 0.20331797003746033, 0.473663866519928, -0.1956651210784912, -0.4905272424221039, 0....
func (cuo *CommentUpdateOne) SetUniqueInt(i int) *CommentUpdateOne { cuo.unique_int = &i cuo.addunique_int = nil return cuo }
[ 0.4390028119087219, -0.09674545377492905, 0.05958263948559761, -0.9285736083984375, 0.061644650995731354, 0.2756417393684387, 0.7001132369041443, 0.3551769554615021, -0.26186057925224304, -0.2943534851074219, -1.021173357963562, -0.5722236633300781, -0.4939104914665222, -0.1153556555509567...
func (cuo *CommentUpdateOne) AddUniqueInt(i int) *CommentUpdateOne { if cuo.addunique_int == nil { cuo.addunique_int = &i } else { *cuo.addunique_int += i } return cuo }
[ -0.16801102459430695, 0.2430059164762497, 0.5054636597633362, -0.9590638279914856, -0.09264159947633743, 0.6404932141304016, 0.32337674498558044, 0.07349111884832382, 0.306661456823349, -0.38895291090011597, -0.6782969832420349, -0.6229709386825562, -0.7529338598251343, -0.1999747753143310...
func (cuo *CommentUpdateOne) SetUniqueFloat(f float64) *CommentUpdateOne { cuo.unique_float = &f cuo.addunique_float = nil return cuo }
[ 0.5569463968276978, 0.5125138759613037, 0.4229801297187805, 0.43377068638801575, 0.28047069907188416, -0.5295460224151611, 0.9028438925743103, 1.204540491104126, -0.21042092144489288, -1.1413516998291016, -1.2811788320541382, 0.18012234568595886, -0.5616211295127869, 0.7504280209541321, ...
func (cuo *CommentUpdateOne) AddUniqueFloat(f float64) *CommentUpdateOne { if cuo.addunique_float == nil { cuo.addunique_float = &f } else { *cuo.addunique_float += f } return cuo }
[ 0.19172509014606476, 0.6118097305297852, 0.5709148645401001, 0.5079853534698486, 0.3650916516780853, -0.07743886858224869, 0.49915018677711487, 0.75397789478302, 0.06773088127374649, -1.1753437519073486, -1.0593880414962769, 0.19568829238414764, -0.6021972298622131, 0.5141367316246033, -...
func (cuo *CommentUpdateOne) SetNillableInt(i int) *CommentUpdateOne { cuo.nillable_int = &i cuo.addnillable_int = nil return cuo }
[ 0.8490481972694397, 0.1492757499217987, -0.09706272184848785, -0.6121624112129211, -0.639751672744751, 1.0677261352539062, 0.4178173243999481, 0.16025109589099884, -0.8652917742729187, 0.18250451982021332, -0.5501336455345154, -0.9026787281036377, -0.6869353652000427, 0.2256777137517929, ...
func (cuo *CommentUpdateOne) SetNillableNillableInt(i *int) *CommentUpdateOne { if i != nil { cuo.SetNillableInt(*i) } return cuo }
[ 0.36084797978401184, 0.2461932897567749, -0.09324631094932556, -0.24019452929496765, -0.7126594185829163, 0.8416927456855774, 0.0575728565454483, -0.1701805740594864, -0.45284971594810486, 0.5309494137763977, -0.5159357786178589, -1.6844909191131592, -0.9738020300865173, 0.2830286324024200...
func (cuo *CommentUpdateOne) AddNillableInt(i int) *CommentUpdateOne { if cuo.addnillable_int == nil { cuo.addnillable_int = &i } else { *cuo.addnillable_int += i } return cuo }
[ 0.3487449884414673, 0.5796905755996704, 0.3685944378376007, -0.3817630410194397, -1.0798193216323853, 0.9651860594749451, -0.13350576162338257, -0.38075491786003113, -0.1450284719467163, 0.0017642331076785922, -0.5395963788032532, -1.0503853559494019, -0.8927156925201416, -0.07694833725690...
func (cuo *CommentUpdateOne) ClearNillableInt() *CommentUpdateOne { cuo.nillable_int = nil cuo.clearnillable_int = true return cuo }
[ 0.9049328565597534, 0.09259241819381714, -0.011375968344509602, -0.08559612184762955, -1.0514342784881592, 0.6998164057731628, -0.2928468883037567, -0.6510503888130188, -0.5646082758903503, 0.7448464035987854, 0.20476989448070526, -0.4501155614852905, -0.6490666270256042, 0.105144098401069...
func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error) { switch cuo.driver.Dialect() { case dialect.MySQL, dialect.Postgres, dialect.SQLite: return cuo.sqlSave(ctx) case dialect.Gremlin: return cuo.gremlinSave(ctx) default: return nil, errors.New("ent: unsupported dialect") } }
[ -0.5018681287765503, -0.5108675360679626, 0.5332592129707336, 0.20307815074920654, 1.119544506072998, -0.5418961048126221, 0.20076969265937805, -0.1544894427061081, 0.05525330826640129, 0.8806350231170654, -0.3786955177783966, -0.7136519551277161, -1.0798701047897339, 0.09575778245925903, ...
func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment { c, err := cuo.Save(ctx) if err != nil { panic(err) } return c }
[ -0.07992537319660187, 0.10001114010810852, 0.550315797328949, 0.6485947370529175, -0.05323770269751549, 0.851150631904602, -0.4620627462863922, 0.05864434316754341, 0.8104903101921082, 0.3385845422744751, -1.0547549724578857, -0.3710123598575592, -0.9752936959266663, -0.35956692695617676, ...
func (cuo *CommentUpdateOne) Exec(ctx context.Context) error { _, err := cuo.Save(ctx) return err }
[ 0.10898303240537643, -0.11065959930419922, 0.7722072601318359, 0.5073174834251404, 0.8483573794364929, 0.835378110408783, 0.17719314992427826, -0.032935354858636856, -0.22951345145702362, 0.5741324424743652, -0.43845024704933167, -0.4819502830505371, -0.8425073027610779, -0.543136119842529...
func (cuo *CommentUpdateOne) ExecX(ctx context.Context) { if err := cuo.Exec(ctx); err != nil { panic(err) } }
[ 0.7041869163513184, 0.3882344961166382, 0.8323416709899902, 0.5264521837234497, 0.40766024589538574, 0.9928622245788574, -0.35802409052848816, 0.09758991003036499, 0.18162506818771362, 0.1453593671321869, -0.048011600971221924, 0.4172358810901642, -0.3223283290863037, -0.3288867175579071, ...
func (t *transformer) toComponentsOverview(layer *clair.Layer) harbor.Severity { vulnMap := make(map[harbor.Severity]int) var temp harbor.Severity for _, f := range layer.Features { sev := harbor.SevNone for _, v := range f.Vulnerabilities { temp = t.toHarborSeverity(v.Severity) if temp > sev { sev = t...
[ -0.738297164440155, -0.5445387959480286, 0.8593924641609192, -0.9011339545249939, 0.2634890377521515, -0.7131245732307434, 0.7163054347038269, 0.4204918146133423, -0.01694902963936329, -0.12345918267965317, -0.318208247423172, -0.2600085735321045, 0.2334473431110382, 0.2674919366836548, ...
func (t *transformer) toVulnerabilityItems(l *clair.Layer) []harbor.VulnerabilityItem { var res []harbor.VulnerabilityItem if l == nil { return res } features := l.Features if features == nil { return res } for _, f := range features { vulnerabilities := f.Vulnerabilities if vulnerabilities == nil { c...
[ -0.6143712997436523, -0.2938336133956909, 0.5861445069313049, 0.41050150990486145, 0.6306803822517395, -0.12389156967401505, -0.3448028266429901, 0.8046457767486572, -0.5085321664810181, 0.3929189443588257, -1.103269338607788, 0.14062848687171936, 0.17408427596092224, 0.6585932374000549, ...
func (t *transformer) toHarborSeverity(clairSev string) harbor.Severity { switch sev := strings.ToLower(clairSev); sev { case clair.SeverityNegligible: return harbor.SevNegligible case clair.SeverityLow: return harbor.SevLow case clair.SeverityMedium: return harbor.SevMedium case clair.SeverityHigh: return...
[ 0.5916256308555603, -0.5263510942459106, 0.630086362361908, -0.5168676376342773, 0.46048012375831604, 0.07188375294208527, -0.16836388409137726, -0.22814060747623444, 0.31404298543930054, -0.29633715748786926, -1.5369025468826294, 0.6501137018203735, 0.07906311005353928, -0.057284131646156...
func newWriteLogger(log *log.Logger, w io.Writer) io.Writer { return &writeLogger{log, w} }
[ -0.6456335783004761, -1.0904422998428345, 0.20224201679229736, -0.6931089162826538, -0.711307168006897, -1.1536641120910645, -0.7320442795753479, -0.41855815052986145, -0.04976712167263031, 0.0654309019446373, 0.023071173578500748, 0.22983703017234802, -0.1184631809592247, 0.99412781000137...
func newReadLogger(log *log.Logger, r io.Reader) io.Reader { return &readLogger{log, r} }
[ 0.3994249105453491, -0.8293656706809998, 0.4801192283630371, -0.8965953588485718, -1.775789499282837, 0.06005524843931198, -1.8764046430587769, -0.49663403630256653, 0.459215372800827, -0.3006478250026703, 0.2436956763267517, 0.29578450322151184, -0.01345991063863039, 0.2908714711666107, ...
func (c *Client) ListHealthChecks(ctx context.Context, params *ListHealthChecksInput, optFns ...func(*Options)) (*ListHealthChecksOutput, error) { if params == nil { params = &ListHealthChecksInput{} } result, metadata, err := c.invokeOperation(ctx, "ListHealthChecks", params, optFns, addOperationListHealthChecks...
[ -0.560731053352356, 0.20092931389808655, 0.8249942660331726, 0.9860159158706665, 1.03085458278656, -0.3205365836620331, -0.16846778988838196, -0.8348180055618286, 0.8671867251396179, -0.73793625831604, -0.20006629824638367, 0.8903218507766724, -0.165933758020401, 0.002246769145131111, -1...
func NewListHealthChecksPaginator(client ListHealthChecksAPIClient, params *ListHealthChecksInput, optFns ...func(*ListHealthChecksPaginatorOptions)) *ListHealthChecksPaginator { if params == nil { params = &ListHealthChecksInput{} } options := ListHealthChecksPaginatorOptions{} if params.MaxItems != nil { opt...
[ -0.7221170663833618, -0.833882212638855, 0.5608187317848206, 0.1788380742073059, -0.11277589201927185, -0.35591211915016174, -0.10691945999860764, 0.5970021486282349, 0.881816029548645, -0.9631056189537048, 0.10424450039863586, -0.42462587356567383, -0.06063179671764374, 0.9101864099502563...
func (p *ListHealthChecksPaginator) HasMorePages() bool { return p.firstPage || p.nextToken != nil }
[ 0.1313602775335312, -0.5975486636161804, 0.2726461887359619, -0.5502278208732605, 1.1572771072387695, -0.6218471527099609, -1.7277002334594727, -0.0015566006768494844, 0.5402691960334778, -0.8641085028648376, -0.31128641963005066, -0.8854475021362305, -0.20804612338542938, 1.40183722972869...
func (p *ListHealthChecksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHealthChecksOutput, error) { if !p.HasMorePages() { return nil, fmt.Errorf("no more pages available") } params := *p.params params.Marker = p.nextToken var limit *int32 if p.options.Limit > 0 { limit = &p.optio...
[ -0.3789098858833313, -0.14024019241333008, 0.771483838558197, 0.08783211559057236, 0.5954363942146301, -0.008029252290725708, 0.19914059340953827, -0.06880244612693787, 0.38459616899490356, -0.802768349647522, 1.0374155044555664, -0.08262284100055695, -0.6855828166007996, 0.225478097796440...
func Addrs(addrs ...string) Option { return func(o *Options) { o.Addrs = addrs } }
[ -0.2426544725894928, 0.7696085572242737, 0.4387872815132141, -0.07997342944145203, 0.3656906187534332, 0.3803118169307709, -0.5307848453521729, -0.48483341932296753, 1.1946911811828613, -0.4202597141265869, 0.3453720211982727, 0.2704011797904968, 0.1234302818775177, -0.2856426239013672, ...
func NewID(zone, node int) ID { if zone < 0 { zone = -zone } if node < 0 { node = -node } // return ID(fmt.Sprintf("%d.%d", zone, node)) return ID(strconv.Itoa(zone) + "." + strconv.Itoa(node)) }
[ 0.8237928152084351, -1.3969875574111938, 0.5031286478042603, -0.06339606642723083, -0.14111705124378204, 0.7492066025733948, 0.037645839154720306, 0.12234827131032944, 0.5692857503890991, 0.4984760582447052, 0.7735888361930847, 0.9425277709960938, -0.15804815292358398, -0.2016705423593521,...
func (i ID) Zone() int { if !strings.Contains(string(i), ".") { log.Warningf("id %s does not contain \".\"\n", i) return 0 } s := strings.Split(string(i), ".")[0] zone, err := strconv.ParseUint(s, 10, 64) if err != nil { log.Errorf("Failed to convert Zone %s to int\n", s) return 0 } return int(zone) }
[ -0.9586710929870605, -0.04351499304175377, 0.5216258764266968, -0.053417377173900604, 0.0034376520197838545, -1.2238471508026123, 0.8735095262527466, 0.10760074108839035, 0.6779008507728577, -0.052053019404411316, -0.4346330761909485, 0.31303074955940247, -0.8206145167350769, -0.3927085101...
func (i ID) Node() int { var s string if !strings.Contains(string(i), ".") { log.Warningf("id %s does not contain \".\"\n", i) s = string(i) } else { s = strings.Split(string(i), ".")[1] } node, err := strconv.ParseUint(s, 10, 64) if err != nil { log.Errorf("Failed to convert Node %s to int\n", s) retur...
[ -1.3257501125335693, 0.16700659692287445, 0.6143248677253723, -0.6631589531898499, -0.32097864151000977, -0.8608629107475281, -0.31068649888038635, 0.33742573857307434, 0.5754914283752441, 0.3010813593864441, 0.31922537088394165, 0.4779781401157379, -0.44340780377388, -0.3280581831932068, ...
func Build(signer Signer, claims encoding.BinaryMarshaler) (*Token, error) { return NewTokenBuilder(signer).Build(claims) }
[ -0.06272076815366745, -1.3014318943023682, -0.01943334750831127, 0.6219671368598938, -0.6132519245147705, -0.049581270664930344, -0.7979525327682495, 0.6700319051742554, -0.2709381580352783, -1.6961815357208252, -0.06349731981754303, 0.7254256010055542, 0.3596016466617584, -0.2828213870525...
func BuildWithHeader(signer Signer, header *Header, claims encoding.BinaryMarshaler) (*Token, error) { b := &TokenBuilder{ signer: signer, header: *header, } return b.Build(claims) }
[ 0.354744553565979, -1.0596239566802979, 0.2851870357990265, 0.7525600790977478, -1.090650200843811, -0.21613065898418427, -0.7358489036560059, 0.24563565850257874, 0.12224143743515015, -1.4527232646942139, -0.25744375586509705, 0.5369647145271301, 0.11232167482376099, -0.5466564297676086, ...
func NewTokenBuilder(signer Signer) *TokenBuilder { b := &TokenBuilder{ signer: signer, header: Header{ Type: "JWT", Algorithm: signer.Algorithm(), }, } return b }
[ 0.014174741692841053, -0.07794476300477982, 0.4105396866798401, 1.0993677377700806, -1.4833955764770508, 0.11598899215459824, -0.19951654970645905, 0.3053636848926544, 0.9005517959594727, -0.7893075346946716, -0.8401075005531311, -0.17248976230621338, -0.10817856341600418, 0.98551690578460...
func (b *TokenBuilder) Build(claims encoding.BinaryMarshaler) (*Token, error) { encodedHeader, err := b.encodeHeader() if err != nil { return nil, err } rawClaims, encodedClaims, err := b.encodeClaims(claims) if err != nil { return nil, err } payload := concatParts(encodedHeader, encodedClaims) signed, s...
[ 0.10156845301389694, -1.0112910270690918, 0.4049696922302246, 0.35938674211502075, -0.5708422660827637, -0.02082156203687191, -0.48662811517715454, 0.392747700214386, 0.1592104285955429, -1.237500786781311, -0.40309008955955505, 0.22740381956100464, -0.0751207023859024, -0.6202698945999146...
func (c *WorkloadEndpointClient) patchInAnnotations(ctx context.Context, kvp *model.KVPair, operation string) (*model.KVPair, error) { var annotations map[string]string var revision string patchMode := PatchModeOf(ctx) switch patchMode { case PatchModeCNI: annotations = c.calcCNIAnnotations(kvp) // Note: we dr...
[ -0.5398659110069275, 0.025859607383608818, 0.4606785774230957, 0.20192591845989227, -0.8920321464538574, 0.8581463098526001, 0.254278302192688, -0.16982512176036835, 0.4358218312263489, 0.3020477592945099, 0.3762138783931732, -0.1059187650680542, -1.1440566778182983, -0.42379283905029297, ...
func (c *WorkloadEndpointClient) patchOutAnnotations(ctx context.Context, key model.Key, revision string, uid *types.UID) (*model.KVPair, error) { // Passing nil for annotations will result in all annotations being explicitly set to the empty string. // Setting the podIPs to empty string is used to signal that the CN...
[ -0.5115044713020325, 0.21148760616779327, 0.4344475269317627, -0.11008448153734207, -1.1973820924758911, 0.07554417103528976, -0.014558413997292519, -0.04400109872221947, 0.3155502378940582, 0.6227521300315857, 0.21383407711982727, 0.26082679629325867, -1.0154616832733154, -0.2971626818180...
func (c *WorkloadEndpointClient) listUsingName(ctx context.Context, listOptions model.ResourceListOptions, revision string) (*model.KVPairList, error) { wepID, err := c.converter.ParseWorkloadEndpointName(listOptions.Name) if err != nil { return nil, err } if wepID.Pod == "" { return nil, cerrors.ErrorResource...
[ -0.7937744855880737, -0.803024172782898, 0.7190159559249878, -0.171578511595726, -0.5830872654914856, -0.4803099036216736, -1.085155963897705, 0.022964030504226685, 0.28914913535118103, 1.8469206094741821, 0.10644414275884628, -0.5299825668334961, -1.0831791162490845, 0.42692384123802185, ...
func (c *WorkloadEndpointClient) list(ctx context.Context, list model.ResourceListOptions, revision string) (*model.KVPairList, error) { logContext := log.WithField("Resource", "WorkloadEndpoint") logContext.Debug("Received List request") convertFunc := func(r Resource) ([]*model.KVPair, error) { pod := r.(*v1.Pod...
[ -0.8054117560386658, -0.5487354397773743, 0.6597055792808533, -0.15479591488838196, -0.16742630302906036, -0.25709840655326843, -0.6974509954452515, 0.018195107579231262, 0.16835612058639526, 0.725664496421814, 0.20508070290088654, -0.5406782627105713, -0.285845547914505, -0.00760574499145...
func URLOption(url string) Option { return func(opts *options) { opts.URL = url } }
[ 0.42205148935317993, 0.24115100502967834, 0.48756271600723267, -0.12354113906621933, 0.008675472810864449, 0.4207358956336975, 0.6459969282150269, 0.7349372506141663, 0.8021067976951599, 0.25003933906555176, -0.7683492302894592, -0.1562594771385193, -0.07998450845479965, -0.473632901906967...
func TokenOption(token string) Option { return func(opts *options) { opts.Token = token } }
[ 0.35031959414482117, 0.07150372117757797, 0.16987738013267517, -0.6539070010185242, 0.21364349126815796, -0.628131091594696, 0.10975828021764755, 0.0004187678568996489, 1.0012471675872803, 0.0595041885972023, -1.095023274421692, 0.9508135318756104, 0.6172409057617188, -0.5331220030784607, ...
func CachePathOption(path string) Option { return func(opts *options) { opts.CachePath = path } }
[ -0.19900304079055786, -0.189781054854393, 0.37701645493507385, 0.5981836318969727, -0.42739227414131165, 0.5520385503768921, 1.032952070236206, -0.24255867302417755, 0.8322688341140747, 0.3356438875198364, -0.7393087148666382, -0.37471163272857666, 0.18201720714569092, -0.3964776396751404,...
func CacheDurationOption(duration time.Duration) Option { return func(opts *options) { opts.CacheDuration = duration } }
[ -0.23358511924743652, 0.33743736147880554, 0.3571555018424988, 0.6114170551300049, -0.5664494037628174, 0.8443282246589661, 0.5992779731750488, -0.2916508913040161, 0.474229097366333, 0.3146214187145233, -0.08042746782302856, 0.22575420141220093, 0.6405306458473206, 0.11393949389457703, ...
func LoggerOption(logger *log.Logger) Option { return func(opts *options) { opts.Logger = logger } }
[ -0.5129878520965576, -0.3575209975242615, 0.35662439465522766, -0.5902960896492004, 0.08409464359283447, -0.7472930550575256, -0.23060360550880432, 0.188429594039917, 0.712559700012207, 0.4623543620109558, -0.7617453336715698, 0.3911740183830261, -0.14091651141643524, 0.850371778011322, ...
func NewService(fn ...Option) (Service, error) { opts := &options{ URL: DefaultURL, CacheDuration: DefaultCacheDuration, Logger: log.Default(), } for _, f := range fn { f(opts) } opts.Normalize() adapter := newServiceAdapter(opts.URL, opts.Token, opts.Logger) if opts.CachePath != "" { ...
[ -0.5431402325630188, 0.5140681266784668, 0.5545620918273926, 0.9407021999359131, -0.1314755529165268, -0.41649073362350464, -0.4947360157966614, -0.7429475784301758, 0.3196775019168854, -0.5124104022979736, 0.04696439206600189, 0.3082829415798187, 0.06793703883886337, 0.2192090004682541, ...
func (s *service) GetByCity(city string) (*Status, error) { return s.adapter.GetByCity(city) }
[ 0.1991247534751892, 0.2275691032409668, 0.33696746826171875, 0.14218857884407043, -1.1816612482070923, -0.6242042779922485, -0.30567169189453125, -0.14572598040103912, 0.3926289975643158, -0.027649076655507088, -1.0521507263183594, 0.5790265202522278, -0.17354071140289307, -0.1430210322141...
func (s *service) GetByStation(stationID int) (*Status, error) { return s.adapter.GetByStation(stationID) }
[ -0.2898549735546112, -0.05058008432388306, 0.11980954557657242, 0.11993341892957687, -0.6037625074386597, -0.6163794994354248, -0.353202760219574, -0.638529896736145, 0.5600845813751221, 0.03179221600294113, -0.7253710031509399, 0.6129363179206848, -0.3051758408546448, 0.03898339346051216,...
func (s *service) GetByGeo(lat, lon float32) (*Status, error) { return s.adapter.GetByGeo(lat, lon) }
[ 1.6256568431854248, 0.2538372874259949, 0.4654996693134308, 0.732635498046875, 0.0834185928106308, -0.07396301627159119, -0.7768127918243408, -0.07195919007062912, -1.148388385772705, 0.10290493816137314, -0.6245965957641602, 1.0634595155715942, 0.23945166170597076, -0.5063831806182861, ...
func (s *service) Subscribe(stationID int, listener Listener) { s.fetcher.Subscribe(stationID, listener) }
[ 0.3235710561275482, -0.06282511353492737, 0.20388665795326233, 0.18040792644023895, -0.4074753522872925, 0.9809532165527344, -1.8760409355163574, -0.9405437111854553, -0.5323925018310547, -0.572945237159729, -0.4618058502674103, 0.3125073313713074, 0.530375063419342, 0.49169033765792847, ...
func (s *service) Unsubscribe(stationID int, listener Listener) { s.fetcher.Unsubscribe(stationID, listener) }
[ 0.5787065625190735, 0.14216472208499908, 0.11339370906352997, -0.045533981174230576, -1.1367617845535278, 0.5592475533485413, -1.1849679946899414, -0.29227301478385925, -1.042482614517212, -0.22750161588191986, -0.11980821937322617, -0.05950527638196945, 0.5130823254585266, 0.2497191131114...
func (s *service) StartUpdates() { s.fetcher.StartUpdates() }
[ 0.5427356958389282, 0.18498165905475616, 0.09253398329019547, 0.7936309576034546, -0.6808921098709106, -0.25209367275238037, -0.517300009727478, 0.5451763272285461, 0.7707660794258118, -1.4631439447402954, 0.501376748085022, 1.0807836055755615, -0.18604056537151337, 1.1936718225479126, -...
func (s *service) StopUpdates() { s.fetcher.StopUpdates() }
[ -0.6281231641769409, -0.43420982360839844, 0.24993674457073212, -0.6742126941680908, -0.5915473103523254, 0.620909571647644, -0.05552098900079727, -0.2807687520980835, -0.004515067674219608, -0.6894318461418152, 0.21012374758720398, -0.1635231375694275, -0.8825196027755737, -0.316728591918...
func (s *service) Close() error { return s.adapter.Close() }
[ -0.33874085545539856, -0.31690624356269836, 0.2026698887348175, 0.09535852819681168, -1.3210406303405762, 0.22064994275569916, -0.2012971192598343, -1.1289050579071045, 0.4344247579574585, -0.8065744042396545, 0.4969327449798584, 1.0648804903030396, -0.9449798464775085, 0.5912001729011536,...
func updatePrometheusStatus(db *recordDb) { teams := make(map[string]bool) // Records are already sorted from newest to oldest, so we // only have to remember which team we already processed. for i := range db.records { record := db.records[i] if _, ok := teams[db.records[i].Team]; ok { continue } promLe...
[ -0.10499225556850433, -0.30299806594848633, 0.6237879395484924, -1.0587345361709595, -0.2496536374092102, 0.36840081214904785, -0.5055090188980103, 0.12612037360668182, -0.3007164001464844, 0.42878252267837524, -0.10213395208120346, 0.647485613822937, 0.32797738909721375, 0.693175315856933...
func (o *DeleteUserReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewDeleteUserOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 401...
[ -0.19264541566371918, -1.0030510425567627, 0.7476876974105835, 0.6540806293487549, -0.4141732156276703, -1.254663348197937, 0.09658759832382202, -0.19144207239151, 0.6891632080078125, 0.2646539509296417, 0.5533291697502136, -0.3032502830028534, -1.0900986194610596, -0.23611018061637878, ...
func NewDeleteUserOK() *DeleteUserOK { return &DeleteUserOK{} }
[ -0.16363126039505005, -0.9703390002250671, -0.15328697860240936, 1.5422405004501343, -1.4737366437911987, -0.577555775642395, 0.9049551486968994, 0.6815577745437622, 0.09740324318408966, 0.24940869212150574, -0.817947268486023, -0.5206836462020874, 0.1583484560251236, 0.0712268203496933, ...