text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (l *Logger) Info(msg string, fields ...Field) {
l.log(2, InfoLevel, msg, nil, fields)
} | [
0.34299004077911377,
0.29786965250968933,
0.3701484203338623,
0.27725252509117126,
0.3532922863960266,
0.41884562373161316,
-0.14212346076965332,
-0.20678864419460297,
-1.6321547031402588,
-0.21344387531280518,
-1.1049400568008423,
0.2408817857503891,
0.5690163969993591,
0.8310120701789856... |
func (l *Logger) Infof(template string, args ...interface{}) {
l.log(2, InfoLevel, template, args, nil)
} | [
0.5409242510795593,
-0.34680402278900146,
0.421395868062973,
0.133290097117424,
0.45880118012428284,
0.0430014468729496,
0.040499743074178696,
0.6165980696678162,
-1.3533059358596802,
-0.6179725527763367,
-0.7209349870681763,
0.1250305324792862,
0.4000171720981598,
0.9260221719741821,
-0... |
func (l *Logger) Warn(msg string, fields ...Field) {
l.log(2, WarnLevel, msg, nil, fields)
} | [
-0.02831912972033024,
0.9262219667434692,
0.36715611815452576,
-0.047470301389694214,
0.015489483252167702,
0.11297910660505295,
-0.5136648416519165,
-0.18944846093654633,
-1.2684077024459839,
-0.768956184387207,
-1.0483170747756958,
0.839742124080658,
0.7712141871452332,
0.058708190917968... |
func (l *Logger) Warnf(template string, args ...interface{}) {
l.log(2, WarnLevel, template, args, nil)
} | [
0.49882417917251587,
0.21785369515419006,
0.33311471343040466,
0.006795677822083235,
-0.004759328439831734,
-0.31043151021003723,
0.203131303191185,
0.4375661015510559,
-1.3790650367736816,
-0.23257490992546082,
-0.5484232306480408,
0.5541473031044006,
0.4079047739505768,
0.687816023826599... |
func (l *Logger) Panic(msg string, fields ...Field) {
l.log(2, PanicLevel, msg, nil, fields)
} | [
0.08233701437711716,
0.722991406917572,
0.30438271164894104,
0.41538724303245544,
-0.021472247317433357,
0.599375307559967,
-0.1358211487531662,
0.09453972429037094,
-0.9787290692329407,
-0.3040483593940735,
-1.0589609146118164,
-0.07360121607780457,
0.15654119849205017,
0.2225555926561355... |
func (l *Logger) Panicf(template string, args ...interface{}) {
l.log(2, PanicLevel, template, args, nil)
} | [
0.4658200740814209,
-0.018282419070601463,
0.2731149196624756,
0.19948384165763855,
-0.030653154477477074,
-0.0676194429397583,
0.31236085295677185,
0.6182167530059814,
-1.2548257112503052,
-0.45561763644218445,
-0.9770734906196594,
-0.386824369430542,
0.15759414434432983,
0.94310176372528... |
func (l *Logger) Fatal(msg string, fields ...Field) {
l.log(2, FatalLevel, msg, nil, fields)
} | [
0.3488311469554901,
0.3029755651950836,
0.3245878219604492,
0.7304612994194031,
0.3852216303348541,
0.8290455937385559,
-0.6533060073852539,
0.2381054162979126,
-0.815129280090332,
-0.8447275161743164,
-0.681416928768158,
0.18518705666065216,
0.3476165235042572,
0.35149943828582764,
-0.2... |
func (l *Logger) Fatalf(template string, args ...interface{}) {
l.log(2, FatalLevel, template, args, nil)
} | [
0.8574351668357849,
-0.170477956533432,
0.3019579350948334,
0.5058003664016724,
0.12842054665088654,
0.14409033954143524,
-0.07477030903100967,
0.7603399753570557,
-0.5121020674705505,
-0.7082012295722961,
-0.5801767706871033,
-0.2799246311187744,
0.3041706383228302,
0.9782678484916687,
... |
func (l *Logger) Sync() error {
return l.core.Sync()
} | [
-0.05211642384529114,
-0.4355694353580475,
0.2377120405435562,
-0.009937059134244919,
-0.7380889654159546,
-0.18348878622055054,
-0.49131011962890625,
-1.4918287992477417,
-0.24228045344352722,
0.6214583516120911,
-0.12617015838623047,
1.3243900537490845,
0.1655590534210205,
0.999384224414... |
func (l *Logger) Core() Core {
return l.core
} | [
0.28189125657081604,
-1.1626808643341064,
0.239535391330719,
-0.7084264159202576,
-0.47726690769195557,
0.10135852545499802,
-0.41373974084854126,
-0.03486247733235359,
0.5245549082756042,
-0.2314848154783249,
0.4989137649536133,
0.5858184099197388,
-1.0463300943374634,
0.7565721869468689,... |
func (l *Logger) log(calloffset int, lvl Level, template string, fmtArgs []interface{}, fields []Field) {
if !l.core.Enabled(lvl) {
switch lvl {
case PanicLevel:
panic(messagef(template, fmtArgs...))
case FatalLevel:
os.Exit(1)
}
return
}
e := Entry{
Level: lvl,
Time: time.Now(),
Me... | [
-0.4484648108482361,
0.2739526331424713,
0.6660827398300171,
-0.26032358407974243,
-0.6565152406692505,
0.5134881734848022,
0.06968318670988083,
0.5741052031517029,
-0.3025129437446594,
-0.4319659471511841,
-0.9349146485328674,
-0.38547247648239136,
-0.27435410022735596,
0.9316583871841431... |
func specs(i interface{}) {
fmt.Println(i)
} | [
-0.6230558753013611,
0.22761140763759613,
0.42278632521629333,
-0.07051322609186172,
-0.5782932639122009,
0.07697312533855438,
0.3961968421936035,
-0.6744027137756348,
0.29538634419441223,
-0.2168741077184677,
-0.08019240200519562,
0.3843662440776825,
0.034815073013305664,
-0.4366867244243... |
func RunTodoListService(addr string) {
todolistService := NewTodoListService(addr)
todolistService.Run()
} | [
-0.9299495220184326,
0.0680125281214714,
0.2880224883556366,
-0.24195843935012817,
0.05897929146885872,
0.3026367127895355,
0.019864670932292938,
0.1503896862268448,
1.1065422296524048,
0.013419841416180134,
-0.7593779563903809,
1.3155534267425537,
0.34004324674606323,
0.9148058891296387,
... |
func NewTodoListService(addr string) *Service {
s := &Service{
h: http.DefaultServeMux,
}
// 使用默认设置初始化httpServer
s.httpServer = &http.Server{
Addr: addr,
Handler: s.h,
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
MaxHeaderBytes: http.DefaultMaxHeaderBytes,
}
// ... | [
-0.28780433535575867,
0.06012159585952759,
0.5988807678222656,
-0.5205819010734558,
-0.23739062249660492,
-0.5113088488578796,
-0.05530110001564026,
-0.6610782742500305,
0.7904770970344543,
-0.35541054606437683,
-1.1299798488616943,
1.2516931295394897,
-0.6992723345756531,
0.77140855789184... |
func (s *Service) Run() {
log.Printf("[Info] todolist service listen on %s...\n", s.httpServer.Addr)
log.Fatal("[Fatal]", s.httpServer.ListenAndServe())
} | [
-0.5429616570472717,
-0.9618030190467834,
0.36423543095588684,
-0.1788947582244873,
0.44859471917152405,
0.6044672727584839,
0.02091645821928978,
0.6697790622711182,
-0.3339199125766754,
-0.3470863997936249,
-0.5519495606422424,
1.0135564804077148,
0.16412928700447083,
0.5086296200752258,
... |
func (s *Service) Handle(path string, handle http.HandlerFunc) {
s.h.HandleFunc(path, func(w http.ResponseWriter, r *http.Request) {
status := "success"
// 请求结束,打印日志
defer func(start time.Time) {
// 打印请求日志
// 格式样例:
// 2019/09/16 15:53:04 [Access] success 127.0.0.1 /todo/add 0.233
log.Printf(
"[A... | [
-0.11533839255571365,
-0.08034560084342957,
1.156135082244873,
0.4000808596611023,
-0.10958149284124374,
0.929314911365509,
0.9640076756477356,
-0.11460799723863602,
-0.4372170567512512,
-0.4442192614078522,
-0.09296669811010361,
0.07653031498193741,
-0.3117105960845947,
-0.586180865764617... |
func (w *Writer) writeLength() (err error) {
_, err = w.file.Seek(0, io.SeekStart)
if err != nil {
err = liberr.Wrap(err)
return
}
b := make([]byte, 8)
binary.LittleEndian.PutUint64(b, w.length)
_, err = w.file.Write(b)
if err != nil {
err = liberr.Wrap(err)
return
}
_, err = w.file.Seek(0, io.SeekEnd)... | [
-0.21840618550777435,
-0.389396607875824,
0.5977672338485718,
-0.8520709872245789,
1.451413869857788,
1.0352846384048462,
0.9928933382034302,
0.4381050765514374,
-0.08151338249444962,
-0.049881380051374435,
-0.4556105434894562,
-0.14898325502872467,
-0.03619531914591789,
0.90077805519104,
... |
func (r *Reader) Len() (length int) {
// Lazy open.
err := r.open()
if err != nil {
return
}
n, _ := r.len()
length = int(n)
return
} | [
0.19600556790828705,
-0.21502265334129333,
0.28075599670410156,
-1.2911790609359741,
0.3528200685977936,
-0.8130612373352051,
1.32351815700531,
0.8845115900039673,
-0.15832556784152985,
-0.7659008502960205,
-0.6431904435157776,
-0.08556418865919113,
0.5570213794708252,
-0.18935857713222504... |
func (r *Reader) NextWith(object interface{}) (hasNext bool, err error) {
if r.error != nil {
return
}
defer func() {
r.error = err
}()
// Lazy open.
err = r.open()
if err != nil {
return
}
// Read entry.
hasNext, _, b, err := r.readEntry()
if !hasNext || err != nil {
return
}
// Decode object.
bf... | [
0.22666384279727936,
-0.625329315662384,
0.8871058225631714,
0.02594771236181259,
-0.9632975459098816,
-0.3189293444156647,
-0.19870759546756744,
-0.7250000834465027,
0.16844457387924194,
0.4527507424354553,
-0.0727577656507492,
-0.05287255346775055,
0.42853859066963196,
0.3670125007629394... |
func (r *Reader) Next() (object interface{}, hasNext bool, err error) {
if r.error != nil {
return
}
defer func() {
r.error = err
}()
// Lazy open.
err = r.open()
if err != nil {
return
}
// Read entry.
hasNext, kind, b, err := r.readEntry()
if !hasNext || err != nil {
return
}
// Decode object.
b... | [
-0.05042768642306328,
-0.3272181451320648,
0.5306174755096436,
0.19961662590503693,
-0.07703058421611786,
-0.025457853451371193,
-0.3060920834541321,
-0.01775389164686203,
-0.13366156816482544,
0.03418276458978653,
0.36074575781822205,
1.0167948007583618,
-0.1177280843257904,
-0.2317254841... |
func (r *Reader) len() (length uint64, err error) {
file := r.file
// Note current position.
offset, err := file.Seek(0, io.SeekCurrent)
if err != nil {
err = liberr.Wrap(err)
return
}
defer func() {
_, err = file.Seek(offset, io.SeekStart)
if err != nil {
err = liberr.Wrap(err)
}
}()
// Seek to be... | [
0.4280739426612854,
-0.7346908450126648,
0.6793106198310852,
-0.9127041101455688,
0.712436318397522,
-0.3104236125946045,
1.0452511310577393,
0.6764549016952515,
-0.37214505672454834,
-0.12221083790063858,
-0.07263036072254181,
0.09857013821601868,
0.5416221022605896,
0.036935802549123764,... |
func (mgr *ClientMgr) add2tag(tag string, c *Client) {
_, isok := mgr.Tags[tag]
if !isok {
mgr.Tags[tag] = []*Client{}
}
mgr.Tags[tag] = append(mgr.Tags[tag], c)
} | [
-0.08764741569757462,
-0.7218289375305176,
0.5717152953147888,
-0.337024450302124,
-0.23288260400295258,
0.46487268805503845,
-0.32121723890304565,
-0.6892139911651611,
-0.6243191361427307,
-0.3641861379146576,
-0.4850986897945404,
0.8957121968269348,
0.036525532603263855,
1.49553000926971... |
func (mgr *ClientMgr) AddTask(tags *Tags, task *Task) (*Task, error) {
if tags != nil && !mgr.HasTag(tags.Tag) {
return nil, ErrNoTag
}
task.TaskID = mgr.newTaskID()
task.Tags = tags
if task.AnalyzePage != nil {
hostname, err := GetHostName(task.AnalyzePage.URL)
if err != nil {
return nil, err
}
ta... | [
0.24501794576644897,
0.5443534255027771,
0.5028216242790222,
0.565704345703125,
0.027084503322839737,
0.36010634899139404,
-0.18443310260772705,
-0.15985271334648132,
-0.5101449489593506,
-0.10732340067625046,
-0.0685727596282959,
0.2859129011631012,
0.06165122240781784,
1.0121508836746216... |
func (mgr *ClientMgr) StartAllTasks(ctx context.Context) error {
if mgr.State != ClientMgrStateNormal {
return ErrInvalidClientMgrState
}
if len(mgr.tasks) <= 0 {
return nil
}
mgr.State = ClientMgrStateTasks
endchan := make(chan int, 16)
mgr.onStartTask(ctx, endchan)
for {
curtaskid := <-endchan
i... | [
0.9793004393577576,
-0.3484884798526764,
0.6676101684570312,
0.6519869565963745,
-0.3099839687347412,
0.19525855779647827,
0.5476263761520386,
-0.14611850678920746,
0.5945666432380676,
-0.8065551519393921,
-0.28594645857810974,
0.6713114380836487,
-0.06282619386911392,
0.8583595752716064,
... |
func (mgr *ClientMgr) runTask(ctx context.Context, client *Client, task *Task, endChan chan int) error {
if task.Logger != nil {
task.Logger.Debug("runTask", zap.String("servaddr", client.servAddr), JSON("task", task))
}
task.ServAddr = client.servAddr
if task.AnalyzePage != nil {
version, reply, err := clien... | [
-0.05866958573460579,
0.056010905653238297,
0.780026912689209,
0.628625214099884,
0.12490803748369217,
-0.02973734401166439,
1.0057300329208374,
-0.24964527785778046,
-0.6191197037696838,
0.3949119448661804,
-0.3444933295249939,
0.471145361661911,
0.31548091769218445,
1.0892829895019531,
... |
func (mgr *ClientMgr) onTaskEnd(ctx context.Context, client *Client, task *Task,
err error, reply *jarviscrawlercore.ReplyCrawler, endChan chan int) {
if err != nil {
if task.Logger != nil {
task.Logger.Warn("onTaskEnd: error",
zap.Error(err),
zap.String("servaddr", client.servAddr),
JSON("task", ta... | [
-0.032340072095394135,
-0.6207934021949768,
0.8514766097068787,
-0.13336266577243805,
-0.8082150220870972,
0.799457848072052,
1.0221903324127197,
0.03792954608798027,
-0.4269331395626068,
0.46195173263549805,
-0.03411102667450905,
0.7641730308532715,
-0.22301416099071503,
1.296245098114013... |
func (mgr *ClientMgr) nextTask(ctx context.Context, endChan chan int, taskid int) bool {
mainLogger.Debug("nextTask", zap.Int("taskid", taskid))
if taskid > 0 {
for i, v := range mgr.tasks {
if v.TaskID == taskid {
mgr.tasks = append(mgr.tasks[:i], mgr.tasks[i+1:]...)
break
}
}
}
if len(mgr.tas... | [
-0.43814224004745483,
0.32414621114730835,
0.802843451499939,
0.004184667486697435,
-0.5193251967430115,
0.2516161799430847,
0.66798335313797,
-0.3248721957206726,
-0.4465777575969696,
-0.12958090007305145,
-0.5668343901634216,
0.6382248997688293,
-0.6968606114387512,
1.02759850025177,
-... |
func NewMockAuthorizer(ctrl *gomock.Controller) *MockAuthorizer {
mock := &MockAuthorizer{ctrl: ctrl}
mock.recorder = &MockAuthorizerMockRecorder{mock}
return mock
} | [
-0.33976972103118896,
0.1410403996706009,
0.24148967862129211,
0.902327835559845,
-0.6136462688446045,
-0.37859052419662476,
0.9330787062644958,
-0.08454150706529617,
0.8915907144546509,
0.7156720161437988,
-0.38224902749061584,
0.5119059085845947,
-0.20500300824642181,
1.301321029663086,
... |
func (m *MockAuthorizer) EXPECT() *MockAuthorizerMockRecorder {
return m.recorder
} | [
0.10555747896432877,
0.18339163064956665,
0.12644970417022705,
0.3876085579395294,
-0.26346713304519653,
0.1577470749616623,
0.2510009706020355,
0.6137364506721497,
0.4680081307888031,
-0.1041918620467186,
1.0500433444976807,
0.9163253903388977,
-0.523766279220581,
0.7481592297554016,
0.... |
func (m *MockAuthorizer) Authorize(arg0 *http.Request) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Authorize", arg0)
ret0, _ := ret[0].(error)
return ret0
} | [
-0.9672879576683044,
0.27787652611732483,
0.2578110992908478,
0.6838212609291077,
1.3478496074676514,
-0.3328266739845276,
0.8088779449462891,
-0.14744192361831665,
-0.8343906402587891,
0.4581122398376465,
-0.015245769172906876,
-0.29670587182044983,
-1.0786677598953247,
1.4116970300674438... |
func (mr *MockAuthorizerMockRecorder) Authorize(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authorize", reflect.TypeOf((*MockAuthorizer)(nil).Authorize), arg0)
} | [
-0.31772956252098083,
1.0026835203170776,
0.24979569017887115,
0.599622905254364,
0.26888522505760193,
-0.2022710144519806,
0.17389662563800812,
-0.703678548336029,
0.41760751605033875,
1.2323797941207886,
0.9344047904014587,
0.6154789328575134,
-1.046881079673767,
1.7242299318313599,
0.... |
func (fs *FileSystem) Finalize(options FinalizeOptions) error {
if fs.workspace == "" {
return fmt.Errorf("cannot finalize an already finalized filesystem")
}
/*
There is nothing we can find about the order of files/directories, for any of:
- inodes in inode table
- entries in directory table
- data in da... | [
-0.3818860352039337,
-0.23019415140151978,
0.7346466183662415,
0.08448762446641922,
0.20135098695755005,
-0.9445286989212036,
0.5849489569664001,
-0.08489903807640076,
0.2818041443824768,
-0.820636510848999,
0.005028166342526674,
-0.45649072527885437,
-0.5023954510688782,
0.293196141719818... |
func finalizeFragment(buf []byte, to util.File, toOffset int64, c Compressor) (raw int, compressed bool, err error) {
// compress the block if needed
if c != nil {
out, err := c.compress(buf)
if err != nil {
return 0, compressed, fmt.Errorf("error compressing fragment block: %v", err)
}
if len(out) < len(b... | [
-0.8184799551963806,
0.4462323784828186,
0.9647969603538513,
-0.9574074745178223,
-0.6138595938682556,
-0.7769290208816528,
0.7678982615470886,
0.3985861837863922,
-0.7515586614608765,
0.10504759103059769,
-0.673056960105896,
-0.5646986365318298,
-1.0965889692306519,
-0.3461473882198334,
... |
func walkTree(workspace string) ([]*finalizeFileInfo, error) {
cwd, err := os.Getwd()
if err != nil {
return nil, fmt.Errorf("could not get pwd: %v", err)
}
// make everything relative to the workspace
_ = os.Chdir(workspace)
dirMap := make(map[string]*finalizeFileInfo)
fileList := make([]*finalizeFileInfo, 0)... | [
-0.17766278982162476,
-0.3947471082210541,
1.0052261352539062,
-0.9091858863830566,
-0.9529320597648621,
-0.09914998710155487,
0.465465247631073,
-0.6578212976455688,
-0.15184657275676727,
0.04042989760637283,
-0.14082343876361847,
0.08349058777093887,
-0.843898594379425,
1.662189245223999... |
func writeFragmentBlocks(fileList []*finalizeFileInfo, f util.File, ws string, blocksize int, options FinalizeOptions, location int64) ([]fragmentBlock, int64, error) {
compressor := options.Compression
if options.NoCompressFragments {
compressor = nil
}
fragmentData := make([]byte, 0)
var (
allWritten ... | [
-0.7481240034103394,
-0.19383016228675842,
0.846863329410553,
-0.09892464429140091,
-0.058741264045238495,
-0.6551022529602051,
0.9805322289466858,
0.07864778488874435,
-0.5006159543991089,
0.20088928937911987,
-0.49016833305358887,
-0.51554936170578,
-0.9873970150947571,
0.713840007781982... |
func writeDirectories(dirs []*finalizeFileInfo, f util.File, compressor Compressor, location int64) (directoriesWritten int, finalLocation uint64, err error) {
var (
buf []byte
maxSize = int(metadataBlockSize)
initialLocation = location
)
for i, d := range dirs {
if d.directory == nil {
... | [
-1.1288896799087524,
0.21747690439224243,
0.6440100073814392,
-0.07102137804031372,
0.5021231770515442,
-0.7972229719161987,
0.9999908208847046,
0.41018736362457275,
-0.37094244360923767,
0.2551557719707489,
0.17247463762760162,
-0.6029070019721985,
-0.13763535022735596,
0.3303977251052856... |
func writeFragmentTable(fragmentBlocks []fragmentBlock, fragmentBlocksStart int64, f util.File, compressor Compressor, location int64) (fragmentsWritten int, finalLocation uint64, err error) {
// now write the actual fragment table entries
var (
indexEntries []uint64
)
var (
buf []byte
maxSize = int(metad... | [
-0.2436317503452301,
-0.11423005163669586,
0.9929009675979614,
-0.310089111328125,
0.21787390112876892,
-1.2129414081573486,
0.7495080828666687,
0.2438720017671585,
-0.2992439866065979,
0.37691283226013184,
-0.5038692355155945,
-0.04545976221561432,
-0.6841989755630493,
-0.4729333817958832... |
func writeExportTable(files []*finalizeFileInfo, f util.File, compressor Compressor, location int64) (entriesWritten int, finalLocation uint64, err error) {
var (
maxSize = int(metadataBlockSize)
)
// the lookup table is pretty simple. It is just a single array of uint64. So inode 1 is in the first
// entry, ino... | [
-0.4221121072769165,
0.08943662792444229,
1.0497760772705078,
-0.36419644951820374,
0.44538989663124084,
-0.9610609412193298,
0.7957456111907959,
0.561392068862915,
-0.33169126510620117,
0.9087364077568054,
-0.006764526944607496,
0.005528384353965521,
-0.400867760181427,
-0.249680206179618... |
func writeIDTable(idtable map[uint32]uint16, f util.File, compressor Compressor, location int64) (entriesWritten int, finalLocation uint64, err error) {
var (
maxSize = int(metadataBlockSize)
)
// to write the idtable, we need to convert the map of target ID (uid/gid) -> index into an array by index
idArray := m... | [
-0.5785558819770813,
0.0211779847741127,
0.9181424975395203,
-0.24250172078609467,
0.3853011429309845,
-0.4714968502521515,
0.518060564994812,
0.051819343119859695,
0.06031893938779831,
0.41347822546958923,
-0.5036634802818298,
0.43520182371139526,
-0.4345869719982147,
-0.22233137488365173... |
func writeXattrs(xattrs []map[string]string, f util.File, compressor Compressor, location int64) (xattrsWritten int, finalLocation uint64, err error) {
var (
maxSize = int(metadataBlockSize)
offset int
lookupTable []byte
buf []byte
)
// each entry in the xattrs slice is a unique key-value m... | [
-0.6918675303459167,
0.23636730015277863,
0.9494632482528687,
-0.6959846019744873,
-0.19558101892471313,
-0.4162920415401459,
0.12460397928953171,
0.6904937624931335,
-0.2445867955684662,
0.300226092338562,
-0.7651398777961731,
0.21537737548351288,
-0.7758796811103821,
0.23209808766841888,... |
func createInodes(fileList []*finalizeFileInfo, idtable map[uint32]uint16, options FinalizeOptions) error {
// get the inodes
var inodeIndex uint32 = 1
// need to keep track of directory position in directory table
// build our inodes for our files - must include all file types
for _, e := range fileList {
var ... | [
-0.16140727698802948,
-0.41879621148109436,
0.7609636187553406,
-0.5959759950637817,
0.1258958876132965,
-0.05745472386479378,
0.32867586612701416,
0.6234232783317566,
-0.4641045331954956,
-0.26070553064346313,
0.21584820747375488,
-0.3002670109272003,
-0.5614786148071289,
0.31102371215820... |
func extractXattrs(list []*finalizeFileInfo) []map[string]string {
var (
xattrs []map[string]string
indexMap = map[string]int{}
)
for _, e := range list {
if len(e.xattrs) == 0 {
e.xAttrIndex = noXattrInodeFlag
continue
}
var (
index int
key = hashStringMap(e.xattrs)
)
if pos, ok := ind... | [
-0.697978138923645,
-0.1736457347869873,
0.4439305365085602,
-0.3751661479473114,
0.07128532975912094,
-0.6511020660400391,
0.28312867879867554,
0.6738977432250977,
0.34887734055519104,
0.6875960230827332,
-0.798546552658081,
-0.7148675918579102,
-0.5474854111671448,
0.8388232588768005,
... |
func hashStringMap(m map[string]string) string {
// simple algorithm is good enough for this
// just join all of the key-value pairs with =, and separate with ;, so you get
// key1=value1;key2=value2;...
// it isn't perfect, but it doesn't have to be
pairs := make([]string, 0)
for k, v := range m {
pairs = app... | [
0.0487280935049057,
-0.8174934387207031,
0.7260041236877441,
-0.07586599141359329,
-0.8776801824569702,
0.04217950254678726,
-0.6676369905471802,
1.0335644483566284,
-0.5984531044960022,
0.5653746724128723,
0.30831602215766907,
-0.5439848303794861,
0.10609635710716248,
-0.07101544737815857... |
func createDirectories(e *finalizeFileInfo) []*finalizeFileInfo {
var (
dirs = make([]*finalizeFileInfo, 0)
entries = make([]*directoryEntryRaw, 0)
)
// go through each entry, and create a directory structure for it
// we will cycle through each directory, creating an entry for it
// and its children. A sec... | [
-0.5380233526229858,
-0.1839362531900406,
0.7399030923843384,
-0.04978746175765991,
-0.029427675530314445,
-0.5509033799171448,
0.617784321308136,
0.2735518515110016,
0.021715587005019188,
-0.7371532320976257,
-0.19031254947185516,
-0.2654196321964264,
-0.23606820404529572,
0.8573039174079... |
func updateInodeLocations(files []*finalizeFileInfo) {
var pos int64
// get block position for each inode
for _, f := range files {
b := f.inode.toBytes()
block, offset := uint32(pos/metadataBlockSize), uint16(pos%metadataBlockSize)
blockPos := block * (standardMetadataBlocksize + 2)
f.inodeLocation = block... | [
-1.2297570705413818,
-0.7166051864624023,
0.6170387268066406,
-0.577223539352417,
-0.32972875237464905,
-0.0862477719783783,
0.6854933500289917,
0.8995689749717712,
-0.6262733936309814,
0.98902428150177,
0.15280921757221222,
0.041310589760541916,
-0.7546229362487793,
-0.1319771111011505,
... |
func populateDirectoryLocations(directories []*finalizeFileInfo) {
// keeps our reference
pos := 0
// get block position for each inode
for _, d := range directories {
// we start without knowing the inode block/number
// in any case, this func is just here to give us sizes and therefore
// locations inside ... | [
-0.9778398871421814,
0.03136435151100159,
0.668936550617218,
-0.47606316208839417,
0.5327662229537964,
-0.3480163812637329,
0.8814491033554077,
0.2336415797472,
-0.031580161303281784,
0.4308146834373474,
0.4446965456008911,
-0.4417785108089447,
0.1534062772989273,
0.5659065246582031,
-0.... |
func updateInodesFromDirectories(files []*finalizeFileInfo) error {
// go through each directory, find its inode, and update it with the
// correct block and offset
for i, d := range files {
if d.directory == nil {
return fmt.Errorf("file at index %d missing directory information", i)
}
index := d.directory... | [
-1.265968680381775,
-0.9618152976036072,
0.7015680074691772,
-0.5851107835769653,
-0.343309611082077,
-0.18672755360603333,
0.4593033194541931,
0.2645602524280548,
-0.04761756956577301,
0.6450440883636475,
0.2660714387893677,
0.1536022424697876,
-0.43128371238708496,
0.5102328658103943,
... |
func NewGetRuleChainParams() *GetRuleChainParams {
var ()
return &GetRuleChainParams{
timeout: cr.DefaultTimeout,
}
} | [
0.03658401221036911,
-0.4178248941898346,
0.024491535499691963,
1.1398807764053345,
0.845802903175354,
-0.029985778033733368,
0.04062213376164436,
0.6416043639183044,
-1.3437165021896362,
0.0668947696685791,
-1.0675121545791626,
1.1474146842956543,
-1.0823205709457397,
0.3481151759624481,
... |
func NewGetRuleChainParamsWithTimeout(timeout time.Duration) *GetRuleChainParams {
var ()
return &GetRuleChainParams{
timeout: timeout,
}
} | [
0.7524673342704773,
-0.7110790014266968,
0.241068497300148,
0.822012186050415,
0.6937475204467773,
0.5976487398147583,
-1.054255485534668,
0.2701316475868225,
-1.193013310432434,
0.9694058299064636,
-0.41066285967826843,
1.2952309846878052,
-0.6943240165710449,
0.6201556324958801,
0.0503... |
func NewGetRuleChainParamsWithContext(ctx context.Context) *GetRuleChainParams {
var ()
return &GetRuleChainParams{
Context: ctx,
}
} | [
0.30271437764167786,
-0.5596019625663757,
0.33348551392555237,
0.5733749270439148,
0.9105973243713379,
0.6344584822654724,
-0.8131373524665833,
-0.6227724552154541,
-0.7183929681777954,
0.48451557755470276,
-0.5975149273872375,
0.9736402630805969,
-0.6908132433891296,
0.10472249984741211,
... |
func NewGetRuleChainParamsWithHTTPClient(client *http.Client) *GetRuleChainParams {
var ()
return &GetRuleChainParams{
HTTPClient: client,
}
} | [
0.5189433097839355,
-0.7840842008590698,
0.26920637488365173,
0.43438249826431274,
1.0881984233856201,
0.4981996417045593,
0.27018338441848755,
0.07297410070896149,
-1.2333296537399292,
-0.268110066652298,
-0.7068321108818054,
0.9271287322044373,
-0.9108241200447083,
0.0854068398475647,
... |
func (o *GetRuleChainParams) WithTimeout(timeout time.Duration) *GetRuleChainParams {
o.SetTimeout(timeout)
return o
} | [
0.5667945146560669,
-0.13387414813041687,
0.1808394342660904,
-0.13414029777050018,
1.127389907836914,
0.3866557776927948,
-0.27557432651519775,
-0.07921019941568375,
-0.44211071729660034,
0.6132838726043701,
0.04940593242645264,
1.2683913707733154,
0.05185047164559364,
0.5375106930732727,... |
func (o *GetRuleChainParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
0.20234058797359467,
0.238410085439682,
0.08574537932872772,
0.012948289513587952,
1.9835935831069946,
0.7243345379829407,
0.04060667008161545,
0.389788955450058,
-0.8015865087509155,
0.6260180473327637,
0.12227082997560501,
1.5943708419799805,
-0.7612036466598511,
0.570730447769165,
-0.... |
func (o *GetRuleChainParams) WithContext(ctx context.Context) *GetRuleChainParams {
o.SetContext(ctx)
return o
} | [
-0.1275050938129425,
-0.08095044642686844,
0.3487499952316284,
-0.09130637347698212,
1.016647458076477,
0.4586259722709656,
-0.33371129631996155,
-0.9026279449462891,
0.024104397743940353,
0.08077523857355118,
-0.07462852448225021,
1.0605109930038452,
-0.4747040271759033,
-0.18247708678245... |
func (o *GetRuleChainParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
-0.38585084676742554,
0.227842316031456,
0.17384423315525055,
0.1865510493516922,
1.8589448928833008,
0.5780692100524902,
-0.009527786634862423,
-0.35148438811302185,
0.07488755136728287,
0.1776610165834427,
-0.14416226744651794,
1.4061418771743774,
-1.1517308950424194,
0.02235922031104564... |
func (o *GetRuleChainParams) WithHTTPClient(client *http.Client) *GetRuleChainParams {
o.SetHTTPClient(client)
return o
} | [
0.42305436730384827,
-0.71296626329422,
0.189851313829422,
-0.40659022331237793,
1.0141586065292358,
0.12031441181898117,
0.4070403575897217,
-0.5997200608253479,
-0.8547738194465637,
-0.39893022179603577,
-0.1388516128063202,
0.8184863924980164,
-0.09177320450544357,
-0.3803498148918152,
... |
func (o *GetRuleChainParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.5372651219367981,
-0.2675834596157074,
0.14660422503948212,
-0.5325116515159607,
1.1921643018722534,
0.11152718961238861,
0.6282604932785034,
-0.30419743061065674,
-1.2127081155776978,
-0.16540445387363434,
-0.3400437831878662,
1.4357355833053589,
-1.0127896070480347,
-0.3525363504886627... |
func (o *GetRuleChainParams) WithRuleChainID(ruleChainID string) *GetRuleChainParams {
o.SetRuleChainID(ruleChainID)
return o
} | [
0.5649734735488892,
-0.9847874641418457,
0.20864473283290863,
0.0660254955291748,
1.2172389030456543,
0.1313425749540329,
-0.821235716342926,
-0.793428361415863,
0.22363539040088654,
0.06097804009914398,
-0.49241119623184204,
1.4546430110931396,
-0.35283467173576355,
0.3603498935699463,
... |
func (o *GetRuleChainParams) SetRuleChainID(ruleChainID string) {
o.RuleChainID = ruleChainID
} | [
-0.27163776755332947,
-0.8662113547325134,
0.10309604555368423,
-0.2476816624403,
1.6260652542114258,
0.27012667059898376,
-0.4520163834095001,
-0.3673439025878906,
-0.30793580412864685,
0.22285200655460358,
-0.6923722624778748,
2.126051425933838,
-0.7365403175354004,
0.5532662272453308,
... |
func (o *GetRuleChainParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param ruleChainId
if err := r.SetPathParam("ruleChainId", o.RuleChainID); err != nil {
return err
}
if len(res) > 0 {
ret... | [
-1.1406413316726685,
-0.11024873703718185,
0.6748116612434387,
-0.3306869566440582,
1.9872980117797852,
-0.16510523855686188,
0.8484216928482056,
-0.35188326239585876,
-0.6619694828987122,
0.07808969169855118,
0.39681291580200195,
0.9085568785667419,
-0.7741029262542725,
0.0681320130825042... |
func Command(handler handlers.CommandHandler) starlark.Fn {
return func(thread *lib.Thread, b *lib.Builtin, args lib.Tuple, kwargs []lib.Tuple) (lib.Value, error) {
ctx := starlark.GetCtx(thread)
dryrun := starlark.GetDryRunMode(thread)
params, err := parseArgs(b, args, kwargs)
if err != nil {
return lib.No... | [
0.10919241607189178,
-0.7233551740646362,
0.7058489322662354,
-0.34707212448120117,
0.23600050806999207,
0.439529687166214,
0.0419747494161129,
-0.060450099408626556,
-0.5787355899810791,
-0.6800269484519958,
0.7147803902626038,
0.6897884011268616,
-0.11078489571809769,
0.34811800718307495... |
func NewGetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams() *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
var ()
return &GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams{
timeout: cr.DefaultTimeout,
}
} | [
0.0998309776186943,
0.30172470211982727,
0.7641943097114563,
-1.2196364402770996,
-0.14925730228424072,
0.1508006602525711,
-0.44708189368247986,
1.108394980430603,
-0.17297033965587616,
0.23913361132144928,
1.282096028327942,
0.2509652078151703,
-0.2849518656730652,
1.2791796922683716,
... |
func NewGetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParamsWithTimeout(timeout time.Duration) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
var ()
return &GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams{
timeout: timeout,
}
} | [
0.6025278568267822,
0.2617563307285309,
0.7461057305335999,
-1.1280661821365356,
-0.18100644648075104,
0.5683728456497192,
-0.8453511595726013,
1.119766354560852,
-0.40141674876213074,
0.9642308950424194,
1.064475417137146,
0.40515798330307007,
-0.3448815941810608,
1.3826853036880493,
-0... |
func NewGetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParamsWithContext(ctx context.Context) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
var ()
return &GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams{
Context: ctx,
}
} | [
0.14928746223449707,
0.24349673092365265,
1.047156572341919,
-1.2972770929336548,
-0.18072232604026794,
0.5164106488227844,
-0.5313703417778015,
0.573052704334259,
0.23016607761383057,
0.6547947525978088,
1.143570899963379,
-0.043951332569122314,
-0.3146268427371979,
0.8738364577293396,
... |
func NewGetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParamsWithHTTPClient(client *http.Client) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
var ()
return &GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams{
HTTPClient: client,
}
} | [
0.0003580614866223186,
0.21362051367759705,
0.8897777199745178,
-0.9511633515357971,
0.12268517166376114,
0.6841417551040649,
-0.09892208129167557,
0.6361618638038635,
-0.7219734787940979,
0.18943481147289276,
1.0649787187576294,
-0.07645133137702942,
0.01643083617091179,
1.001474142074585... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WithTimeout(timeout time.Duration) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
o.SetTimeout(timeout)
return o
} | [
0.38684287667274475,
0.4999147057533264,
0.5556394457817078,
-1.4178473949432373,
-0.7789658904075623,
-0.22621236741542816,
-0.6217235922813416,
0.6608560085296631,
0.3506753742694855,
1.2451740503311157,
1.0958974361419678,
0.015233691781759262,
0.2566375136375427,
1.1556328535079956,
... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
0.5575048923492432,
0.6863928437232971,
0.4040897786617279,
-1.2614643573760986,
-0.3851323127746582,
-0.027670137584209442,
-0.2944166362285614,
1.2207049131393433,
0.09917615354061127,
1.0273858308792114,
0.9635998606681824,
0.1723903864622116,
-0.2928481698036194,
1.1704858541488647,
... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WithContext(ctx context.Context) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
o.SetContext(ctx)
return o
} | [
-0.22849731147289276,
0.24279874563217163,
0.7821225523948669,
-1.5326433181762695,
-0.7857113480567932,
-0.179782897233963,
-0.6110891103744507,
0.3465244770050049,
0.9232685565948486,
0.7528006434440613,
1.222324252128601,
-0.17769794166088104,
-0.06541174650192261,
0.6191341280937195,
... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
0.05514175444841385,
0.4505274295806885,
0.5951460599899292,
-1.078959584236145,
-0.23652637004852295,
-0.046435173600912094,
-0.27913767099380493,
0.7459011077880859,
0.8201918601989746,
0.5852548480033875,
0.8498439788818359,
0.055943410843610764,
-0.4514181613922119,
0.8226488828659058,... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WithHTTPClient(client *http.Client) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
o.SetHTTPClient(client)
return o
} | [
-0.044063303619623184,
-0.3250582814216614,
0.7953744530677795,
-1.3884440660476685,
-0.7428723573684692,
-0.10697957128286362,
-0.10207612067461014,
0.2919175922870636,
0.01506624836474657,
-0.0017314838478341699,
0.9842957854270935,
-0.17917907238006592,
0.47368893027305603,
0.4671658575... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.5184766054153442,
0.046164024621248245,
0.4686383008956909,
-1.5866470336914062,
-0.8901190161705017,
-0.42521771788597107,
0.17273813486099243,
0.37165603041648865,
-0.5716648697853088,
0.08482686430215836,
0.8175944089889526,
0.22262126207351685,
-0.23101234436035156,
0.322421640157699... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WithGranteeAddress(granteeAddress string) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
o.SetGranteeAddress(granteeAddress)
return o
} | [
0.06636600941419601,
-0.3747771680355072,
0.9667585492134094,
-1.0831060409545898,
0.045450128614902496,
-0.354707807302475,
-0.10233568400144577,
0.271414577960968,
0.9420264363288879,
0.5216199159622192,
0.3818865716457367,
0.46013641357421875,
0.023647772148251534,
1.1427258253097534,
... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) SetGranteeAddress(granteeAddress string) {
o.GranteeAddress = granteeAddress
} | [
-0.03877878934144974,
-0.2810048758983612,
0.8112950921058655,
-0.8491378426551819,
0.3934270441532135,
-0.3814102113246918,
0.43719497323036194,
0.6631028652191162,
0.6277008056640625,
0.3134617209434509,
0.0222646351903677,
0.8358479738235474,
-0.6484613418579102,
1.2882916927337646,
-... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WithGranterAddress(granterAddress string) *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams {
o.SetGranterAddress(granterAddress)
return o
} | [
0.1288689374923706,
-0.6756389141082764,
0.8308050036430359,
-0.752648115158081,
-0.5791293382644653,
-0.16936363279819489,
-0.237253800034523,
0.7260156869888306,
1.0776056051254272,
0.4552980661392212,
0.7617989182472229,
0.4584384858608246,
0.1201729029417038,
1.1199995279312134,
-0.5... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) SetGranterAddress(granterAddress string) {
o.GranterAddress = granterAddress
} | [
-0.2607625722885132,
-0.5529003739356995,
0.7116431593894958,
-0.7178452014923096,
-0.23297958076000214,
-0.4216415584087372,
0.40326088666915894,
1.0761332511901855,
0.7031413316726685,
0.3531210124492645,
0.5729568600654602,
0.5962192416191101,
-0.4329228401184082,
1.4288086891174316,
... |
func (o *GetMsgauthGrantersGranterAddressGranteesGranteeAddressGrantsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
// path param granteeAddress
if err := r.SetPathParam("granteeAddress", o.GranteeAddress... | [
-0.745036780834198,
0.25579166412353516,
0.8974072933197021,
-1.1747106313705444,
0.6180040836334229,
-0.7114691138267517,
1.034237027168274,
0.5405559539794922,
-0.11672789603471756,
0.3395674228668213,
1.0407735109329224,
0.2506839334964752,
-0.4885956943035126,
0.8658055067062378,
0.3... |
func Configure(vi View) {
viewInfo = vi
} | [
0.23472441732883453,
-0.06793518364429474,
0.3347453474998474,
0.5532923340797424,
-0.13949629664421082,
-0.6538947820663452,
0.410493403673172,
-0.020626362413167953,
-0.03762234002351761,
-1.4770725965499878,
-0.6930766701698303,
-0.9661436676979065,
0.49073633551597595,
0.37758979201316... |
func ReadConfig() View {
return viewInfo
} | [
0.20076406002044678,
-0.36062052845954895,
0.335965096950531,
-0.42952442169189453,
-0.8421273231506348,
0.11700449883937836,
0.29785603284835815,
0.24751156568527222,
-0.7993227243423462,
-0.8747683763504028,
0.24397990107536316,
-0.31027939915657043,
0.2174176573753357,
-0.02576238475739... |
func LoadTemplates(rootTemp string, childTemps []string) {
rootTemplate = rootTemp
childTemplates = childTemps
} | [
0.7906702756881714,
-0.4771181344985962,
0.37944045662879944,
0.36384791135787964,
-1.122754454612732,
-0.5634520649909973,
-0.8086432218551636,
0.33208438754081726,
0.1298418790102005,
-0.14456860721111298,
-1.4870717525482178,
-0.22584469616413116,
-1.0442605018615723,
0.4574571251869201... |
func LoadPlugins(fms ...template.FuncMap) {
// Final FuncMap
fm := make(template.FuncMap)
// Loop through the maps
for _, m := range fms {
// Loop through each key and value
for k, v := range m {
fm[k] = v
}
}
// Load the plugins
mutexPlugins.Lock()
pluginCollection = fm
mutexPlugins.Unlock()
} | [
-0.730039119720459,
-0.11110526323318481,
0.5020004510879517,
-0.0484374538064003,
0.19106586277484894,
-0.8288482427597046,
-0.09426277875900269,
0.27724117040634155,
0.32310420274734497,
-0.7219213843345642,
-0.7195290923118591,
-0.16248586773872375,
-1.059229850769043,
0.268815010786056... |
func (v *View) PrependBaseURI(s string) string {
return v.BaseURI + s
} | [
0.24413220584392548,
-0.5960056781768799,
0.4378916919231415,
0.22538913786411285,
-0.36604923009872437,
0.5953658223152161,
-0.18143285810947418,
-0.05514783412218094,
1.0204811096191406,
-0.5021578073501587,
0.22506137192249298,
0.34771594405174255,
-0.6075225472450256,
0.61099773645401,... |
func New(req *http.Request) *View {
v := &View{}
v.Vars = make(map[string]interface{})
v.Vars["AuthLevel"] = "anon"
v.BaseURI = viewInfo.BaseURI
v.Extension = viewInfo.Extension
v.Folder = viewInfo.Folder
v.Name = viewInfo.Name
// Make sure BaseURI is available in the templates
v.Vars["BaseURI"] = v.BaseURI
... | [
-0.5352354645729065,
-1.1123830080032349,
0.3743334412574768,
0.06727512925863266,
-1.0259679555892944,
0.0009890416404232383,
-0.4496673345565796,
0.12258175015449524,
0.24421466886997223,
-1.0720072984695435,
0.4425002336502075,
0.3950745463371277,
0.17432965338230133,
0.8248192667961121... |
func (v *View) AssetTimePath(s string) (string, error) {
if strings.HasPrefix(s, "//") {
return s, nil
}
s = strings.TrimLeft(s, "/")
abs, err := filepath.Abs(s)
if err != nil {
return "", err
}
time, err2 := FileTime(abs)
if err2 != nil {
return "", err2
}
return v.PrependBaseURI(s + "?" + time), n... | [
-0.19123387336730957,
-0.7260147333145142,
0.679707407951355,
-0.6014025807380676,
-0.9254864454269409,
-0.20584577322006226,
0.5414552092552185,
-0.8601348400115967,
0.0851588249206543,
1.341243863105774,
0.5613408088684082,
-0.362166166305542,
0.2964846193790436,
0.1602577418088913,
-0... |
func (v *View) RenderSingle(w http.ResponseWriter) {
// Get the template collection from cache
/*mutex.RLock()
tc, ok := templateCollection[v.Name]
mutex.RUnlock()*/
// Get the plugin collection
mutexPlugins.RLock()
pc := pluginCollection
mutexPlugins.RUnlock()
templateList := []string{v.Name}
// List of ... | [
-0.47013720870018005,
0.19346335530281067,
0.8465768694877625,
0.036012161523103714,
0.010547056794166565,
-0.7261477112770081,
0.6579968333244324,
0.709742546081543,
0.5500718951225281,
0.2063838690519333,
-1.1852192878723145,
-0.458110511302948,
-0.9538588523864746,
0.9451488852500916,
... |
func (v *View) Render(w http.ResponseWriter) {
// Get the template collection from cache
mutex.RLock()
tc, ok := templateCollection[v.Name]
mutex.RUnlock()
// Get the plugin collection
mutexPlugins.RLock()
pc := pluginCollection
mutexPlugins.RUnlock()
// If the template collection is not cached or caching i... | [
-0.24902582168579102,
-0.14656585454940796,
0.6773971915245056,
0.2023051232099533,
-0.03604291379451752,
-0.9140759706497192,
0.4827044904232025,
0.5030428171157837,
0.44757869839668274,
0.22579120099544525,
-0.9489362835884094,
-0.6288381814956665,
-0.5518988370895386,
0.935334324836731,... |
func Validate(req *http.Request, required []string) (bool, string) {
for _, v := range required {
if req.FormValue(v) == "" {
return false, v
}
}
return true, ""
} | [
-1.504127025604248,
-0.07215828448534012,
0.5620359778404236,
-0.3915999233722687,
0.5103157758712769,
0.6802421808242798,
-1.1546399593353271,
0.006574899423867464,
-1.0434883832931519,
0.04175296425819397,
-0.3070177137851715,
-0.34066540002822876,
-0.47706353664398193,
1.606171727180481... |
func (v *View) SendFlashes(w http.ResponseWriter) {
// Get session
sess := session.Instance(v.request)
flashes := peekFlashes(w, v.request)
sess.Save(v.request, w)
js, err := json.Marshal(flashes)
if err != nil {
http.Error(w, "JSON Error: "+err.Error(), http.StatusInternalServerError)
return
}
w.Header(... | [
-0.6417338252067566,
0.6212137937545776,
0.7663701176643372,
0.4403659403324127,
-0.3893822729587555,
-0.3059951961040497,
0.7131049633026123,
-1.187102198600769,
0.06776370108127594,
0.03842562809586525,
-1.4067379236221313,
0.10635349899530411,
-0.0008834898471832275,
1.0029302835464478,... |
func Repopulate(list []string, src url.Values, dst map[string]interface{}) {
for _, v := range list {
dst[v] = src.Get(v)
}
} | [
-1.7553094625473022,
0.7462726831436157,
0.4335494637489319,
-1.0383813381195068,
0.1932782232761383,
0.18944929540157318,
-1.5010638236999512,
0.8827419877052307,
-0.42997512221336365,
0.8604609966278076,
-0.48129644989967346,
-0.01005922257900238,
1.480116844177246,
0.47523489594459534,
... |
func FileTime(name string) (string, error) {
fi, err := os.Stat(name)
if err != nil {
return "", err
}
mtime := fi.ModTime().Unix()
return fmt.Sprintf("%v", mtime), nil
} | [
0.22265751659870148,
-1.1220802068710327,
0.7479806542396545,
-1.2662287950515747,
-0.6798558235168457,
-0.16311854124069214,
-0.9438617825508118,
-0.2019759863615036,
-0.3364160358905792,
1.1051324605941772,
0.026642046868801117,
-0.53990238904953,
-0.000510716752614826,
1.285259366035461... |
func (response *ResponseSearch) Render() string {
searchTemplate, err := template.New("Search").Parse(searchResultTemplate)
if err != nil {
log.Fatal(err.Error())
}
var buffer bytes.Buffer
if err = searchTemplate.Execute(&buffer, response); err != nil {
log.Fatal(err.Error())
}
return buffer.String()
} | [
0.00019043181964661926,
-0.4900616705417633,
0.37418171763420105,
-0.21058736741542816,
-0.058448612689971924,
-0.05432739108800888,
-0.34047770500183105,
-0.7264167070388794,
-0.11793997883796692,
0.2332000732421875,
-0.05396187677979469,
-1.3119070529937744,
-1.7401633262634277,
-0.57063... |
func (response *ResponseSearch) Load(data *[]byte) error {
err := json.Unmarshal(*data, &response)
return err
} | [
-0.6050371527671814,
-0.3131265640258789,
0.23794442415237427,
-1.090126872062683,
0.15522894263267517,
0.012611307203769684,
-0.5040419101715088,
-0.7594775557518005,
0.7511397004127502,
-0.2835942506790161,
-0.8514474034309387,
-0.7509647607803345,
-1.2034046649932861,
-1.272291183471679... |
func ParserProjectFindOneById(id string) (*ParserProject, error) {
return ParserProjectFindOne(ParserProjectById(id))
} | [
0.2740936875343323,
0.04391460120677948,
0.19829849898815155,
0.18032248318195343,
0.37292808294296265,
-0.2554885447025299,
0.02679392509162426,
-1.3520128726959229,
-0.4531734883785248,
0.31967517733573914,
-0.3875289261341095,
-0.3035147488117218,
-1.2010849714279175,
0.86794513463974,
... |
func ParserProjectFindOne(query db.Q) (*ParserProject, error) {
project := &ParserProject{}
err := db.FindOneQ(ParserProjectCollection, query, project)
if adb.ResultsNotFound(err) {
return nil, nil
}
return project, err
} | [
0.31532594561576843,
0.5251621007919312,
0.25594839453697205,
0.14500755071640015,
0.409343421459198,
0.47849327325820923,
-0.13299962878227234,
-1.3290808200836182,
-0.6519067287445068,
-0.07788477838039398,
0.6310162544250488,
-0.4071679711341858,
-1.7013952732086182,
1.008144497871399,
... |
func ParserProjectById(id string) db.Q {
return db.Query(bson.M{ParserProjectIdKey: id})
} | [
0.5260416269302368,
-0.4169393479824066,
-0.0055628204718232155,
-0.17179201543331146,
-0.38307324051856995,
0.20115888118743896,
-0.5246496796607971,
-0.2655780017375946,
-0.443044513463974,
0.5785699486732483,
0.115580253303051,
-0.858734667301178,
-1.0805503129959106,
0.1366600841283798... |
func ParserProjectUpsertOne(query interface{}, update interface{}) error {
_, err := db.Upsert(
ParserProjectCollection,
query,
update,
)
return err
} | [
-0.09399983286857605,
0.317854106426239,
0.6214006543159485,
-0.056845538318157196,
0.6795018911361694,
0.5851435661315918,
-0.21153417229652405,
-0.43265533447265625,
-0.9945692420005798,
0.42310449481010437,
-0.07885909080505371,
-1.3053627014160156,
-1.390231966972351,
-0.39249628782272... |
func ParserProjectByVersion(projectId, version string) (*ParserProject, error) {
lookupVersion := false
if version == "" {
lastGoodVersion, err := FindVersionByLastKnownGoodConfig(projectId, -1)
if err != nil || lastGoodVersion == nil {
grip.Error(message.WrapError(err, message.Fields{
"message": "Unabl... | [
-0.0021361957769840956,
-0.36953386664390564,
0.28641271591186523,
-0.1032828688621521,
-0.007475468795746565,
-0.21530403196811676,
-0.2307085245847702,
-0.6704057455062866,
0.07753150165081024,
1.039259910583496,
-0.17201687395572662,
-0.1276768296957016,
-1.405194878578186,
0.0013187063... |
func (pp *ParserProject) TryUpsert() error {
err := ParserProjectUpsertOne(checkConfigNumberQuery(pp.Id, pp.ConfigUpdateNumber), pp)
if !db.IsDuplicateKey(err) {
return errors.Wrapf(err, "database error upserting parser project")
}
// log this error but don't return it
grip.Debug(message.WrapError(err, message.... | [
-0.593401312828064,
0.33394309878349304,
0.632409393787384,
-0.3722216486930847,
0.9217954874038696,
0.30101844668388367,
-0.11543489247560501,
-0.14027945697307587,
-0.6318392753601074,
0.02529466152191162,
-0.34697628021240234,
-0.8174740672111511,
-1.2122400999069214,
0.3795869350433349... |
func (pp *ParserProject) UpsertWithConfigNumber(updateNum int) error {
if pp.Id == "" {
return errors.New("no version ID given")
}
expectedNum := pp.ConfigUpdateNumber
pp.ConfigUpdateNumber = updateNum
if err := ParserProjectUpsertOne(checkConfigNumberQuery(pp.Id, expectedNum), pp); err != nil {
// expose all ... | [
-1.234505295753479,
-0.11536390334367752,
0.6251602172851562,
0.18755365908145905,
-0.2751350700855255,
0.09410419315099716,
0.16336855292320251,
0.36264199018478394,
-0.13543254137039185,
1.0210577249526978,
-0.6576539874076843,
-1.0506398677825928,
-0.7328078746795654,
0.2953325510025024... |
func Default(ctx context.Context, t *mold.Transformer, v reflect.Value, param string) error {
if !v.IsZero() {
return nil
}
switch v.Interface().(type) {
case string:
v.SetString(param)
case int, int8, int16, int32, int64:
value, err := strconv.Atoi(param)
if err != nil {
return err
}
v.SetInt(int6... | [
-0.4046262800693512,
-0.0566089041531086,
0.845446765422821,
-0.612922728061676,
0.4959944784641266,
-0.5375195145606995,
-0.34152328968048096,
-0.19395293295383453,
-0.47887277603149414,
0.37575995922088623,
-0.27714821696281433,
0.6534780263900757,
0.11339234560728073,
0.858046293258667,... |
func (cs *ClosableClient) Close() error {
return cs.Client.Disconnect(context.Background())
} | [
0.06936047971248627,
-0.03945503383874893,
0.5483366250991821,
0.20919443666934967,
-0.43878793716430664,
0.7041558623313904,
0.1336078941822052,
-1.3129291534423828,
-0.6435128450393677,
0.3465338349342346,
0.4843212068080902,
0.009040181525051594,
-1.4507577419281006,
-0.2042794823646545... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.