text
string
func populateStatusFromStatusInfoAndErr(agent *params.DetailedStatus, statusInfo status.StatusInfo, err error) { agent.Err = common.ServerError(err) agent.Status = statusInfo.Status.String() agent.Info = statusInfo.Message agent.Data = filterStatusData(statusInfo.Data) agent.Since = statusInfo.Since }
func (c *dumpCommand) SetFlags(f *gnuflag.FlagSet) { c.ModelCommandBase.SetFlags(f) c.out.AddFlags(f, "yaml", output.DefaultFormatters) f.BoolVar(&c.simplified, "simplified", false, "Dump a simplified partial model") }
func (w *Wrapper) PrintStatus(status status.Status) { w.PrintColor(statusColors[status], status) }
func (d *digest) Reset() { d.h[0] = init0 d.h[1] = init1 d.h[2] = init2 d.h[3] = init3 d.h[4] = init4 d.h[5] = init5 d.h[6] = init6 d.h[7] = init7 d.nx = 0 d.len = 0 }
func (d *digest) checkSum() (digest [Size]byte) { n := d.nx var k [64]byte copy(k[:], d.x[:n]) k[n] = 0x80 if n >= 56 { block(d, k[:]) // clear block buffer - go compiles this to optimal 1x xorps + 4x movups // unfortunately expressing this more succinctly results in much worse code k[0] = 0 k[1] = 0...
func (p *createCollectionOptionsInternal) fromExternal(i *CreateCollectionOptions) { p.JournalSize = i.JournalSize p.ReplicationFactor = replicationFactor(i.ReplicationFactor) p.WaitForSync = i.WaitForSync p.DoCompact = i.DoCompact p.IsVolatile = i.IsVolatile p.ShardKeys = i.ShardKeys p.NumberOfShards = i.Number...
func (t *ImmutableTree) GetRangeWithProof(startKey []byte, endKey []byte, limit int) (keys, values [][]byte, proof *RangeProof, err error) { proof, keys, values, err = t.getRangeProof(startKey, endKey, limit) return }
func (b *Box) Resize(size image.Point) { b.size = size inner := b.size if b.border { inner = b.size.Sub(image.Point{2, 2}) } b.layoutChildren(inner) }
func (g *Grid) Resize(size image.Point) { g.size = size inner := g.size if g.hasBorder { inner.X = g.size.X - (g.cols + 1) inner.Y = g.size.Y - (g.rows + 1) } g.layoutChildren(inner) }
func (g *Grid) SetColumnStretch(col, stretch int) { g.columnStretch[col] = stretch }
func (l *List) RemoveItems() { l.items = []string{} l.pos = 0 l.selected = -1 if l.onSelectionChanged != nil { l.onSelectionChanged(l) } }
func (p *Config) UpdateSecrets(cert *tls.Certificate, caPool *x509.CertPool, s secrets.Secrets, certPEM, keyPEM string) { p.Lock() defer p.Unlock() p.cert = cert p.ca = caPool p.secrets = s p.certPEM = certPEM p.keyPEM = keyPEM p.tlsClientConfig.RootCAs = caPool }
func (p *PUContext) UpdateCachedTokenAndServiceContext(token []byte, serviceContext []byte) { p.Lock() p.synToken = token p.synExpiration = time.Now().Add(time.Millisecond * 500) p.synServiceContext = serviceContext p.Unlock() }
func (l *LinuxMonitor) SetupHandlers(m *config.ProcessorConfig) { l.proc.config = m }
func NewFilterQueue(queueSeparation bool, MarkValue int, QueueStart, NumberOfNetworkQueues, NumberOfApplicationQueues uint16, NetworkQueueSize, ApplicationQueueSize uint32) *FilterQueue { fq := &FilterQueue{ QueueSeparation: queueSeparation, MarkValue: MarkValue, NetworkQueueSize: NetworkQue...
func (p *PUPolicy) UpdateServiceCertificates(cert, key string) { p.Lock() defer p.Unlock() p.servicesCertificate = cert p.servicesPrivateKey = key }
func (b *StringBuilder) Grow(n int) { b.copyCheck() if n < 0 { panic("strings.Builder.Grow: negative count") } if cap(b.buf)-len(b.buf) < n { b.grow(n) } }
func AddLink(link *Link, obj ModelObj) { link.ObjType = obj.GetType() link.ObjKey = obj.GetKey() }
func (w *Writer) ResetDict(dst io.Writer, dict []byte) { w.dict = dict w.d.reset(dst) w.d.fillWindow(w.dict) }
func (b *bitWriter) reset(out []byte) { b.bitContainer = 0 b.nBits = 0 b.out = out }
func (s *fseDecoder) setRLE(symbol decSymbol) { s.actualTableLog = 0 s.maxBits = 0 s.dt[0] = symbol }
func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) { s.dt = dt br.fill() s.state = dt[br.getBits(tableLog)] }
func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int) { s.maxCount = maxCount s.symbolLen = uint16(maxSymbol) + 1 s.clearCount = maxCount != 0 }
func DrawElementsInstanced(mode uint32, count int32, xtype uint32, indices unsafe.Pointer, instancecount int32) { C.glowDrawElementsInstanced(gpDrawElementsInstanced, (C.GLenum)(mode), (C.GLsizei)(count), (C.GLenum)(xtype), indices, (C.GLsizei)(instancecount)) }
func TransformFeedbackVaryings(program uint32, count int32, varyings **uint8, bufferMode uint32) { C.glowTransformFeedbackVaryings(gpTransformFeedbackVaryings, (C.GLuint)(program), (C.GLsizei)(count), (**C.GLchar)(unsafe.Pointer(varyings)), (C.GLenum)(bufferMode)) }
func InitWithProcAddrFunc(getProcAddr func(name string) unsafe.Pointer) error { gpAccum = (C.GPACCUM)(getProcAddr("glAccum")) gpActiveProgramEXT = (C.GPACTIVEPROGRAMEXT)(getProcAddr("glActiveProgramEXT")) gpActiveShaderProgram = (C.GPACTIVESHADERPROGRAM)(getProcAddr("glActiveShaderProgram")) gpActiveShaderProgramEX...
func (c *ContentObj) AppendStreamCurve(x0 float64, y0 float64, x1 float64, y1 float64, x2 float64, y2 float64, x3 float64, y3 float64, style string) { var cache cacheContentCurve cache.pageHeight = c.getRoot().curr.pageSize.H cache.x0 = x0 cache.y0 = y0 cache.x1 = x1 cache.y1 = y1 cache.x2 = x2 cache.y2 = y2 c...
func (gp *GoPdf) init() { //default gp.margins = Margins{ Left: defaultMargin, Top: defaultMargin, Right: defaultMargin, Bottom: defaultMargin, } //init curr gp.resetCurrXY() gp.curr.IndexOfPageObj = -1 gp.curr.CountOfFont = 0 gp.curr.CountOfL = 0 gp.curr.CountOfImg = 0 //img gp.curr.ImgCaches...
func (d *Digest) Reset() { d.v1 = prime1v + prime2 d.v2 = prime2 d.v3 = 0 d.v4 = -prime1v d.total = 0 d.n = 0 }
func (t *Tango) Get(url string, c interface{}, middlewares ...Handler) { t.Route([]string{"GET", "HEAD:Get"}, url, c, middlewares...) }
func (t *Tango) Any(url string, c interface{}, middlewares ...Handler) { t.Route(SupportMethods, url, c, middlewares...) t.Route([]string{"HEAD:Get"}, url, c, middlewares...) }
func (g *Group) Get(url string, c interface{}, middlewares ...Handler) { g.Route([]string{"GET", "HEAD:Get"}, url, c, middlewares...) }
func (g *Group) Any(url string, c interface{}, middlewares ...Handler) { g.Route(SupportMethods, url, c, middlewares...) g.Route([]string{"HEAD:Get"}, url, c, middlewares...) }
func NewBox(width, height int, flags int) *Box { width, height = GetXY(width, height) box := new(Box) box.Buf = new(bytes.Buffer) box.Width = width box.Height = height box.Border = DEFAULT_BORDER box.PaddingX = 1 box.PaddingY = 0 box.Flags = flags return box }
func (z *Weather) Msgsize() (s int) { s = 1 + 5 + msgp.TimeSize + 5 + msgp.Int64Size + 5 + msgp.StringPrefixSize + len(z.Type) + 8 + msgp.BytesPrefixSize + len(z.Details) return }
func NewZlispWithFuncs(funcs map[string]ZlispUserFunction) *Zlisp { env := new(Zlisp) env.baseTypeCtor = MakeUserFunction("__basetype_ctor", BaseTypeConstructorFunction) env.parser = env.NewParser() env.parser.Start() env.datastack = env.NewStack(DataStackSize) env.linearstack = env.NewStack(ScopeStackSize) glo...
func (a *Authenticator) SetAuthInfo(clientID, secretKey string) { a.config.ClientID = clientID a.config.ClientSecret = secretKey }
func (ctx *VmContext) SetNetworkEnvironment(net *api.SandboxConfig) { ctx.lock.Lock() defer ctx.lock.Unlock() ctx.networks.SandboxConfig = net }
func NewPhraseQuery(terms ...string) *PhraseQuery { q := &PhraseQuery{newFtsQueryBase()} q.options["terms"] = terms return q }
func setDefaults() { formats = defaultFormats() tests = defaultTests() codecs = defaultCodecs() paths = defaultPaths() globs = []string{"*.txt", "*.bin"} levels = []int{1, 6, 9} sizes = []int{1e4, 1e5, 1e6} }
func EnableInfinityTs(negative time.Time, positive time.Time) { if infinityTsEnabled { panic(infinityTsEnabledAlready) } if !negative.Before(positive) { panic(infinityTsNegativeMustBeSmaller) } infinityTsEnabled = true infinityTsNegative = negative infinityTsPositive = positive }
func (mat *T) TransformVec4(v *vec4.T) { // Use intermediate variables to not alter further computations. x := mat[0][0]*v[0] + mat[1][0]*v[1] + mat[2][0]*v[2] + mat[3][0]*v[3] y := mat[0][1]*v[0] + mat[1][1]*v[1] + mat[2][1]*v[2] + mat[3][1]*v[3] z := mat[0][2]*v[0] + mat[1][2]*v[1] + mat[2][2]*v[2] + mat[3][2]*v[...
func (mat *T) AssignPerspectiveProjection(left, right, bottom, top, znear, zfar float32) *T { near2 := znear + znear ooFarNear := 1 / (zfar - znear) mat[0][0] = near2 / (right - left) mat[1][0] = 0 mat[2][0] = (right + left) / (right - left) mat[3][0] = 0 mat[0][1] = 0 mat[1][1] = near2 / (top - bottom) mat[...
func (mat *T) AssignOrthogonalProjection(left, right, bottom, top, znear, zfar float32) *T { ooRightLeft := 1 / (right - left) ooTopBottom := 1 / (top - bottom) ooFarNear := 1 / (zfar - znear) mat[0][0] = 2 * ooRightLeft mat[1][0] = 0 mat[2][0] = 0 mat[3][0] = -(right + left) * ooRightLeft mat[0][1] = 0 mat[...
func (mat *T) AssignZRotation(angle float64) *T { cosine := math.Cos(angle) sine := math.Sin(angle) mat[0][0] = cosine mat[1][0] = -sine mat[2][0] = 0 mat[3][0] = 0 mat[0][1] = sine mat[1][1] = cosine mat[2][1] = 0 mat[3][1] = 0 mat[0][2] = 0 mat[1][2] = 0 mat[2][2] = 1 mat[3][2] = 0 mat[0][3] = 0 m...
func Cfmakeraw(attr *syscall.Termios) { attr.Iflag &^= syscall.BRKINT | syscall.ICRNL | syscall.INPCK | syscall.ISTRIP | syscall.IXON attr.Oflag &^= syscall.OPOST attr.Cflag &^= syscall.CSIZE | syscall.PARENB attr.Cflag |= syscall.CS8 attr.Lflag &^= syscall.ECHO | syscall.ICANON | syscall.IEXTEN | syscall.ISIG at...
func (s *scanner) init(buf string) { s.buf = buf s.pos = 0 s.start = 0 s.width = 0 s.accept = nil }
func (fs *statFS) SetStatResponse(r fuseops.InodeAttributes) { fs.mu.Lock() defer fs.mu.Unlock() fs.cannedStatResponse = r }
func (t *Tag) Append(b ...Body) { t.Body = append(t.Body, b...) }
func SplitPath(filePath string) (dir string, base string, ext string) { dir = filepath.Dir(filePath) ext = filepath.Ext(filePath) base = filepath.Base(filePath) base = base[:len(base)-len(ext)] return dir, base, ext }
func (mmap MarshalMap) Value(key string) (val interface{}, exists bool) { exists = mmap.resolvePath(key, mmap, func(p, k reflect.Value, v interface{}) { val = v }) return val, exists }
func (buffer *BufferedReader) Reset(sequence uint64) { buffer.end = 0 buffer.incomplete = true }
func (met *Metrics) Add(name string, value int64) { atomic.AddInt64(met.get(name), value) }
func (p *ProcMetrics) Collect() { if m, err := CollectProcInfo(p.pid); err == nil { now := time.Now() if !p.lastTime.IsZero() { ratio := 1.0 switch { case m.CPU.Period > 0 && m.CPU.Quota > 0: ratio = float64(m.CPU.Quota) / float64(m.CPU.Period) case m.CPU.Shares > 0: ratio = float64(m.CPU.Shar...
func (c *Client) HandleMeasures(time time.Time, measures ...stats.Measure) { c.buffer.HandleMeasures(time, measures...) }
func (h *HyperLogLogPlus) Clear() { h.sparse = true h.tmpSet = set{} h.sparseList = newCompressedList(int(h.m)) h.reg = nil }
func (l *lexer) emitError(msg string) { l.tokens <- Token{ Type: ItemError, Text: l.input[l.start:l.pos], ErrorMessage: fmt.Sprintf("[lexer:%d:%d] %s", l.line, l.col, msg), } l.start = l.pos }
func (m *Matrix) Identity() *Matrix { m.Val[m00] = 1 m.Val[m10] = 0 m.Val[m20] = 0 m.Val[m01] = 0 m.Val[m11] = 1 m.Val[m21] = 0 m.Val[m02] = 0 m.Val[m12] = 0 m.Val[m22] = 1 return m }
func (m *Matrix) Translate(x, y float32) *Matrix { m.tmp[m00] = 1 m.tmp[m10] = 0 m.tmp[m20] = 0 m.tmp[m01] = 0 m.tmp[m11] = 1 m.tmp[m21] = 0 m.tmp[m02] = x m.tmp[m12] = y m.tmp[m22] = 1 multiplyMatricies(m.Val[:], m.tmp[:]) return m }
func (m *Matrix) RotateRad(rad float32) *Matrix { if rad == 0 { return m } sin, cos := math.Sincos(rad) m.tmp[m00] = cos m.tmp[m10] = sin m.tmp[m20] = 0 m.tmp[m01] = -sin m.tmp[m11] = cos m.tmp[m21] = 0 m.tmp[m02] = 0 m.tmp[m12] = 0 m.tmp[m22] = 1 multiplyMatricies(m.Val[:], m.tmp[:]) return m }
func CreateWindow(title string, width, height int, fullscreen bool, msaa int) { CurrentBackEnd = BackEndMobile gameWidth = float32(width) gameHeight = float32(height) msaaPreference = msaa }
func RunPreparation(defaultScene Scene) { windowWidth = float32(opts.MobileWidth) canvasWidth = float32(opts.MobileWidth) windowHeight = float32(opts.MobileHeight) canvasHeight = float32(opts.MobileHeight) ResizeXOffset = gameWidth - canvasWidth ResizeYOffset = gameHeight - canvasHeight Gl.Viewport(0, 0, opts.M...
func (ac *AnimationComponent) SelectAnimationByName(name string) { ac.CurrentAnimation = ac.Animations[name] ac.index = 0 }
func (ac *AnimationComponent) SelectAnimationByAction(action *Animation) { ac.CurrentAnimation = action ac.index = 0 }
func (ac *AnimationComponent) AddAnimation(action *Animation) { ac.Animations[action.Name] = action }
func CreateWindow(title string, width, height int, fullscreen bool, msaa int) { CurrentBackEnd = BackEndHeadless gameWidth = float32(width) gameHeight = float32(height) Gl = gl.NewContext() windowWidth, windowHeight = float32(width), float32(height) canvasWidth, canvasHeight = float32(width), float32(height) }
func (sc SpaceComponent) Corners() (points [4]engo.Point) { points[0].X = sc.Position.X points[0].Y = sc.Position.Y sin, cos := math.Sincos(sc.Rotation * math.Pi / 180) points[1].X = points[0].X + sc.Width*cos points[1].Y = points[0].Y + sc.Width*sin points[2].X = points[0].X - sc.Height*sin points[2].Y = poi...
func (s *TableStyle) setUtfBoxStyle() { s.BorderX = "─" s.BorderY = "│" s.BorderI = "┼" s.BorderTop = "┬" s.BorderBottom = "┴" s.BorderLeft = "├" s.BorderRight = "┤" s.BorderTopLeft = "╭" s.BorderTopRight = "╮" s.BorderBottomLeft = "╰" s.BorderBottomRight = "╯" }
func (g *Gauge) Sample(sample float64, sampleRate float32) { g.value = sample }
func (t *Trace) SetParent(parent *Trace) { t.ParentID = parent.SpanID t.TraceID = parent.TraceID t.Resource = parent.Resource }
func (xpath *XPath) SetContextPosition(position, size int) { xpath.ContextPtr.proximityPosition = C.int(position) xpath.ContextPtr.contextSize = C.int(size) }
func FeCMove(f, g *FieldElement, b int32) { b = -b f[0] ^= b & (f[0] ^ g[0]) f[1] ^= b & (f[1] ^ g[1]) f[2] ^= b & (f[2] ^ g[2]) f[3] ^= b & (f[3] ^ g[3]) f[4] ^= b & (f[4] ^ g[4]) f[5] ^= b & (f[5] ^ g[5]) f[6] ^= b & (f[6] ^ g[6]) f[7] ^= b & (f[7] ^ g[7]) f[8] ^= b & (f[8] ^ g[8]) f[9] ^= b & (f[9] ^ g[9]...
func FeNeg(h, f *FieldElement) { h[0] = -f[0] h[1] = -f[1] h[2] = -f[2] h[3] = -f[3] h[4] = -f[4] h[5] = -f[5] h[6] = -f[6] h[7] = -f[7] h[8] = -f[8] h[9] = -f[9] }
func (c *Cache) Delete(key string) { key = keyToFilename(key) c.d.Erase(key) }
func AdminRoot(w http.ResponseWriter, r *http.Request) { io.WriteString(w, "Gritter\n======\n\nSuper secret admin page!\n") }
func (c *Context) init(response http.ResponseWriter, request *http.Request) { c.Response = response c.Request = request c.data = nil c.index = -1 c.writer = DefaultDataWriter }
func (g *Generator) SetHostname(s string) { g.initConfig() g.Config.Hostname = s }
func (g *Generator) AddAnnotation(key, value string) { g.initConfigAnnotations() g.Config.Annotations[key] = value }
func (g *Generator) SetProcessConsoleSize(width, height uint) { g.initConfigProcessConsoleSize() g.Config.Process.ConsoleSize.Width = width g.Config.Process.ConsoleSize.Height = height }
func (g *Generator) SetLinuxResourcesPidsLimit(limit int64) { g.initConfigLinuxResourcesPids() g.Config.Linux.Resources.Pids.Limit = limit }
func (g *Generator) AddLinuxSysctl(key, value string) { g.initConfigLinuxSysctl() g.Config.Linux.Sysctl[key] = value }
func getReady(name string, wg *sync.WaitGroup) { defer wg.Done() fmt.Printf("%s started getting ready\n", name) // the time it takes to get ready is at least 60 seconds, plus a random number up to 90 seconds sec := rand.Intn(30) + 60 // this is where they get ready time.Sleep(time.Duration(sec) * time.Second) fm...
func (lib *Lib) initConstants() { lib.GSS_C_NO_BUFFER = &Buffer{ Lib: lib, // C_gss_buffer_t: C.GSS_C_NO_BUFFER, already nil // alloc: allocNone, already 0 } lib.GSS_C_NO_OID = lib.NewOID() lib.GSS_C_NO_OID_SET = lib.NewOIDSet() lib.GSS_C_NO_CONTEXT = lib.NewCtxId() lib.GSS_C_NO_CREDENTIAL = lib.NewCredId()...
func (c *Client) SetTimeout(t time.Duration) { if t <= 0 { c.timeout = defaultTimeout } c.timeout = t }
func (c *Client) SetRetries(count int) { if count < 1 { c.retries = defaultRetries } c.retries = count }
func New() locales.Translator { return &tr_TR{ locale: "tr_TR", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &fr_LU{ locale: "fr_LU", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{2, 6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &ca_IT{ locale: "ca_IT", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6}, pluralsRange: []locales.PluralRule{6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &es_CO{ locale: "es_CO", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &ml_IN{ locale: "ml_IN", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ".", group: ",", minus: ...
func New() locales.Translator { return &sl_SI{ locale: "sl_SI", pluralsCardinal: []locales.PluralRule{2, 3, 4, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{3, 4, 6}, decimal: ",", group: ".", minus...
func New() locales.Translator { return &gl{ locale: "gl", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &fr_CA{ locale: "fr_CA", pluralsCardinal: []locales.PluralRule{2, 6}, pluralsOrdinal: []locales.PluralRule{2, 6}, pluralsRange: []locales.PluralRule{2, 6}, decimal: ",", group: " ", minus: ...
func New() locales.Translator { return &sl{ locale: "sl", pluralsCardinal: []locales.PluralRule{2, 3, 4, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: []locales.PluralRule{3, 4, 6}, decimal: ",", group: ".", minus: ...
func New() locales.Translator { return &gd{ locale: "gd", pluralsCardinal: []locales.PluralRule{2, 3, 4, 6}, pluralsOrdinal: nil, pluralsRange: nil, decimal: ".", group: ",", minus: "-", percent: "%...
func New() locales.Translator { return &dsb{ locale: "dsb", pluralsCardinal: []locales.PluralRule{2, 3, 4, 6}, pluralsOrdinal: []locales.PluralRule{6}, pluralsRange: nil, decimal: ",", group: ".", minus: "-", perc...
func (p *parser) parseExpr(expr interface{}) (interface{}, bool) { p.ExprCnt++ if p.ExprCnt > p.maxExprCnt { panic(errMaxExprCnt) } var val interface{} var ok bool switch expr := expr.(type) { case *actionExpr: val, ok = p.parseActionExpr(expr) case *andCodeExpr: val, ok = p.parseAndCodeExpr(expr) case...
func (s *Scanner) Init(filename string, r io.Reader, errh func(ast.Pos, error)) { s.r = runeReader(r) s.errh = errh s.eof = false s.cpos = ast.Pos{ Filename: filename, Line: 1, } s.cur, s.cw = -1, 0 s.tok.Reset() }
func (pdu *codec) setup(f pdufield.Map, t pdutlv.Map) { pdu.f, pdu.t = f, t }
func (o *option) Reset() { o.isLong = false o.count = 0 o.value.Set(o.defval, o) }