text stringlengths 11 6.3k | embedding listlengths 768 768 |
|---|---|
func (s *SoundGroup) Release() error {
res := C.FMOD_SoundGroup_Release(s.cptr)
return errs[res]
} | [
-1.2038978338241577,
0.6857479810714722,
0.10001013427972794,
-0.004108921624720097,
-0.45930761098861694,
-1.2998158931732178,
0.7748535871505737,
-1.050437331199646,
-0.1588386446237564,
-0.3963322341442108,
0.30181846022605896,
0.2789267599582672,
-1.4499326944351196,
1.084580421447754,... |
func (s *SoundGroup) SystemObject() (*System, error) {
var system System
res := C.FMOD_SoundGroup_GetSystemObject(s.cptr, &system.cptr)
return &system, errs[res]
} | [
-0.2777697443962097,
-0.25096485018730164,
0.33532753586769104,
0.25318530201911926,
-0.47040674090385437,
-0.5445868968963623,
0.6406603455543518,
-1.8457533121109009,
0.07511337101459503,
-1.1468578577041626,
-0.050596632063388824,
0.6331247687339783,
-0.4542686939239502,
0.4309746623039... |
func (s *SoundGroup) SetMaxAudible(maxaudible int) error {
res := C.FMOD_SoundGroup_SetMaxAudible(s.cptr, C.int(maxaudible))
return errs[res]
} | [
-0.7132049798965454,
0.13761299848556519,
0.5953162908554077,
0.2380649894475937,
-0.9689440727233887,
0.1014389842748642,
0.3175802528858185,
-0.8198224902153015,
-0.1630360633134842,
0.40600675344467163,
-0.0672309473156929,
-0.24914085865020752,
-0.7032337188720703,
0.5356400012969971,
... |
func (s *SoundGroup) MaxAudible() (int, error) {
var maxaudible C.int
res := C.FMOD_SoundGroup_GetMaxAudible(s.cptr, &maxaudible)
return int(maxaudible), errs[res]
} | [
-0.04941322281956673,
-0.030828671529889107,
0.7020984888076782,
0.4711533784866333,
-1.1349446773529053,
-0.5326932668685913,
0.2118922770023346,
-0.6748190522193909,
-0.6346629858016968,
0.131022110581398,
0.6532865762710571,
-0.4721599519252777,
-0.813439130783081,
0.4181501865386963,
... |
func (s *SoundGroup) SetMaxAudibleBehavior(behavior C.FMOD_SOUNDGROUP_BEHAVIOR) error {
//FMOD_RESULT F_API FMOD_SoundGroup_SetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR behavior);
return ErrNoImpl
} | [
-0.7692593932151794,
-0.06471572816371918,
0.6972746849060059,
0.5445935726165771,
-0.7131121754646301,
0.24980850517749786,
1.1624469757080078,
-0.8546956777572632,
1.1344530582427979,
0.240513414144516,
0.48977208137512207,
0.12524299323558807,
-0.21454264223575592,
0.46905818581581116,
... |
func (s *SoundGroup) MaxAudibleBehavior(behavior *C.FMOD_SOUNDGROUP_BEHAVIOR) error {
//FMOD_RESULT F_API FMOD_SoundGroup_GetMaxAudibleBehavior (FMOD_SOUNDGROUP *soundgroup, FMOD_SOUNDGROUP_BEHAVIOR *behavior);
return ErrNoImpl
} | [
-0.4465387463569641,
0.0632573589682579,
0.7529805302619934,
0.6417327523231506,
-0.9079245924949646,
0.009308424778282642,
0.9461574554443359,
-0.979771077632904,
1.258961796760559,
0.08673162013292313,
0.8398168683052063,
-0.024964464828372,
-0.3899345099925995,
0.2282676249742508,
0.8... |
func (s *SoundGroup) SetMuteFadeSpeed(speed float64) error {
res := C.FMOD_SoundGroup_SetMuteFadeSpeed(s.cptr, C.float(speed))
return errs[res]
} | [
-0.7499648928642273,
0.622369110584259,
0.3565283715724945,
1.0593209266662598,
-0.4124538004398346,
-0.32546481490135193,
-0.2658817768096924,
-0.7383716106414795,
0.6942530274391174,
0.010135125368833542,
-0.7130676507949829,
0.30493009090423584,
-1.1118874549865723,
2.2373228073120117,
... |
func (s *SoundGroup) MuteFadeSpeed() (float64, error) {
var speed C.float
res := C.FMOD_SoundGroup_GetMuteFadeSpeed(s.cptr, &speed)
return float64(speed), errs[res]
} | [
-0.2626291811466217,
0.8248991966247559,
0.07570052146911621,
0.9040209650993347,
-0.6228773593902588,
-0.9141350388526917,
-0.17898495495319366,
-1.0448309183120728,
0.2945937514305115,
-0.15011587738990784,
0.1908545047044754,
0.30119991302490234,
-1.6280275583267212,
1.7232904434204102,... |
func (s *SoundGroup) SetVolume(volume float64) error {
res := C.FMOD_SoundGroup_SetVolume(s.cptr, C.float(volume))
return errs[res]
} | [
-0.6016072630882263,
0.9372631907463074,
0.31997787952423096,
0.6611488461494446,
0.03206625580787659,
-0.6675091981887817,
0.7270880341529846,
-0.8342565894126892,
-0.7468998432159424,
-0.6257809996604919,
0.1850268393754959,
-0.34905657172203064,
-1.4138009548187256,
1.480973482131958,
... |
func (s *SoundGroup) Volume() (float64, error) {
var volume C.float
res := C.FMOD_SoundGroup_GetVolume(s.cptr, &volume)
return float64(volume), errs[res]
} | [
-0.35672563314437866,
0.6332553625106812,
0.3238360583782196,
0.45956894755363464,
0.016574228182435036,
-1.4448120594024658,
0.7326102256774902,
-1.3278026580810547,
-0.6840990781784058,
-0.6808043718338013,
0.8896623849868774,
-0.08353925496339798,
-1.3382492065429688,
0.8236232995986938... |
func (s *SoundGroup) Stop() error {
res := C.FMOD_SoundGroup_Stop(s.cptr)
return errs[res]
} | [
-1.5942347049713135,
0.3082585036754608,
-0.029742218554019928,
-0.1694093495607376,
-0.38253989815711975,
-0.8094170689582825,
0.747930645942688,
-0.6759244799613953,
-0.7074775099754333,
-0.1728891283273697,
-0.20768292248249054,
0.19350296258926392,
-1.0665963888168335,
0.52650374174118... |
func (s *SoundGroup) Name() (string, error) {
nlen := C.int(len(s.name) + 1)
var cname *C.char = C.CString(`\0`)
defer C.free(unsafe.Pointer(cname))
res := C.FMOD_SoundGroup_GetName(s.cptr, cname, nlen)
if C.GoString(cname) != s.name {
return s.name, errors.New("Wrong names")
}
return C.GoString(cname), errs[r... | [
-0.5289290547370911,
-0.15604765713214874,
0.5994502305984497,
0.09735418111085892,
-1.279940128326416,
-1.396109700202942,
0.3197905421257019,
-1.6633011102676392,
-0.09565185010433197,
0.5829971432685852,
-0.12818539142608643,
0.004398019053041935,
-0.7260745763778687,
0.5495191216468811... |
func (s *SoundGroup) NumSounds() (int, error) {
var numsounds C.int
res := C.FMOD_SoundGroup_GetNumSounds(s.cptr, &numsounds)
return int(numsounds), errs[res]
} | [
-0.42608800530433655,
0.6985151767730713,
0.41684210300445557,
-0.3247731328010559,
-0.13469643890857697,
-1.2422631978988647,
0.726929247379303,
-1.3771990537643433,
0.5046184062957764,
-0.46449464559555054,
-0.7138372659683228,
-0.048626866191625595,
-0.8336328864097595,
0.67518579959869... |
func (s *SoundGroup) Sound(index int) (*Sound, error) {
var sound Sound
res := C.FMOD_SoundGroup_GetSound(s.cptr, C.int(index), &sound.cptr)
return &sound, errs[res]
} | [
-0.44605132937431335,
0.5370807647705078,
0.2402782291173935,
-0.03510724753141403,
-0.24396081268787384,
-0.7368593811988831,
0.21796847879886627,
-1.8770174980163574,
0.4227867126464844,
-0.3835192918777466,
0.4223076403141022,
0.6208746433258057,
-1.0505836009979248,
0.21349309384822845... |
func (s *SoundGroup) NumPlaying() (int, error) {
var numplaying C.int
res := C.FMOD_SoundGroup_GetNumPlaying(s.cptr, &numplaying)
return int(numplaying), errs[res]
} | [
-0.38825178146362305,
1.1510519981384277,
0.612636923789978,
0.36029693484306335,
-0.5753946900367737,
-0.972762405872345,
0.9572572112083435,
0.0822446271777153,
0.17570558190345764,
-0.48548388481140137,
-0.3776797652244568,
-0.3893057703971863,
-1.0483956336975098,
0.6005584001541138,
... |
func (s *SoundGroup) SetUserData(userdata interface{}) error {
data := *(*[]*C.char)(unsafe.Pointer(&userdata))
res := C.FMOD_SoundGroup_SetUserData(s.cptr, unsafe.Pointer(&data))
return errs[res]
} | [
-1.1929805278778076,
0.17512747645378113,
0.45816558599472046,
0.3039693832397461,
-0.8271566033363342,
-0.031188463792204857,
0.8326298594474792,
-1.3863638639450073,
0.08873283118009567,
-0.7597122192382812,
-0.8645746111869812,
0.9392672181129456,
-1.0960181951522827,
0.7596593499183655... |
func (s *SoundGroup) UserData() (interface{}, error) {
var userdata *interface{}
cUserdata := unsafe.Pointer(userdata)
res := C.FMOD_SoundGroup_GetUserData(s.cptr, &cUserdata)
return *(*interface{})(cUserdata), errs[res]
} | [
-0.7387267351150513,
0.08043590933084488,
0.5472049117088318,
0.34380170702934265,
-0.9910290241241455,
-0.6455177068710327,
0.7592110633850098,
-1.7271966934204102,
0.18392173945903778,
-1.1153028011322021,
-0.14590035378932953,
0.7677311301231384,
-0.929313600063324,
0.2151273488998413,
... |
func (d *Dentry) Init(impl DentryImpl) {
d.impl = impl
} | [
-0.8979934453964233,
0.6664599776268005,
0.30847635865211487,
-1.7332079410552979,
0.08258957415819168,
0.02421395853161812,
0.6159104108810425,
0.38022515177726746,
0.3743671774864197,
-0.268604040145874,
-0.38088423013687134,
1.5771591663360596,
0.8450506925582886,
0.8564925193786621,
... |
func (d *Dentry) Impl() DentryImpl {
return d.impl
} | [
-0.4665919542312622,
0.4408115744590759,
0.2947489023208618,
-1.356758713722229,
-0.31113147735595703,
0.22341495752334595,
0.5969905853271484,
-0.19665087759494781,
0.9063690304756165,
-0.5854968428611755,
0.14315944910049438,
0.5067519545555115,
1.1727505922317505,
-0.18841063976287842,
... |
func (d *Dentry) IsDisowned() bool {
return atomic.LoadUint32(&d.flags)&dflagsDisownedMask != 0
} | [
-0.2362750917673111,
0.6056936979293823,
0.37407657504081726,
0.49596166610717773,
0.8479763269424438,
-0.09098541736602783,
0.7611594796180725,
-0.12683317065238953,
0.2575431764125824,
-1.1872860193252563,
-0.44162631034851074,
0.4701884984970093,
0.3825599253177643,
0.6013830900192261,
... |
func (d *Dentry) IncRef() {
d.impl.IncRef()
} | [
-0.024384809657931328,
0.5475698709487915,
0.5018415451049805,
-0.40205368399620056,
0.17933276295661926,
0.08456967771053314,
1.0768744945526123,
0.07463319599628448,
0.24036237597465515,
-0.07606813311576843,
0.5467718243598938,
1.2026581764221191,
0.9605439305305481,
1.2779595851898193,... |
func (d *Dentry) TryIncRef() bool {
return d.impl.TryIncRef()
} | [
0.02365780994296074,
0.9318148493766785,
0.5246657729148865,
-0.41019609570503235,
0.009309065528213978,
-0.34130871295928955,
0.3706408143043518,
-0.40166133642196655,
-0.9679153561592102,
-0.29349958896636963,
-0.3933124840259552,
0.1462354063987732,
-0.323918879032135,
0.086838625371456... |
func (d *Dentry) DecRef() {
d.impl.DecRef()
} | [
0.5788630843162537,
0.8502009510993958,
0.2907778322696686,
-0.7395417094230652,
0.8246699571609497,
-0.48447349667549133,
1.0391334295272827,
0.2126554250717163,
-0.3559614419937134,
-0.4451063573360443,
0.35629400610923767,
0.6954948306083679,
0.9972676634788513,
1.2827818393707275,
-0... |
func (d *Dentry) Name() string {
return d.name
} | [
-0.6419420838356018,
0.07872945815324783,
0.3618129789829254,
-0.3869035542011261,
-0.4811080992221832,
-0.3569987714290619,
-0.1462693214416504,
-0.31749269366264343,
0.06659666448831558,
0.4395698606967926,
-0.11467340588569641,
0.27933213114738464,
1.2437649965286255,
0.5212441086769104... |
func (d *Dentry) Parent() *Dentry {
return d.parent
} | [
0.311058908700943,
0.8852793574333191,
0.23937474191188812,
-0.29409822821617126,
-0.3349683880805969,
-0.3750626742839813,
0.9576004147529602,
-0.6450272798538208,
0.06900888681411743,
-0.9028169512748718,
0.6335260272026062,
0.6098065972328186,
0.7655927538871765,
0.44517770409584045,
... |
func (d *Dentry) ParentOrSelf() *Dentry {
if d.parent == nil {
return d
}
return d.parent
} | [
0.34588274359703064,
0.46021804213523865,
0.18509541451931,
-0.7061088681221008,
-0.520542562007904,
-0.30547472834587097,
0.3648761808872223,
-0.6514589786529541,
-0.17868466675281525,
-0.36849039793014526,
0.530214250087738,
0.2297980934381485,
0.17171037197113037,
0.6487260460853577,
... |
func (d *Dentry) Child(name string) *Dentry {
return d.children[name]
} | [
0.563983678817749,
0.2555083930492401,
0.12184655666351318,
-0.501480758190155,
-1.2674369812011719,
0.4031354486942291,
-0.3098331689834595,
-0.75166916847229,
-0.23507598042488098,
-0.5890488028526306,
-0.47436076402664185,
0.5055572390556335,
1.7963335514068604,
-0.6335697770118713,
-... |
func (d *Dentry) HasChildren() bool {
return len(d.children) != 0
} | [
0.10832606256008148,
1.2825889587402344,
0.4797944724559784,
-0.8320807218551636,
0.6863078474998474,
-0.13433711230754852,
-0.15507087111473083,
0.35752618312835693,
-0.2162511795759201,
-1.0799806118011475,
-0.7678031921386719,
-0.36451199650764465,
0.6976727843284607,
0.5897185206413269... |
func (d *Dentry) Children() map[string]*Dentry {
if !d.HasChildren() {
return nil
}
m := make(map[string]*Dentry)
for name, child := range d.children {
m[name] = child
}
return m
} | [
-0.5106443762779236,
0.11117231845855713,
0.31344711780548096,
-0.9348031282424927,
-0.8250688910484314,
-0.16966816782951355,
-0.8680294156074524,
-0.7634062170982361,
-0.17443063855171204,
-0.6214204430580139,
-0.5062263607978821,
-0.24523329734802246,
1.270341396331787,
0.32783713936805... |
func (d *Dentry) InsertChild(child *Dentry, name string) {
if checkInvariants {
if _, ok := d.children[name]; ok {
panic(fmt.Sprintf("parent already contains a child named %q", name))
}
if child.parent != nil || child.name != "" {
panic(fmt.Sprintf("child is not independent: parent = %v, name = %q", child.... | [
-0.10135801136493683,
1.316501259803772,
0.5075795650482178,
-0.8864567279815674,
-0.4818946123123169,
0.7013828754425049,
-0.3028131127357483,
0.16786295175552368,
-0.7162324786186218,
-0.06685364246368408,
-1.0538077354431152,
-0.4198352098464966,
-0.4447649419307709,
0.03571739420294762... |
func (d *Dentry) IsAncestorOf(d2 *Dentry) bool {
for d2.parent != nil {
if d2.parent == d {
return true
}
d2 = d2.parent
}
return false
} | [
-0.5065867304801941,
0.3490239679813385,
0.4445607364177704,
-0.18945001065731049,
-0.8226957321166992,
-1.1682939529418945,
-0.32877135276794434,
-1.2585906982421875,
0.6546837091445923,
0.12952730059623718,
0.622175931930542,
1.169521689414978,
0.808524489402771,
0.5779528021812439,
-1... |
func (vfs *VirtualFilesystem) PrepareDeleteDentry(mntns *MountNamespace, d *Dentry) error {
if checkInvariants {
if d.parent == nil {
panic("d is independent")
}
if d.IsDisowned() {
panic("d is already disowned")
}
}
vfs.mountMu.Lock()
if mntns.mountpoints[d] != 0 {
vfs.mountMu.Unlock()
return sys... | [
0.5925813913345337,
0.05618002638220787,
0.5170156955718994,
0.5936933159828186,
0.21503953635692596,
-0.5442827939987183,
-0.8470944762229919,
-0.666684627532959,
1.4432052373886108,
-0.12210076302289963,
0.5292510986328125,
0.9408543705940247,
0.5691275596618652,
0.99293053150177,
0.03... |
func (vfs *VirtualFilesystem) AbortDeleteDentry(d *Dentry) {
d.mu.Unlock()
} | [
0.5759422779083252,
-0.4753074049949646,
0.37720853090286255,
-0.2330656200647354,
0.6329914331436157,
-0.040520261973142624,
-0.418544203042984,
-0.9140861630439758,
1.4576587677001953,
0.13602034747600555,
1.417751669883728,
1.1433649063110352,
0.5438830256462097,
0.17278645932674408,
... |
func (vfs *VirtualFilesystem) CommitDeleteDentry(d *Dentry) {
if d.parent != nil {
delete(d.parent.children, d.name)
}
d.setDisowned()
d.mu.Unlock()
if d.isMounted() {
vfs.forgetDisownedMountpoint(d)
}
} | [
0.4457918107509613,
-0.7281590700149536,
0.5275628566741943,
0.382949560880661,
0.7772276997566223,
0.027902714908123016,
0.13935735821723938,
-0.6238953471183777,
0.8080534338951111,
1.1177388429641724,
0.4878665506839752,
0.5008165836334229,
-0.05328230559825897,
0.47626015543937683,
-... |
func (vfs *VirtualFilesystem) ForceDeleteDentry(d *Dentry) {
if checkInvariants {
if d.parent == nil {
panic("d is independent")
}
if d.IsDisowned() {
panic("d is already disowned")
}
}
d.mu.Lock()
vfs.CommitDeleteDentry(d)
} | [
0.25315672159194946,
0.7436993718147278,
0.08480299264192581,
0.24318815767765045,
0.4962101876735687,
0.4084833562374115,
-0.5160512328147888,
-0.24551674723625183,
0.472883015871048,
-0.038259778171777725,
-0.16414986550807953,
1.3138121366500854,
0.36576130986213684,
1.3754534721374512,... |
func (vfs *VirtualFilesystem) PrepareRenameDentry(mntns *MountNamespace, from, to *Dentry) error {
if checkInvariants {
if from.parent == nil {
panic("from is independent")
}
if from.IsDisowned() {
panic("from is already disowned")
}
if to != nil {
if to.parent == nil {
panic("to is independent"... | [
0.06570695340633392,
-0.22543521225452423,
0.6377493739128113,
0.24592463672161102,
0.10556946694850922,
-0.7484872937202454,
-0.9343538284301758,
-1.1781853437423706,
0.6230176091194153,
0.6825369596481323,
-0.038939621299505234,
0.9124138951301575,
0.3068540394306183,
0.41621318459510803... |
func (vfs *VirtualFilesystem) AbortRenameDentry(from, to *Dentry) {
from.mu.Unlock()
if to != nil {
to.mu.Unlock()
}
} | [
0.11094499379396439,
-0.28162312507629395,
0.361213743686676,
-0.33998480439186096,
0.017992619425058365,
-0.1335427612066269,
-0.9774838089942932,
-1.1429182291030884,
0.4134320020675659,
0.8540112972259521,
0.5903143286705017,
1.50364351272583,
0.11047424376010895,
-0.3061342239379883,
... |
func (vfs *VirtualFilesystem) CommitRenameReplaceDentry(from, newParent *Dentry, newName string, to *Dentry) {
if newParent.children == nil {
newParent.children = make(map[string]*Dentry)
}
newParent.children[newName] = from
from.parent = newParent
from.name = newName
from.mu.Unlock()
if to != nil {
to.setDi... | [
0.19600322842597961,
-0.761155903339386,
0.5662122368812561,
-0.4780791401863098,
0.23401804268360138,
-0.28262630105018616,
-0.3096703886985779,
-0.046721331775188446,
-0.16232354938983917,
1.0519407987594604,
-0.14368033409118652,
0.7972235679626465,
0.06715475022792816,
0.36943432688713... |
func (vfs *VirtualFilesystem) CommitRenameExchangeDentry(from, to *Dentry) {
from.parent, to.parent = to.parent, from.parent
from.name, to.name = to.name, from.name
from.parent.children[from.name] = from
to.parent.children[to.name] = to
from.mu.Unlock()
to.mu.Unlock()
} | [
-0.24872559309005737,
-0.48102423548698425,
0.7615373134613037,
-0.986329972743988,
-0.08607304841279984,
-0.30195263028144836,
-0.41742342710494995,
-0.3328844904899597,
0.12182717025279999,
1.225138783454895,
-0.47368323802948,
0.7196306586265564,
-0.19510973989963531,
-0.381703346967697... |
func (vfs *VirtualFilesystem) forgetDisownedMountpoint(d *Dentry) {
var (
vdsToDecRef []VirtualDentry
mountsToDecRef []*Mount
)
vfs.mountMu.Lock()
vfs.mounts.seq.BeginWrite()
for mnt := range vfs.mountpoints[d] {
vdsToDecRef, mountsToDecRef = vfs.umountRecursiveLocked(mnt, &umountRecursiveOptions{}, vdsTo... | [
0.41327232122421265,
-0.19948981702327728,
0.5557845234870911,
0.07095511257648468,
0.7469963431358337,
-0.5942084193229675,
0.6684081554412842,
-0.3860008120536804,
-0.13404029607772827,
-0.21884185075759888,
0.4386995732784271,
0.6904802918434143,
0.5033606886863708,
0.7320018410682678,
... |
func NewTrxMgrEntry(chainId prototype.ChainId, trx *prototype.SignedTransaction, callback TrxCallback) *TrxEntry {
return &TrxEntry{
chainId: chainId,
result: &prototype.TransactionWrapperWithInfo{
SigTrx: trx,
Receipt: &prototype.TransactionReceiptWithInfo{Status: prototype.StatusSuccess},
},
callback:... | [
0.3990783095359802,
-0.28698891401290894,
0.19664455950260162,
-0.9056032299995422,
-0.2789095342159271,
-0.8987498879432678,
-1.2335963249206543,
-0.7484233379364014,
-0.22319379448890686,
0.797332227230072,
-0.36424779891967773,
-0.04033885896205902,
-0.5405633449554443,
0.47698405385017... |
func (e *TrxEntry) Deliver() {
if e.callback != nil {
e.callback(e.result)
}
} | [
0.8308823704719543,
0.42513254284858704,
0.25389572978019714,
-0.5168517827987671,
0.18065954744815826,
0.41661736369132996,
-0.23415923118591309,
0.07429851591587067,
0.32405799627304077,
0.4548707604408264,
-0.08051455765962601,
-0.9622602462768555,
-0.13212928175926208,
0.75121384859085... |
func (e *TrxEntry) InitCheck() error {
trx := e.result.SigTrx
// basic check
if err := trx.Validate(); err != nil {
return e.SetError(err)
}
if trxId, err := trx.Id(); err != nil {
return e.SetError(err)
} else {
e.trxId = string(trxId.Hash)
}
// transaction size limit check
e.size = proto.Size(trx)
i... | [
0.4733370244503021,
0.5730682611465454,
0.8217859268188477,
0.3943634629249573,
-0.10492943227291107,
-0.3661104142665863,
0.2988193929195404,
-0.10987520217895508,
-0.4228355586528778,
0.029303966090083122,
-0.19921405613422394,
-0.312151163816452,
-0.14525532722473145,
0.1295243352651596... |
func (e *TrxEntry) CheckExpiration(blockTime uint32) error {
expiration := e.result.SigTrx.GetTrx().GetExpiration().GetUtcSeconds()
if expiration < blockTime {
return e.SetError(fmt.Errorf("trx expired, %d < %d", expiration, blockTime))
}
if expiration > blockTime + constants.TrxMaxExpirationTime {
return e.Set... | [
0.6873890161514282,
0.5289092659950256,
0.5318459868431091,
0.5064473152160645,
-0.06966616213321686,
0.10912357270717621,
-0.6138850450515747,
-0.09183316677808762,
-0.12685847282409668,
1.8342853784561157,
0.16259834170341492,
-0.011302074417471886,
0.5522425770759583,
0.2806512713432312... |
func (e *TrxEntry) CheckTapos(checker *TaposChecker) error {
if err := checker.Check(e.result.SigTrx.Trx); err != nil {
return e.SetError(fmt.Errorf("tapos failed: %s", err.Error()))
}
return nil
} | [
-0.24204960465431213,
0.271668016910553,
0.3087572753429413,
-0.127245232462883,
-0.2520778775215149,
0.5806933641433716,
-0.48910295963287354,
-0.7293399572372437,
-0.38594523072242737,
0.9123775959014893,
-0.08151870220899582,
-1.0292519330978394,
0.693564772605896,
0.26534533500671387,
... |
func (e *TrxEntry) CheckSignerKey(fetcher *AuthFetcher) error {
if err := fetcher.CheckPublicKey(e.signer, e.signerKey); err != nil {
return e.SetError(fmt.Errorf("signature failed: %s", err.Error()))
}
return nil
} | [
-0.5073161125183105,
-0.44779476523399353,
0.3030659258365631,
0.8624421954154968,
-0.3832264244556427,
0.07148932665586472,
0.3329490125179291,
0.167283833026886,
-0.4223414659500122,
0.9391933679580688,
-0.2261466532945633,
-0.4269261658191681,
-0.028671665117144585,
1.5279215574264526,
... |
func (e *TrxEntry) CheckInBlockTrxs(checker *InBlockTrxChecker) error {
if checker.Has(e.result.SigTrx) {
return e.SetError(errors.New("found duplicate in-block trx"))
}
return nil
} | [
0.1714857816696167,
0.10762641578912735,
0.42887741327285767,
0.1751440167427063,
-0.046159256249666214,
-0.6860784292221069,
0.14300014078617096,
-0.41663727164268494,
-0.303330659866333,
1.2514114379882812,
-0.34411171078681946,
-0.2324635237455368,
-0.5923117399215698,
-0.01709367893636... |
func NewTrxMgr(chainId prototype.ChainId, db iservices.IDatabaseRW, logger *logrus.Logger, lastBlock, commitBlock uint64) *TrxMgr {
auth := NewAuthFetcher(db, logger, lastBlock, commitBlock)
tapos := NewTaposChecker(db, logger, lastBlock)
history := NewInBlockTrxChecker(db, logger, lastBlock)
return &TrxMgr{
chai... | [
-0.2618447244167328,
-0.30081331729888916,
0.3577336072921753,
-0.8611336350440979,
-0.12390603870153427,
-1.1097400188446045,
-1.0407421588897705,
-0.3090691566467285,
-0.5984506607055664,
0.1811220347881317,
0.06567583978176117,
0.1943410485982895,
-0.5616756677627563,
0.9264360070228577... |
func (m *TrxMgr) AddTrx(trx *prototype.SignedTransaction, callback TrxCallback) error {
entry := NewTrxMgrEntry(m.chainId, trx, callback)
// very basic nil pointer check
if trx == nil || trx.Signature == nil {
err := entry.SetError(errors.New("invalid trx"))
m.deliverEntry(entry)
return err
}
// very basic d... | [
-0.09832165390253067,
0.2901470959186554,
0.9053594470024109,
-0.4003158509731293,
-0.1206832155585289,
-0.21290558576583862,
-0.23736995458602905,
-0.21687434613704681,
0.5390056371688843,
-0.00709283072501421,
0.19374535977840424,
-0.16936087608337402,
-0.4011995494365692,
0.009373307228... |
func (m *TrxMgr) WaitingCount() int {
m.waitingLock.RLock()
defer m.waitingLock.RUnlock()
return len(m.waiting)
} | [
0.23157614469528198,
0.5758902430534363,
0.28578537702560425,
-0.1742924451828003,
-0.3789462745189667,
-0.13864080607891083,
0.039368197321891785,
1.1797914505004883,
-1.5354435443878174,
-0.5295409560203552,
0.028811560943722725,
-0.8854417204856873,
-0.42088064551353455,
0.2218436449766... |
func (m *TrxMgr) FetchTrx(blockTime uint32, maxCount, maxSize int) (entries []*TrxEntry) {
m.waitingLock.Lock()
defer m.waitingLock.Unlock()
m.fetchedLock.Lock()
defer m.fetchedLock.Unlock()
counter, size := 0, 0
// traverse the waiting pool
for s, e := range m.waiting {
// check count limit
if maxCount > ... | [
0.28594478964805603,
-0.282867968082428,
0.5475156307220459,
-0.016561927273869514,
-0.5004680156707764,
-0.1192164272069931,
-0.14093667268753052,
-0.13482782244682312,
-0.19176766276359558,
0.5248373746871948,
0.18581007421016693,
0.16542166471481323,
-0.15192106366157532,
-0.09686186164... |
func (m *TrxMgr) ReturnTrx(entries ...*TrxEntry) {
m.log.Debug("TRXMGR: ReturnTrx begin")
timing := common.NewTiming()
timing.Begin()
m.fetchedLock.Lock()
defer m.fetchedLock.Unlock()
timing.Mark()
for _, e := range entries {
// any returning transaction should be previously fetched
f := m.fetched[e.trxId... | [
0.23628531396389008,
0.0018699191277846694,
0.5148434042930603,
-0.23230382800102234,
-0.31557604670524597,
-0.07802329957485199,
-0.08635018765926361,
0.3656526207923889,
-0.14989741146564484,
0.17871135473251343,
0.0911850780248642,
-0.4597410559654236,
-0.7963796854019165,
-0.1267296075... |
func (m *TrxMgr) CheckBlockTrxs(b *prototype.SignedBlock) (entries []*TrxEntry, err error) {
m.log.Debugf("TRXMGR: CheckBlockTrxs begin %d", b.SignedHeader.Number())
t0 := common.EasyTimer()
if count := len(b.Transactions); count > 0 {
blockTime := b.SignedHeader.Header.Timestamp.UtcSeconds
errs := make([]error,... | [
-0.14618997275829315,
-0.06622827053070068,
0.6937252283096313,
-0.3649701178073883,
-0.18287964165210724,
-1.3280647993087769,
-0.15395310521125793,
-0.2625407576560974,
-0.501305878162384,
0.6773467659950256,
-0.010061049833893776,
-0.0416669100522995,
-0.4074653089046478,
0.613165199756... |
func (m *TrxMgr) BlockApplied(b *prototype.SignedBlock) {
m.log.Debugf("TRXMGR: BlockApplied begin %d", b.SignedHeader.Number())
timing := common.NewTiming()
timing.Begin()
// update head block time
atomic.StoreUint32(&m.headTime, b.SignedHeader.Header.Timestamp.UtcSeconds)
// deliver transactions that are wai... | [
0.2457769811153412,
-0.49703264236450195,
0.8238434791564941,
-0.545803964138031,
-0.4500735104084015,
0.07801179587841034,
0.25863051414489746,
-0.32759910821914673,
-0.048278819769620895,
0.5320615172386169,
-0.12265398353338242,
0.0848047137260437,
-0.012779820710420609,
0.7355073690414... |
func (m *TrxMgr) BlockCommitted(blockNum uint64) {
m.log.Debugf("TRXMGR: BlockCommitted begin %d", blockNum)
t0 := common.EasyTimer()
// plugin notifications
m.callPlugins(func(plugin ITrxMgrPlugin) {
plugin.BlockCommitted(blockNum)
})
m.log.Debugf("TRXMGR: BlockCommitted end %d: %v", blockNum, t0)
} | [
0.706169605255127,
-0.4951492249965668,
0.7084723114967346,
-0.20547707378864288,
0.7312490940093994,
-0.35754522681236267,
0.9597992897033691,
0.1052900180220604,
-0.3036781847476959,
0.8237273693084717,
-0.7247613668441772,
0.38512009382247925,
-0.3472820222377777,
0.6921043395996094,
... |
func (m *TrxMgr) BlockReverted(blockNum uint64) {
m.log.Debugf("TRXMGR: BlockReverted begin %d", blockNum)
t0 := common.EasyTimer()
// plugin notifications
m.callPlugins(func(plugin ITrxMgrPlugin) {
plugin.BlockReverted(blockNum)
})
m.log.Debugf("TRXMGR: BlockReverted end %d: %v", blockNum, t0)
} | [
-0.16377690434455872,
0.1441589891910553,
0.7000454664230347,
-0.15625418722629547,
0.7072016000747681,
-1.0326570272445679,
0.38848525285720825,
0.4204114079475403,
-0.4009730815887451,
-0.2456679791212082,
-1.2561253309249878,
0.7691405415534973,
-0.5367485880851746,
0.2412056177854538,
... |
func (m *TrxMgr) addToWaiting(entries...*TrxEntry) (count int) {
// clean expired waiting trxs if necessary
m.cleanExpiredWaiting()
for _, e := range entries {
// check the max waiting count limit
if len(m.waiting) > sMaxWaitingCount {
_ = e.SetError(errors.New("too many waiting trxs"))
m.deliverEntry(e)
... | [
-0.48490121960639954,
0.6265220046043396,
0.7520080804824829,
-0.05229645594954491,
-0.026200169697403908,
0.20089709758758545,
0.036739617586135864,
0.2739197909832001,
-0.14161048829555511,
0.7376148700714111,
-0.08841531723737717,
-0.48923611640930176,
-0.10826101899147034,
0.5390270352... |
func (m *TrxMgr) isProcessingTrx(trx *prototype.SignedTransaction) *TrxEntry {
m.waitingLock.RLock()
defer m.waitingLock.RUnlock()
m.fetchedLock.RLock()
defer m.fetchedLock.RUnlock()
return m.isProcessingNoLock(trx)
} | [
-0.5853930115699768,
0.5013566017150879,
0.3860604166984558,
-0.15076148509979248,
-0.48563626408576965,
-0.150370255112648,
-0.43461543321609497,
-0.23408864438533783,
0.04106440022587776,
0.4122571051120758,
0.24510587751865387,
-0.0799664855003357,
-0.5651863813400269,
0.499814867973327... |
func (m *TrxMgr) isProcessingNoLock(trx *prototype.SignedTransaction) *TrxEntry {
if trx == nil {
return nil
}
if trxId, err := trx.Id(); err == nil {
s := string(trxId.Hash)
if e := m.waiting[s]; e != nil {
return e
}
return m.fetched[s]
} else {
return nil
}
} | [
0.09538878500461578,
0.6108165979385376,
0.4406561255455017,
-0.36174899339675903,
-0.4888933002948761,
-0.5474100708961487,
-0.44247981905937195,
-0.016232769936323166,
0.1423216313123703,
0.31252631545066833,
0.5788434147834778,
-0.054093558341264725,
-0.40944769978523254,
0.093881659209... |
func (m *TrxMgr) checkTrx(e *TrxEntry, blockTime uint32, checkTapos bool) (err error) {
if err = e.CheckExpiration(blockTime); err != nil {
return err
}
if checkTapos {
if err = e.CheckTapos(m.tapos); err != nil {
return err
}
}
if err = e.CheckSignerKey(m.auth); err != nil {
return err
}
if err = e.C... | [
-0.13655118644237518,
0.40219801664352417,
0.8148791193962097,
0.10371041297912598,
-0.25944894552230835,
0.1825440376996994,
-0.45483481884002686,
0.2939806878566742,
-0.021287448704242706,
1.1624221801757812,
-0.37243086099624634,
-0.1361694037914276,
0.17996209859848022,
0.2690343856811... |
func (m *TrxMgr) deliverEntry(e *TrxEntry) {
go func() {
e.Deliver()
}()
} | [
0.8098164200782776,
-0.16159792244434357,
0.2318616360425949,
-0.6985846161842346,
0.3862387239933014,
0.9074974060058594,
0.2863980531692505,
-0.023859990760684013,
0.17749421298503876,
1.2891584634780884,
-0.04520121589303017,
-0.3222173750400543,
0.5956974625587463,
0.47982901334762573,... |
func (m *TrxMgr) callPlugins(f func(plugin ITrxMgrPlugin)) {
var wg sync.WaitGroup
wg.Add(len(m.plugins))
for i := range m.plugins {
go func(idx int) {
defer wg.Done()
f(m.plugins[idx])
}(i)
}
wg.Wait()
} | [
-0.9052743911743164,
-0.1353778839111328,
0.6293980479240417,
0.32682910561561584,
-0.17094917595386505,
-0.1250741183757782,
-0.45576512813568115,
-0.583398163318634,
-0.2860622704029083,
0.365867018699646,
-0.048266418278217316,
0.381543904542923,
-0.49740245938301086,
-0.448782891035079... |
func (m *TrxMgr) cleanExpiredWaiting() {
// when the waiting pool is small, we don't need cleaning
if len(m.waiting) < sWaitingCountWaterMark {
return
}
// we avoid frequent cleaning
if headBlockTime := atomic.LoadUint32(&m.headTime); headBlockTime > 0 && time.Since(m.lastCleanTime) > sMinCleanupInterval {
m.l... | [
-0.22196759283542633,
-0.3909127414226532,
0.6062456965446472,
0.39706000685691833,
-1.4763299226760864,
0.592060387134552,
-0.26369401812553406,
0.05988585203886032,
-0.6087878346443176,
0.9875938296318054,
0.33216145634651184,
-0.2647620141506195,
-0.46741053462028503,
1.3543903827667236... |
func (m *TrxMgr) shrinkPoolMemories() {
if atomic.LoadUint64(&m.shrinkCounter) > sShrinkCountWaterMark {
atomic.StoreUint64(&m.shrinkCounter, 0)
waiting, fetched := make(map[string]*TrxEntry), make(map[string]*TrxEntry)
for k, e := range m.waiting {
waiting[k] = e
}
for k, e := range m.fetched {
fetch... | [
-0.8209981918334961,
0.5640814304351807,
0.25869008898735046,
-1.146978497505188,
-0.17020276188850403,
0.5877605080604553,
1.1611727476119995,
-0.22401376068592072,
-0.31615617871284485,
-0.05427389219403267,
-0.2135070115327835,
0.9746347069740295,
-0.13352353870868683,
0.343035697937011... |
func ExpectedResourceListFor(expectedISCount int64) kapi.ResourceList {
return kapi.ResourceList{
imageapi.ResourceImageStreams: *resource.NewQuantity(expectedISCount, resource.DecimalSI),
}
} | [
-0.026677973568439484,
0.0801924392580986,
0.15197497606277466,
-0.345645546913147,
-0.7636595368385315,
-0.8153427839279175,
0.04777004197239876,
0.3664075434207916,
1.3815504312515259,
0.02298825792968273,
0.20581446588039398,
-0.5085718631744385,
1.1313906908035278,
0.9206448197364807,
... |
func MakeDockerImageReference(ns, isName, imageID string) string {
return fmt.Sprintf("%s/%s/%s@%s", InternalRegistryURL, ns, isName, imageID)
} | [
-0.8737061023712158,
-0.48193421959877014,
0.31827425956726074,
-1.0199902057647705,
-0.539430558681488,
-0.6061059832572937,
0.11528723686933517,
-0.1600668728351593,
-0.09530194103717804,
0.17447879910469055,
0.5997203588485718,
0.8638263940811157,
0.06329285353422165,
0.900802731513977,... |
func GetFakeImageStreamListHandler(t *testing.T, iss ...imagev1.ImageStream) clientgotesting.ReactionFunc {
sharedISs := []imagev1.ImageStream{*GetSharedImageStream("shared", "is")}
allISs := append(sharedISs, iss...)
return func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) {
switc... | [
-0.11008469015359879,
-0.1399478316307068,
0.6191002130508423,
0.15844370424747467,
-0.24765853583812714,
-0.37058332562446594,
0.4757818281650543,
-0.7487376928329468,
1.4068256616592407,
0.5147939920425415,
-0.7739527225494385,
-0.1923368275165558,
-0.7436807155609131,
1.3066298961639404... |
func GetFakeImageStreamGetHandler(t *testing.T, iss ...imagev1.ImageStream) clientgotesting.ReactionFunc {
sharedISs := []imagev1.ImageStream{*GetSharedImageStream("shared", "is")}
allISs := append(sharedISs, iss...)
return func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) {
switch... | [
-0.13776521384716034,
-0.14192037284374237,
0.7228807210922241,
0.23882125318050385,
-0.1014147624373436,
-0.337143212556839,
0.546381950378418,
-0.7935425639152527,
0.4385383129119873,
0.002233937382698059,
-0.1389845758676529,
0.09608632326126099,
-0.6484223008155823,
0.8513571619987488,... |
func GetSharedImageStream(namespace, name string) *imagev1.ImageStream {
tevList := []imagev1.TagEvent{}
for _, imgName := range []string{
BaseImageWith1LayerDigest,
BaseImageWith2LayersDigest,
ChildImageWith2LayersDigest,
ChildImageWith3LayersDigest,
MiscImageDigest,
} {
tevList = append(tevList,
ima... | [
0.2603090703487396,
-0.04595019668340683,
0.7013261914253235,
0.3655315935611725,
0.31997764110565186,
-0.7186865210533142,
0.5099306702613831,
0.11669186502695084,
0.5084444880485535,
-0.08762088418006897,
-0.6208221316337585,
0.6950187087059021,
-0.12244594097137451,
1.5809239149093628,
... |
func newTask(byteTask []byte, next *task) *task {
return &task{byteTask, next}
} | [
0.7087596654891968,
0.5788319110870361,
0.08824404329061508,
0.6941376328468323,
-0.9011200666427612,
-0.14491061866283417,
-0.4468654990196228,
-0.20488500595092773,
-0.055806953459978104,
-0.2756668031215668,
-1.3977081775665283,
0.8014655113220215,
-0.3071058988571167,
-0.33840024471282... |
func NewQueue() *queue {
q := new(queue)
q.head = new(task)
q.tail = q.head
return q
} | [
0.21194986999034882,
-0.7321232557296753,
0.4724745750427246,
0.5002297759056091,
-0.45533496141433716,
-0.23412592709064484,
-0.3324919044971466,
-0.3736198842525482,
-0.030600041151046753,
-0.8440703749656677,
-0.30390533804893494,
0.7024940252304077,
0.11523383110761642,
0.5367913842201... |
func (q *queue) Enqueue(byteTask []byte) {
var expectTail, expectTailNext *task
newTask := newTask(byteTask, nil)
success := false
for !success {
expectTail = q.tail
expectTailNext = expectTail.next
// If not at the tail then try again
if q.tail != expectTail {
... | [
0.3094280958175659,
0.06433190405368805,
0.6578521728515625,
0.005582644138485193,
0.7072341442108154,
0.048723962157964706,
0.15773706138134003,
-0.36258748173713684,
0.1742040365934372,
0.07076552510261536,
-0.4237729609012604,
0.8765496611595154,
-0.24716266989707947,
1.1150935888290405... |
func (q *queue) Dequeue() []byte {
var dequeued []byte
var expectSentinel, expectRemoved, expectTail *task
success := false
for !success {
expectSentinel = q.head
expectRemoved = expectSentinel.next
expectTail = q.tail
// If not at the head then try again
if q.h... | [
0.31210827827453613,
0.2737003564834595,
0.8176380395889282,
-0.5948764681816101,
-0.43370160460472107,
-0.8365989327430725,
-0.2350013554096222,
-0.1321931928396225,
0.181060329079628,
-0.35458049178123474,
-0.4062710404396057,
0.7748109698295593,
-0.7889512777328491,
0.9555032849311829,
... |
func TestInit(t *testing.T) {
os.RemoveAll(dataDir)
defer os.RemoveAll(dataDir)
protocol.ClearEventHandler()
var err error
q := queue.New("test")
msgCh := initMockBlockchain(q)
p1, p2 := initEnv(t, q)
_ = p1
client := q.Client()
//client用来模拟blockchain模块向p2p模块发消息,host1接收topic为p2pA的消息,host2接收topic为p2pB的消息
//向h... | [
0.37969261407852173,
0.09311503171920776,
1.1674426794052124,
-0.19003036618232727,
0.774839460849762,
0.8263586759567261,
0.865024983882904,
-0.9231138229370117,
-1.1662449836730957,
-0.21415287256240845,
-0.9697011113166809,
0.8890584111213684,
-0.5423922538757324,
0.538546085357666,
0... |
func (a *Asset) IsBuffered() bool {
return isBufferName(a.OutName)
} | [
0.026263142004609108,
-0.38241904973983765,
0.6376616954803467,
-0.27778446674346924,
-0.3385871946811676,
-0.26907461881637573,
0.71275794506073,
-0.6554921269416809,
1.1684165000915527,
-0.04500679671764374,
-0.7788819074630737,
1.2604539394378662,
-0.28081047534942627,
0.799128174781799... |
func Load(filename string) (c *Collection, err error) {
// Load assets description from file (or create a new).
var assets []*Asset
err = utils.UnmarshallYAMLFile(filename, &assets)
if err != nil {
if os.IsNotExist(err) {
// No assets file is not an error,
// create an empty collection.
assets = make([]*... | [
-0.017126884311437607,
-0.1885053813457489,
0.9469553232192993,
-1.1851528882980347,
-0.5206111669540405,
-0.16754186153411865,
0.558438777923584,
-0.0845649242401123,
-0.5597215890884399,
0.411031574010849,
0.104950912296772,
0.27819183468818665,
0.5041314959526062,
0.10696002840995789,
... |
func (c *Collection) Process() error {
for _, a := range c.assets {
if err := c.ProcessAsset(a, c.filters); err != nil {
return err
}
}
return nil
} | [
0.044713765382766724,
0.04229847341775894,
0.584170401096344,
-0.15619927644729614,
0.7795289754867554,
0.43084222078323364,
0.6755384802818298,
-0.748641312122345,
-0.4323810935020447,
0.02546926960349083,
0.6959318518638611,
-0.08994566649198532,
-0.06894440203905106,
0.9378712773323059,... |
func (c *Collection) Get(name string) *Asset {
return c.assets[name]
} | [
-0.3964174687862396,
-1.1050962209701538,
0.22366146743297577,
-1.5473487377166748,
-0.4474048614501953,
0.16186121106147766,
-0.3006981611251831,
-1.3318448066711426,
-0.90793776512146,
0.1423199325799942,
-0.03682748228311539,
1.0324771404266357,
-0.047689273953437805,
-0.646806180477142... |
func NewHelloFS() (fuse.Server, error) {
fs := &helloFS{}
return fuseutil.NewFileSystemServer(fs), nil
} | [
-0.30446532368659973,
-0.326839417219162,
0.2762475907802582,
0.1148696094751358,
-0.4257562458515167,
-0.636448860168457,
-0.5540530681610107,
-0.22482378780841827,
0.08740253746509552,
-1.2524864673614502,
-0.7185845375061035,
0.33033451437950134,
0.08543528616428375,
0.6531624794006348,... |
func (fs *helloFS) ReadDir(ctx context.Context, op *fuseops.ReadDirOp) error {
// Find the info for this inode.
info, ok := gInodeInfo[op.Inode]
if !ok {
return fuse.ENOENT
}
klog.Infof(fmt.Sprintf("[ReadDirOp]Inode: %+v, InodeInfo: %+v", op.Inode, info))
if !info.dir {
return fuse.EIO
}
entries := info.... | [
-0.7355266213417053,
-0.1303919553756714,
0.6360133290290833,
0.3553617298603058,
-0.27955716848373413,
-0.24490278959274292,
0.4739939868450165,
0.2072674185037613,
-0.18905866146087646,
-0.7549266815185547,
0.7052826881408691,
0.27518150210380554,
0.19870515167713165,
-0.2266234308481216... |
func NewOptions(spec Spec) *OptionsProvider {
o := &OptionsProvider{spec, make(map[string]string), make(map[string]bool)}
v := reflect.ValueOf(spec)
if v.CanSet() {
panic(fmt.Sprintf("The spec passed in must be a pointer, got type %v",
v.Type().Name()))
}
v = v.Elem()
specType := v.Type()
for i := 0; i < sp... | [
-0.5015387535095215,
0.06714020669460297,
0.361987441778183,
-0.9385347366333008,
-0.41371339559555054,
-0.46723419427871704,
0.4292442202568054,
-0.3876105844974518,
0.7163780331611633,
1.461704969406128,
-0.053289759904146194,
0.0792018473148346,
-0.12417172640562057,
0.3042619526386261,... |
func (o *OptionsProvider) Options(opts ...Option) *OptionsProvider {
for _, opt := range opts {
optType := reflect.TypeOf(opt)
if _, ok := optType.FieldByName("Value"); !ok {
panic(fmt.Sprintf("Option %v doesn't have a Value field.", optType.Name()))
}
fieldName := o.m[optType.Name()]
field := reflect.Val... | [
-1.0082429647445679,
0.36869001388549805,
0.35505858063697815,
0.3446151316165924,
0.5300713777542114,
-0.1275852769613266,
0.0885709598660469,
-0.22908680140972137,
0.6776692271232605,
0.5775049328804016,
-0.16869762539863586,
-0.1579512059688568,
0.13293948769569397,
-0.3436005711555481,... |
func (o *OptionsProvider) Get() interface{} {
return o.spec
} | [
-0.7829763293266296,
0.29143112897872925,
0.3017745018005371,
-0.4736175537109375,
0.5931706428527832,
-0.02149047888815403,
0.10048782080411911,
-0.5778446197509766,
0.7311919927597046,
0.8930128812789917,
0.20219647884368896,
0.5754410028457642,
-0.055591970682144165,
-0.5421609878540039... |
func (o *OptionsProvider) IsSet(field string) bool {
return o.set[field]
} | [
-1.0909918546676636,
0.31900322437286377,
0.2291547656059265,
-0.4491523504257202,
0.39583703875541687,
0.09356094896793365,
-0.0910707339644432,
-1.083579659461975,
-0.03628825396299362,
1.397091031074524,
0.03316905349493027,
0.14597749710083008,
-0.5080152750015259,
-0.471831351518631,
... |
func (o *OptionsProvider) ExportToMap() map[string]interface{} {
return o.ExportToMapWithTag("")
} | [
-0.5968257784843445,
0.10858697444200516,
0.3343973159790039,
0.5966199636459351,
-0.7386000752449036,
-0.7039626240730286,
-0.44128671288490295,
-0.8352314233779907,
1.9444233179092407,
1.288927674293518,
-0.7964070439338684,
-0.31424427032470703,
0.11580976098775864,
0.5160567760467529,
... |
func (o *OptionsProvider) ExportToMapWithTag(tag string) map[string]interface{} {
spec := reflect.ValueOf(o.spec).Elem()
specType := spec.Type()
m := make(map[string]interface{})
for i := 0; i < specType.NumField(); i++ {
exportedName := specType.Field(i).Name
if !o.IsSet(exportedName) {
continue
}
if ta... | [
-0.23126409947872162,
-0.5233652591705322,
0.7010877132415771,
-0.40045562386512756,
-1.1009379625320435,
-0.6447387933731079,
-0.37201306223869324,
-0.9028462171554565,
0.7721757292747498,
1.3209140300750732,
-0.9573728442192078,
-0.4995543956756592,
0.6081976294517517,
0.8215933442115784... |
func Encrypt(input []byte, key []byte) []byte {
result := make([]byte, len(input))
for i, inputByte := range input {
result[i] = inputByte ^ key[i%len(key)]
}
return result
} | [
-0.36093583703041077,
1.2889093160629272,
0.5141304731369019,
0.7927294373512268,
-0.10818484425544739,
-0.04889031872153282,
-0.695353090763092,
-0.5683023929595947,
-0.3384649455547333,
0.8495028018951416,
-0.5541245341300964,
0.12380894273519516,
-1.6898330450057983,
0.05616281926631927... |
func Single(input []byte, key byte) []byte {
result := make([]byte, len(input))
for i, inputByte := range input {
result[i] = inputByte ^ key
}
return result
} | [
-0.8822945952415466,
0.6578214764595032,
0.48685911297798157,
0.7502326965332031,
-0.14764843881130219,
0.44258636236190796,
-0.717184841632843,
0.6212232708930969,
-0.6243019700050354,
1.0460716485977173,
-0.9639487862586975,
0.3450925648212433,
-1.193903923034668,
0.5603773593902588,
0... |
func NewListNSGroupsParams() *ListNSGroupsParams {
var (
pageSizeDefault = int64(1000)
populateReferencesDefault = bool(false)
)
return &ListNSGroupsParams{
PageSize: &pageSizeDefault,
PopulateReferences: &populateReferencesDefault,
timeout: cr.DefaultTimeout,
}
} | [
-0.09191984683275223,
-0.008380696177482605,
0.1763744056224823,
0.06849540770053864,
-0.02190139703452587,
-0.7259140610694885,
-0.2959166467189789,
-0.74003005027771,
-0.056647732853889465,
-0.009277218021452427,
-0.48271241784095764,
0.37356895208358765,
-0.6993337869644165,
1.102843165... |
func NewListNSGroupsParamsWithTimeout(timeout time.Duration) *ListNSGroupsParams {
var (
pageSizeDefault = int64(1000)
populateReferencesDefault = bool(false)
)
return &ListNSGroupsParams{
PageSize: &pageSizeDefault,
PopulateReferences: &populateReferencesDefault,
timeout: timeout,
}
... | [
0.4364870488643646,
-0.08264251053333282,
0.1314888596534729,
0.07612670958042145,
-0.37375038862228394,
-0.03895340487360954,
-0.9826780557632446,
-0.8890240788459778,
0.2620723843574524,
0.6442616581916809,
-0.3080829679965973,
0.6135358214378357,
-0.7874091267585754,
1.1908454895019531,... |
func NewListNSGroupsParamsWithContext(ctx context.Context) *ListNSGroupsParams {
var (
pageSizeDefault = int64(1000)
populateReferencesDefault = bool(false)
)
return &ListNSGroupsParams{
PageSize: &pageSizeDefault,
PopulateReferences: &populateReferencesDefault,
Context: ctx,
}
} | [
0.12809257209300995,
-0.09874597191810608,
0.3610350489616394,
-0.15988051891326904,
-0.12090267986059189,
0.10552866756916046,
-0.9508802890777588,
-1.306200385093689,
0.6944778561592102,
-0.04793834686279297,
-0.05244061350822449,
0.3923625946044922,
-0.7095075249671936,
0.66735875606536... |
func NewListNSGroupsParamsWithHTTPClient(client *http.Client) *ListNSGroupsParams {
var (
pageSizeDefault = int64(1000)
populateReferencesDefault = bool(false)
)
return &ListNSGroupsParams{
PageSize: &pageSizeDefault,
PopulateReferences: &populateReferencesDefault,
HTTPClient: c... | [
0.09550920873880386,
-0.25651296973228455,
0.3455410301685333,
-0.01584288291633129,
-0.1744835376739502,
-0.06396383047103882,
-0.3360632658004761,
-0.7804906964302063,
-0.3024286925792694,
-0.1486196368932724,
-0.39591720700263977,
0.40416550636291504,
-0.8942034244537354,
0.385373771190... |
func (o *ListNSGroupsParams) WithTimeout(timeout time.Duration) *ListNSGroupsParams {
o.SetTimeout(timeout)
return o
} | [
0.016545867547392845,
0.6728862524032593,
0.02832951582968235,
-0.042419325560331345,
-0.4857819080352783,
-0.29622548818588257,
-0.9712826609611511,
-0.9589357376098633,
0.5112232565879822,
0.5551475882530212,
-0.32263752818107605,
0.349405974149704,
-0.02659621834754944,
0.90557634830474... |
func (o *ListNSGroupsParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
} | [
-0.07038640975952148,
0.7361959218978882,
0.11259450018405914,
0.0412546843290329,
-0.055850327014923096,
0.18656544387340546,
-0.8978457450866699,
-0.5513114333152771,
0.027997851371765137,
0.2100239396095276,
-0.5328267812728882,
0.6689844131469727,
-0.4895358681678772,
0.997041463851928... |
func (o *ListNSGroupsParams) WithContext(ctx context.Context) *ListNSGroupsParams {
o.SetContext(ctx)
return o
} | [
-0.5804553031921387,
0.7037011981010437,
0.25651365518569946,
-0.13448917865753174,
-0.34566837549209595,
-0.42213717103004456,
-1.0631660223007202,
-1.2719682455062866,
0.7249189615249634,
-0.12150926887989044,
-0.2085426151752472,
0.26312047243118286,
-0.7066937685012817,
0.4841153621673... |
func (o *ListNSGroupsParams) SetContext(ctx context.Context) {
o.Context = ctx
} | [
-0.5297306180000305,
0.8257477283477783,
0.2766297459602356,
0.23283948004245758,
0.08776088058948517,
-0.1383642554283142,
-0.91845703125,
-1.147924542427063,
0.728257417678833,
-0.3732582926750183,
-0.5244675278663635,
0.5266402363777161,
-1.0137215852737427,
0.5710105895996094,
-1.142... |
func (o *ListNSGroupsParams) WithHTTPClient(client *http.Client) *ListNSGroupsParams {
o.SetHTTPClient(client)
return o
} | [
-0.24883797764778137,
0.12424173206090927,
0.24933446943759918,
-0.2284366637468338,
-0.42064446210861206,
-0.4111400842666626,
-0.1532670557498932,
-1.2701036930084229,
-0.13585704565048218,
-0.3620641529560089,
-0.15042850375175476,
0.03749678656458855,
-0.09454979747533798,
0.1390553414... |
func (o *ListNSGroupsParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
} | [
0.03614535182714462,
0.3003997802734375,
0.20681387186050415,
-0.6065460443496704,
-0.34804943203926086,
-0.36760568618774414,
-0.14868922531604767,
-1.1623814105987549,
-0.737677812576294,
-0.3646758496761322,
-0.6314564347267151,
0.7027777433395386,
-0.8111028671264648,
0.051504120230674... |
func (o *ListNSGroupsParams) WithCursor(cursor *string) *ListNSGroupsParams {
o.SetCursor(cursor)
return o
} | [
-0.21564829349517822,
0.03104930743575096,
-0.0463787242770195,
0.22116297483444214,
-0.8677441477775574,
-0.39840415120124817,
-0.38230568170547485,
-0.9497070908546448,
0.1096060574054718,
-0.22710232436656952,
0.31478866934776306,
-0.4163338541984558,
-0.05609750747680664,
1.16621840000... |
func (o *ListNSGroupsParams) SetCursor(cursor *string) {
o.Cursor = cursor
} | [
-0.44332626461982727,
-0.037400998175144196,
0.05869597569108009,
0.3765760362148285,
-0.6473599076271057,
-0.21965906023979187,
-0.32696667313575745,
-0.48503056168556213,
-0.10605475306510925,
-0.4347013533115387,
-0.052402906119823456,
0.21986757218837738,
-0.9198221564292908,
1.6006705... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.