text
string
func (m *Message) SetTrackingClicks(trackingClicks bool) { m.trackingClicks = trackingClicks m.trackingClicksSet = true }
func (c *Conn) LockSession(id string) { c.object.Call(dbusInterface+".LockSession", 0, id) }
func (s *StableBloomFilter) StablePoint() float64 { var ( subDenom = float64(s.p) * (1/float64(s.k) - 1/float64(s.m)) denom = 1 + 1/subDenom base = 1 / denom ) return math.Pow(base, float64(s.max)) }
func (dec *Decoder) Decode(v interface{}) error { if dec.isPooled == 1 { panic(InvalidUsagePooledDecoderError("Invalid usage of pooled decoder")) } var err error switch vt := v.(type) { case *string: err = dec.decodeString(vt) case **string: err = dec.decodeStringNull(vt) case *int: err = dec.decodeInt(vt) case **int: err = dec.decodeIntNull(vt) case *int8: err = dec.decodeInt8(vt) case **int8: err = dec.decodeInt8Null(vt) case *int16: err = dec.decodeInt16(vt) case **int16: err = dec.decodeInt16Null(vt) case *int32: err = dec.decodeInt32(vt) case **int32: err = dec.decodeInt32Null(vt) case *int64: err = dec.decodeInt64(vt) case **int64: err = dec.decodeInt64Null(vt) case *uint8: err = dec.decodeUint8(vt) case **uint8: err = dec.decodeUint8Null(vt) case *uint16: err = dec.decodeUint16(vt) case **uint16: err = dec.decodeUint16Null(vt) case *uint32: err = dec.decodeUint32(vt) case **uint32: err = dec.decodeUint32Null(vt) case *uint64: err = dec.decodeUint64(vt) case **uint64: err = dec.decodeUint64Null(vt) case *float64: err = dec.decodeFloat64(vt) case **float64: err = dec.decodeFloat64Null(vt) case *float32: err = dec.decodeFloat32(vt) case **float32: err = dec.decodeFloat32Null(vt) case *bool: err = dec.decodeBool(vt) case **bool: err = dec.decodeBoolNull(vt) case UnmarshalerJSONObject: _, err = dec.decodeObject(vt) case UnmarshalerJSONArray: _, err = dec.decodeArray(vt) case *EmbeddedJSON: err = dec.decodeEmbeddedJSON(vt) case *interface{}: err = dec.decodeInterface(vt) default: return InvalidUnmarshalError(fmt.Sprintf(invalidUnmarshalErrorMsg, vt)) } if err != nil { return err } return dec.err }
func (cli *Client) SetCredentials(userID, accessToken string) { cli.AccessToken = accessToken cli.UserID = userID }
func (xc *CommonExchange) setLastFail(t time.Time) { xc.mtx.Lock() defer xc.mtx.Unlock() xc.lastFail = t }
func (set *zoomSet) Snip(length int) { set.Height = set.Height.snip(length) set.Time = set.Time.snip(length) set.PoolSize = set.PoolSize.snip(length) set.PoolValue = set.PoolValue.snip(length) set.BlockSize = set.BlockSize.snip(length) set.TxCount = set.TxCount.snip(length) set.NewAtoms = set.NewAtoms.snip(length) set.Chainwork = set.Chainwork.snip(length) set.Fees = set.Fees.snip(length) }
func (set *windowSet) Snip(length int) { set.Time = set.Time.snip(length) set.PowDiff = set.PowDiff.snip(length) set.TicketPrice = set.TicketPrice.snip(length) }
func (d *AddressCacheItem) SetRows(block BlockID, rows []dbtypes.AddressRowCompact) { d.mtx.Lock() defer d.mtx.Unlock() d.setBlock(block) d.rows = rows }
func (s *Status) SetHeight(height uint32) { s.Lock() defer s.Unlock() s.ready = height == s.dbHeight s.height = height }
func (s *Status) SetHeightAndConnections(height uint32, conns int64) { s.Lock() defer s.Unlock() s.nodeConnections = conns s.ready = height == s.dbHeight s.height = height }
func (s *Status) DBUpdate(height uint32, blockTime int64) { s.Lock() defer s.Unlock() s.dbHeight = height s.dbLastBlockTime = blockTime s.ready = s.dbHeight == height }
func UpdateTicketPoolData(interval dbtypes.TimeBasedGrouping, timeGraph *dbtypes.PoolTicketsData, priceGraph *dbtypes.PoolTicketsData, donutcharts *dbtypes.PoolTicketsData, height int64) { ticketPoolGraphsCache.Lock() defer ticketPoolGraphsCache.Unlock() ticketPoolGraphsCache.Height[interval] = height ticketPoolGraphsCache.TimeGraphCache[interval] = timeGraph ticketPoolGraphsCache.PriceGraphCache[interval] = priceGraph ticketPoolGraphsCache.DonutGraphCache[interval] = donutcharts }
func (g *BlockGate) SetFetchToHeight(height int64) { g.mtx.RLock() defer g.mtx.RUnlock() g.fetchToHeight = height }
func (c *MempoolDataCache) StoreMPData(stakeData *StakeData, txsCopy []exptypes.MempoolTx, _ *exptypes.MempoolInfo) { c.mtx.Lock() defer c.mtx.Unlock() c.height = uint32(stakeData.LatestBlock.Height) c.hash = stakeData.LatestBlock.Hash.String() c.timestamp = stakeData.Time c.txns = txsCopy c.numTickets = stakeData.NumTickets c.ticketFeeInfo = stakeData.Ticketfees.FeeInfoMempool c.allFees = stakeData.MinableFees.allFees c.allFeeRates = stakeData.MinableFees.allFeeRates c.lowestMineableByFeeRate = stakeData.MinableFees.lowestMineableFee c.allTicketsDetails = stakeData.AllTicketsDetails c.stakeDiff = stakeData.StakeDiff }
func (w *BatchedFileWriter) init() { w.totalSize = 0 w.currentMultiPart = 0 w.completedParts = []*s3.CompletedPart{} w.activeBuffer = newS3ByteBuffer() w.createMultipartUpload() }
func (prod *ElasticSearch) Configure(conf core.PluginConfigReader) { prod.connection.servers = conf.GetStringArray("Servers", []string{"http://127.0.0.1:9200"}) prod.connection.user = conf.GetString("User", "") prod.connection.password = conf.GetString("Password", "") prod.connection.setGzip = conf.GetBool("SetGzip", false) prod.connection.isConnectedStatus = false prod.configureIndexSettings(conf.GetMap("StreamProperties", tcontainer.NewMarshalMap()), conf.Errors) prod.configureRetrySettings(conf.GetInt("Retry/Count", 3), conf.GetInt("Retry/TimeToWaitSec", 3)) }
func (router *RoundRobin) Configure(conf core.PluginConfigReader) { router.index = 0 router.indexByStream = make(map[core.MessageStreamID]*int32) router.mapInitLock = new(sync.Mutex) }
func (prod *File) Configure(conf core.PluginConfigReader) { prod.Pruner.Logger = prod.Logger prod.SetRollCallback(prod.rotateLog) prod.SetStopCallback(prod.close) prod.filesByStream = make(map[core.MessageStreamID]*components.BatchedWriterAssembly) prod.files = make(map[string]*components.BatchedWriterAssembly) logFile := conf.GetString("File", "/var/log/gollum.log") prod.wildcardPath = strings.IndexByte(logFile, '*') != -1 prod.fileDir = filepath.Dir(logFile) prod.fileExt = filepath.Ext(logFile) prod.fileName = filepath.Base(logFile) prod.fileName = prod.fileName[:len(prod.fileName)-len(prod.fileExt)] prod.batchedFileGuard = new(sync.RWMutex) }
func (prod *File) Produce(workers *sync.WaitGroup) { prod.AddMainWorker(workers) prod.TickerMessageControlLoop(prod.writeMessage, prod.BatchConfig.BatchTimeout, prod.writeBatchOnTimeOut) }
func (prod *AwsFirehose) Produce(workers *sync.WaitGroup) { defer prod.WorkerDone() prod.AddMainWorker(workers) prod.initFirehoseClient() prod.BatchMessageLoop(workers, prod.sendBatch) }
func (prod *Spooling) Produce(workers *sync.WaitGroup) { prod.AddMainWorker(workers) prod.spoolCheck = time.AfterFunc(prod.respoolDuration, prod.openExistingFiles) prod.TickerMessageControlLoop(prod.writeToFile, prod.batchTimeout, prod.writeBatchOnTimeOut) }
func (cons *LogConsumer) Configure(conf PluginConfigReader) { cons.control = make(chan PluginControl, 1) cons.logRouter = StreamRegistry.GetRouter(LogInternalStreamID) cons.metric = conf.GetString("MetricKey", "") cons.queue = NewMessageQueue(1024) if cons.metric != "" { cons.metricsRegistry = NewMetricsRegistry(cons.metric) cons.metricErrors = metrics.NewCounter() cons.metricWarning = metrics.NewCounter() cons.metricInfo = metrics.NewCounter() cons.metricDebug = metrics.NewCounter() cons.metricsRegistry.Register("errors", cons.metricErrors) cons.metricsRegistry.Register("warnings", cons.metricWarning) cons.metricsRegistry.Register("info", cons.metricInfo) cons.metricsRegistry.Register("debug", cons.metricDebug) } }
func (meta Metadata) SetValue(key string, value []byte) { meta[key] = value }
func (prod *AwsS3) Produce(workers *sync.WaitGroup) { prod.initS3Client() prod.AddMainWorker(workers) prod.TickerMessageControlLoop(prod.writeMessage, prod.BatchConfig.BatchTimeout, prod.writeBatchOnTimeOut) }
func (p *Policy) addDefaultElementsWithoutAttrs() { p.init() p.setOfElementsAllowedWithoutAttrs["abbr"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["acronym"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["address"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["article"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["aside"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["audio"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["b"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["bdi"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["blockquote"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["body"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["br"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["button"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["canvas"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["caption"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["center"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["cite"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["code"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["col"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["colgroup"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["datalist"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["dd"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["del"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["details"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["dfn"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["div"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["dl"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["dt"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["em"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["fieldset"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["figcaption"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["figure"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["footer"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h1"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h2"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h3"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h4"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h5"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["h6"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["head"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["header"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["hgroup"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["hr"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["html"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["i"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["ins"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["kbd"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["li"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["mark"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["marquee"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["nav"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["ol"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["optgroup"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["option"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["p"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["pre"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["q"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["rp"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["rt"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["ruby"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["s"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["samp"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["script"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["section"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["select"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["small"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["span"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["strike"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["strong"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["style"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["sub"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["summary"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["sup"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["svg"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["table"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["tbody"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["td"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["textarea"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["tfoot"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["th"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["thead"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["title"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["time"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["tr"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["tt"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["u"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["ul"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["var"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["video"] = struct{}{} p.setOfElementsAllowedWithoutAttrs["wbr"] = struct{}{} }
func (p *Policy) addDefaultSkipElementContent() { p.init() p.setOfElementsToSkipContent["frame"] = struct{}{} p.setOfElementsToSkipContent["frameset"] = struct{}{} p.setOfElementsToSkipContent["iframe"] = struct{}{} p.setOfElementsToSkipContent["noembed"] = struct{}{} p.setOfElementsToSkipContent["noframes"] = struct{}{} p.setOfElementsToSkipContent["noscript"] = struct{}{} p.setOfElementsToSkipContent["nostyle"] = struct{}{} p.setOfElementsToSkipContent["object"] = struct{}{} p.setOfElementsToSkipContent["script"] = struct{}{} p.setOfElementsToSkipContent["style"] = struct{}{} p.setOfElementsToSkipContent["title"] = struct{}{} }
func (d *jsonDecDriver) readLit4True() { bs := d.r.readx(3) d.tok = 0 if jsonValidateSymbols && !bytes.Equal(bs, jsonLiteral4True) { d.d.errorf("expecting %s: got %s", jsonLiteral4True, bs) } }
func (h *EssentialHeader) Copy(h2 *EssentialHeader) { h.AgreementPartyUInfo = h2.AgreementPartyUInfo h.AgreementPartyVInfo = h2.AgreementPartyVInfo h.Algorithm = h2.Algorithm h.ContentEncryption = h2.ContentEncryption h.ContentType = h2.ContentType h.Compression = h2.Compression h.Critical = h2.Critical h.EphemeralPublicKey = h2.EphemeralPublicKey h.Jwk = h2.Jwk h.JwkSetURL = h2.JwkSetURL h.KeyID = h2.KeyID h.Type = h2.Type h.X509Url = h2.X509Url h.X509CertChain = h2.X509CertChain h.X509CertThumbprint = h2.X509CertThumbprint h.X509CertThumbprintS256 = h2.X509CertThumbprintS256 }
func (client *flclient_t) connect(endpoint string) { client.socket.Connect(endpoint) client.servers++ }
func (t *Template) backup2(t1 item) { t.token[1] = t1 t.peekCount = 2 }
func (s *Set) Delims(left, right string) { s.leftDelim = left s.rightDelim = right }
func (z *runContainer16) Msgsize() (s int) { s = 1 + 3 + msgp.ArrayHeaderSize + (len(z.iv) * (12 + msgp.Uint16Size + msgp.Uint16Size)) + 5 + msgp.Int64Size return }
func (r *Range) Fixed(min, max, delta float64) { r.MinMode.Fixed, r.MaxMode.Fixed = true, true r.MinMode.Value, r.MaxMode.Value = min, max r.TicSetting.Delta = delta }
func (r *Range) Reset() { r.Min, r.Max = 0, 0 r.TMin, r.TMax = time.Time{}, time.Time{} r.Tics = nil r.Norm, r.InvNorm = nil, nil r.Data2Screen, r.Screen2Data = nil, nil if !r.TicSetting.UserDelta { r.TicSetting.Delta = 0 r.TicSetting.TDelta = nil } }
func autoscale() { dumper := NewDumper("xautoscale", 2, 2, 600, 400) defer dumper.Close() N := 200 points := make([]chart.EPoint, N) for i := 0; i < N-1; i++ { points[i].X = rand.Float64()*10000 - 5000 // Full range is [-5000:5000] points[i].Y = rand.Float64()*10000 - 5000 // Full range is [-5000:5000] points[i].DeltaX = rand.Float64() * 400 points[i].DeltaY = rand.Float64() * 400 } points[N-1].X = -650 points[N-1].Y = -2150 points[N-1].DeltaX = 400 points[N-1].DeltaY = 400 points[N-1].OffX = 100 points[N-1].OffY = -150 s := chart.ScatterChart{Title: "Full Autoscaling"} s.Key.Hide = true s.XRange.TicSetting.Mirror = 1 s.YRange.TicSetting.Mirror = 1 s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: 'o', SymbolColor: color.NRGBA{0x00, 0xee, 0x00, 0xff}}) dumper.Plot(&s) s = chart.ScatterChart{Title: "Xmin: -1850, Xmax clipped to [500:900]"} s.Key.Hide = true s.XRange.TicSetting.Mirror = 1 s.YRange.TicSetting.Mirror = 1 s.XRange.MinMode.Fixed, s.XRange.MinMode.Value = true, -1850 s.XRange.MaxMode.Constrained = true s.XRange.MaxMode.Lower, s.XRange.MaxMode.Upper = 500, 900 s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0xee, 0x00, 0x00, 0xff}}) dumper.Plot(&s) s = chart.ScatterChart{Title: "Xmin: -1850, Ymax clipped to [9000:11000]"} s.Key.Hide = true s.XRange.TicSetting.Mirror = 1 s.YRange.TicSetting.Mirror = 1 s.XRange.MinMode.Fixed, s.XRange.MinMode.Value = true, -1850 s.YRange.MaxMode.Constrained = true s.YRange.MaxMode.Lower, s.YRange.MaxMode.Upper = 9000, 11000 s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0x00, 0x00, 0xee, 0xff}}) dumper.Plot(&s) s = chart.ScatterChart{Title: "Tiny fraction"} s.Key.Hide = true s.XRange.TicSetting.Mirror = 1 s.YRange.TicSetting.Mirror = 1 s.YRange.MinMode.Constrained = true s.YRange.MinMode.Lower, s.YRange.MinMode.Upper = -2250, -2050 s.YRange.MaxMode.Constrained = true s.YRange.MaxMode.Lower, s.YRange.MaxMode.Upper = -1950, -1700 s.XRange.MinMode.Constrained = true s.XRange.MinMode.Lower, s.XRange.MinMode.Upper = -900, -800 s.XRange.MaxMode.Constrained = true s.XRange.MaxMode.Lower, s.XRange.MaxMode.Upper = -850, -650 s.AddData("Data", points, chart.PlotStylePoints, chart.Style{Symbol: '0', SymbolColor: color.NRGBA{0xee, 0xcc, 0x00, 0xff}}) dumper.Plot(&s) }
func categoricalBarChart() { dumper := NewDumper("xbar2", 3, 2, 400, 300) defer dumper.Close() x := []float64{0, 1, 2, 3} europe := []float64{10, 15, 25, 20} asia := []float64{15, 30, 10, 20} africa := []float64{20, 5, 5, 5} blue := chart.Style{Symbol: '#', LineColor: color.NRGBA{0x00, 0x00, 0xff, 0xff}, LineWidth: 4, FillColor: color.NRGBA{0x40, 0x40, 0xff, 0xff}} green := chart.Style{Symbol: 'x', LineColor: color.NRGBA{0x00, 0xaa, 0x00, 0xff}, LineWidth: 4, FillColor: color.NRGBA{0x40, 0xff, 0x40, 0xff}} pink := chart.Style{Symbol: '0', LineColor: color.NRGBA{0x99, 0x00, 0x99, 0xff}, LineWidth: 4, FillColor: color.NRGBA{0xaa, 0x60, 0xaa, 0xff}} red := chart.Style{Symbol: '%', LineColor: color.NRGBA{0xcc, 0x00, 0x00, 0xff}, LineWidth: 4, FillColor: color.NRGBA{0xff, 0x40, 0x40, 0xff}} // Categorized Bar Chart c := chart.BarChart{Title: "Income"} c.XRange.Category = []string{"none", "low", "average", "high"} // Unstacked, different labelings c.ShowVal = 1 c.AddDataPair("Europe", x, europe, blue) dumper.Plot(&c) c.ShowVal = 2 c.AddDataPair("Asia", x, asia, pink) dumper.Plot(&c) c.ShowVal = 3 c.AddDataPair("Africa", x, africa, green) dumper.Plot(&c) // Stacked with different labelings c.Stacked = true c.ShowVal = 1 dumper.Plot(&c) c.ShowVal = 2 dumper.Plot(&c) c.ShowVal = 3 dumper.Plot(&c) // Including negative ones dumper2 := NewDumper("xbar3", 3, 2, 400, 300) defer dumper2.Close() c = chart.BarChart{Title: "Income"} c.XRange.Category = []string{"none", "low", "average", "high"} c.Key.Hide = true c.YRange.ShowZero = true c.ShowVal = 3 c.AddDataPair("Europe", x, []float64{-10, -15, -20, -5}, blue) dumper2.Plot(&c) c.AddDataPair("Asia", x, []float64{-15, -10, -5, -20}, pink) dumper2.Plot(&c) c.Stacked = true dumper2.Plot(&c) // Mixed c = chart.BarChart{Title: "Income"} c.XRange.Category = []string{"none", "low", "average", "high"} c.Key.Hide = true c.YRange.ShowZero = true c.ShowVal = 3 c.AddDataPair("Europe", x, []float64{-10, 15, -20, 5}, blue) dumper2.Plot(&c) c.AddDataPair("Asia", x, []float64{-15, 10, -5, 20}, pink) dumper2.Plot(&c) c.Stacked = true dumper2.Plot(&c) // Very Mixed c = chart.BarChart{Title: "Income"} c.XRange.Category = []string{"none", "low", "average", "high"} c.Key.Hide = true c.YRange.ShowZero = true c.ShowVal = 3 c.AddDataPair("Europe", x, []float64{-10, 15, -20, 5}, blue) c.AddDataPair("Asia", x, []float64{-15, 10, 5, 20}, pink) c.AddDataPair("Africa", x, []float64{10, -10, 15, -5}, green) dumper2.Plot(&c) c.Stacked = true dumper2.Plot(&c) c.AddDataPair("America", x, []float64{15, -5, -10, -20}, red) c.YRange.TicSetting.Delta = 0 dumper2.Plot(&c) }
func Get(region string) (frequencyPlan FrequencyPlan, err error) { if fp, ok := frequencyPlans[region]; ok { return fp, nil } switch region { case pb_lorawan.FrequencyPlan_EU_863_870.String(): frequencyPlan.Band, err = lora.GetConfig(lora.EU_863_870, false, lorawan.DwellTimeNoLimit) // TTN frequency plan includes extra channels next to the default channels: frequencyPlan.UplinkChannels = []lora.Channel{ lora.Channel{Frequency: 868100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 868300000, DataRates: []int{0, 1, 2, 3, 4, 5, 6}}, // Also SF7BW250 lora.Channel{Frequency: 868500000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 867100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 867300000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 867500000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 867700000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 867900000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 868800000, DataRates: []int{7}}, // FSK 50kbps } frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels frequencyPlan.CFList = &lorawan.CFList{867100000, 867300000, 867500000, 867700000, 867900000} frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 3} frequencyPlan.RX2DataRate = viper.GetInt("eu-rx2-dr") case pb_lorawan.FrequencyPlan_US_902_928.String(): frequencyPlan.Band, err = lora.GetConfig(lora.US_902_928, false, lorawan.DwellTime400ms) fsb := viper.GetInt("us-fsb") // If this is 1, enables 903.9-905.3/200 kHz, 904.6/500kHz channels, etc. for channel := 0; channel < 72; channel++ { if (channel < fsb*8 || channel >= (fsb+1)*8) && channel != fsb+64 { frequencyPlan.DisableUplinkChannel(channel) } } frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 3, MinTXPower: 10, MaxTXPower: 20, StepTXPower: 2} case pb_lorawan.FrequencyPlan_CN_779_787.String(): frequencyPlan.Band, err = lora.GetConfig(lora.CN_779_787, false, lorawan.DwellTimeNoLimit) case pb_lorawan.FrequencyPlan_EU_433.String(): frequencyPlan.Band, err = lora.GetConfig(lora.EU_433, false, lorawan.DwellTimeNoLimit) case pb_lorawan.FrequencyPlan_AU_915_928.String(): frequencyPlan.Band, err = lora.GetConfig(lora.AU_915_928, false, lorawan.DwellTime400ms) fsb := viper.GetInt("au-fsb") // If this is 1, enables 916.8-918.2/200 kHz, 917.5/500kHz channels, etc. for channel := 0; channel < 72; channel++ { if (channel < fsb*8 || channel >= (fsb+1)*8) && channel != fsb+64 { frequencyPlan.DisableUplinkChannel(channel) } } frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 10, MaxTXPower: 20, StepTXPower: 2} case pb_lorawan.FrequencyPlan_CN_470_510.String(): frequencyPlan.Band, err = lora.GetConfig(lora.CN_470_510, false, lorawan.DwellTimeNoLimit) case pb_lorawan.FrequencyPlan_AS_923.String(): frequencyPlan.Band, err = lora.GetConfig(lora.AS_923, false, lorawan.DwellTime400ms) frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 2} case pb_lorawan.FrequencyPlan_AS_920_923.String(): frequencyPlan.Band, err = lora.GetConfig(lora.AS_923, false, lorawan.DwellTime400ms) frequencyPlan.UplinkChannels = []lora.Channel{ lora.Channel{Frequency: 923200000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923400000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922200000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922400000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922600000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922800000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923000000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922000000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922100000, DataRates: []int{6}}, lora.Channel{Frequency: 921800000, DataRates: []int{7}}, } frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels frequencyPlan.CFList = &lorawan.CFList{922200000, 922400000, 922600000, 922800000, 923000000} frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 2} case pb_lorawan.FrequencyPlan_AS_923_925.String(): frequencyPlan.Band, err = lora.GetConfig(lora.AS_923, false, lorawan.DwellTime400ms) frequencyPlan.UplinkChannels = []lora.Channel{ lora.Channel{Frequency: 923200000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923400000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923600000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923800000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 924000000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 924200000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 924400000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 924600000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 924500000, DataRates: []int{6}}, lora.Channel{Frequency: 924800000, DataRates: []int{7}}, } frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels frequencyPlan.CFList = &lorawan.CFList{923600000, 923800000, 924000000, 924200000, 924400000} frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 2} case pb_lorawan.FrequencyPlan_KR_920_923.String(): frequencyPlan.Band, err = lora.GetConfig(lora.KR_920_923, false, lorawan.DwellTimeNoLimit) // TTN frequency plan includes extra channels next to the default channels: frequencyPlan.UplinkChannels = []lora.Channel{ lora.Channel{Frequency: 922100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922300000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922500000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922700000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 922900000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 923300000, DataRates: []int{0, 1, 2, 3, 4, 5}}, } frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels frequencyPlan.CFList = &lorawan.CFList{922700000, 922900000, 923100000, 923300000, 0} frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 2} case pb_lorawan.FrequencyPlan_IN_865_867.String(): frequencyPlan.Band, err = lora.GetConfig(lora.IN_865_867, false, lorawan.DwellTimeNoLimit) case pb_lorawan.FrequencyPlan_RU_864_870.String(): frequencyPlan.Band, err = lora.GetConfig(lora.RU_864_870, false, lorawan.DwellTimeNoLimit) // Here channels from recommended list for Russia are set which are used by LoRaWAN networks in Russia // Recommended frequency plan includes extra channels next to the default channels: frequencyPlan.UplinkChannels = []lora.Channel{ lora.Channel{Frequency: 868900000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 869100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 864100000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 864300000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 864500000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 864700000, DataRates: []int{0, 1, 2, 3, 4, 5}}, lora.Channel{Frequency: 864900000, DataRates: []int{0, 1, 2, 3, 4, 5}}, } frequencyPlan.DownlinkChannels = frequencyPlan.UplinkChannels frequencyPlan.CFList = &lorawan.CFList{864100000, 864300000, 864500000, 864700000, 864900000} frequencyPlan.ADR = &ADRConfig{MinDataRate: 0, MaxDataRate: 5, MinTXPower: 2, MaxTXPower: 14, StepTXPower: 3} default: err = errors.NewErrInvalidArgument("Frequency Band", "unknown") } return }
func (d *Device) FromPb(in *pb_handler.Device) { d.AppID = in.AppID d.DevID = in.DevID d.Description = in.Description d.Latitude = in.Latitude d.Longitude = in.Longitude d.Altitude = in.Altitude d.Attributes = in.Attributes d.FromLoRaWANPb(in.GetLoRaWANDevice()) }
func newClient(apiurl string, apikey string, secret string, async bool, verifyssl bool) *CloudStackClient { jar, _ := cookiejar.New(nil) cs := &CloudStackClient{ client: &http.Client{ Jar: jar, Transport: &http.Transport{ Proxy: http.ProxyFromEnvironment, DialContext: (&net.Dialer{ Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, DualStack: true, }).DialContext, MaxIdleConns: 100, IdleConnTimeout: 90 * time.Second, TLSClientConfig: &tls.Config{InsecureSkipVerify: !verifyssl}, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, }, Timeout: time.Duration(60 * time.Second), }, baseURL: apiurl, apiKey: apikey, secret: secret, async: async, options: []OptionFunc{}, timeout: 300, } cs.APIDiscovery = NewAPIDiscoveryService(cs) cs.Account = NewAccountService(cs) cs.Address = NewAddressService(cs) cs.AffinityGroup = NewAffinityGroupService(cs) cs.Alert = NewAlertService(cs) cs.Asyncjob = NewAsyncjobService(cs) cs.Authentication = NewAuthenticationService(cs) cs.AutoScale = NewAutoScaleService(cs) cs.Baremetal = NewBaremetalService(cs) cs.BigSwitchBCF = NewBigSwitchBCFService(cs) cs.BrocadeVCS = NewBrocadeVCSService(cs) cs.Certificate = NewCertificateService(cs) cs.CloudIdentifier = NewCloudIdentifierService(cs) cs.Cluster = NewClusterService(cs) cs.Configuration = NewConfigurationService(cs) cs.Custom = NewCustomService(cs) cs.DiskOffering = NewDiskOfferingService(cs) cs.Domain = NewDomainService(cs) cs.Event = NewEventService(cs) cs.Firewall = NewFirewallService(cs) cs.GuestOS = NewGuestOSService(cs) cs.Host = NewHostService(cs) cs.Hypervisor = NewHypervisorService(cs) cs.ISO = NewISOService(cs) cs.ImageStore = NewImageStoreService(cs) cs.InternalLB = NewInternalLBService(cs) cs.LDAP = NewLDAPService(cs) cs.Limit = NewLimitService(cs) cs.LoadBalancer = NewLoadBalancerService(cs) cs.NAT = NewNATService(cs) cs.NetworkACL = NewNetworkACLService(cs) cs.NetworkDevice = NewNetworkDeviceService(cs) cs.NetworkOffering = NewNetworkOfferingService(cs) cs.Network = NewNetworkService(cs) cs.Nic = NewNicService(cs) cs.NiciraNVP = NewNiciraNVPService(cs) cs.NuageVSP = NewNuageVSPService(cs) cs.OutofbandManagement = NewOutofbandManagementService(cs) cs.OvsElement = NewOvsElementService(cs) cs.Pod = NewPodService(cs) cs.Pool = NewPoolService(cs) cs.PortableIP = NewPortableIPService(cs) cs.Project = NewProjectService(cs) cs.Quota = NewQuotaService(cs) cs.Region = NewRegionService(cs) cs.Resourcemetadata = NewResourcemetadataService(cs) cs.Resourcetags = NewResourcetagsService(cs) cs.Role = NewRoleService(cs) cs.Router = NewRouterService(cs) cs.SSH = NewSSHService(cs) cs.SecurityGroup = NewSecurityGroupService(cs) cs.ServiceOffering = NewServiceOfferingService(cs) cs.Snapshot = NewSnapshotService(cs) cs.StoragePool = NewStoragePoolService(cs) cs.StratosphereSSP = NewStratosphereSSPService(cs) cs.Swift = NewSwiftService(cs) cs.SystemCapacity = NewSystemCapacityService(cs) cs.SystemVM = NewSystemVMService(cs) cs.Template = NewTemplateService(cs) cs.UCS = NewUCSService(cs) cs.Usage = NewUsageService(cs) cs.User = NewUserService(cs) cs.VLAN = NewVLANService(cs) cs.VMGroup = NewVMGroupService(cs) cs.VPC = NewVPCService(cs) cs.VPN = NewVPNService(cs) cs.VirtualMachine = NewVirtualMachineService(cs) cs.Volume = NewVolumeService(cs) cs.Zone = NewZoneService(cs) return cs }
func (m *msg) setVersion(v int) { m.LiVnMode = (m.LiVnMode & 0xc7) | uint8(v)<<3 }
func (m *msg) setMode(md mode) { m.LiVnMode = (m.LiVnMode & 0xf8) | uint8(md) }
func (root *RootDevice) SetURLBase(urlBase *url.URL) { root.URLBase = *urlBase root.URLBaseStr = urlBase.String() root.Device.SetURLBase(urlBase) }
func (t *Tree) backup2(t1 item) { t.token[1] = t1 t.peekCount = 2 }
func (k *Key) SetValue(v string) { if k.s.f.BlockMode { k.s.f.lock.Lock() defer k.s.f.lock.Unlock() } k.value = v k.s.keysHash[k.name] = v }
func (sw syslogWriter) WriteLevel(level Level, p []byte) (n int, err error) { switch level { case DebugLevel: err = sw.w.Debug(string(p)) case InfoLevel: err = sw.w.Info(string(p)) case WarnLevel: err = sw.w.Warning(string(p)) case ErrorLevel: err = sw.w.Err(string(p)) case FatalLevel: err = sw.w.Emerg(string(p)) case PanicLevel: err = sw.w.Crit(string(p)) case NoLevel: err = sw.w.Info(string(p)) default: panic("invalid level") } n = len(p) return }
func (tr *Matrix) Compose(trToCompose Matrix) { tr0, tr1, tr2, tr3, tr4, tr5 := tr[0], tr[1], tr[2], tr[3], tr[4], tr[5] tr[0] = trToCompose[0]*tr0 + trToCompose[1]*tr2 tr[1] = trToCompose[1]*tr3 + trToCompose[0]*tr1 tr[2] = trToCompose[2]*tr0 + trToCompose[3]*tr2 tr[3] = trToCompose[3]*tr3 + trToCompose[2]*tr1 tr[4] = trToCompose[4]*tr0 + trToCompose[5]*tr2 + tr4 tr[5] = trToCompose[5]*tr3 + trToCompose[4]*tr1 + tr5 }
func (tr *Matrix) Translate(tx, ty float64) { tr[4] = tx*tr[0] + ty*tr[2] + tr[4] tr[5] = ty*tr[3] + tx*tr[1] + tr[5] }
func (vr *vectorRenderer) SetDPI(dpi float64) { vr.dpi = dpi vr.c.dpi = dpi }
func (vr *vectorRenderer) Close() { vr.p = append(vr.p, fmt.Sprintf("Z")) }
func (s Style) InheritFrom(defaults Style) (final Style) { final.ClassName = s.GetClassName(defaults.ClassName) final.StrokeColor = s.GetStrokeColor(defaults.StrokeColor) final.StrokeWidth = s.GetStrokeWidth(defaults.StrokeWidth) final.StrokeDashArray = s.GetStrokeDashArray(defaults.StrokeDashArray) final.DotColor = s.GetDotColor(defaults.DotColor) final.DotWidth = s.GetDotWidth(defaults.DotWidth) final.DotWidthProvider = s.DotWidthProvider final.DotColorProvider = s.DotColorProvider final.FillColor = s.GetFillColor(defaults.FillColor) final.FontColor = s.GetFontColor(defaults.FontColor) final.FontSize = s.GetFontSize(defaults.FontSize) final.Font = s.GetFont(defaults.Font) final.Padding = s.GetPadding(defaults.Padding) final.TextHorizontalAlign = s.GetTextHorizontalAlign(defaults.TextHorizontalAlign) final.TextVerticalAlign = s.GetTextVerticalAlign(defaults.TextVerticalAlign) final.TextWrap = s.GetTextWrap(defaults.TextWrap) final.TextLineSpacing = s.GetTextLineSpacing(defaults.TextLineSpacing) final.TextRotationDegrees = s.GetTextRotationDegrees(defaults.TextRotationDegrees) return }
func (gc *StackGraphicContext) ArcTo(cx, cy, rx, ry, startAngle, delta float64) { gc.current.Path.ArcTo(cx, cy, rx, ry, startAngle, delta) }
func (gc *StackGraphicContext) Save() { context := new(ContextStack) context.FontSizePoints = gc.current.FontSizePoints context.Font = gc.current.Font context.LineWidth = gc.current.LineWidth context.StrokeColor = gc.current.StrokeColor context.FillColor = gc.current.FillColor context.FillRule = gc.current.FillRule context.Dash = gc.current.Dash context.DashOffset = gc.current.DashOffset context.Cap = gc.current.Cap context.Join = gc.current.Join context.Path = gc.current.Path.Copy() context.Font = gc.current.Font context.Scale = gc.current.Scale copy(context.Tr[:], gc.current.Tr[:]) context.Previous = gc.current gc.current = context }
func (b *Buffer) Clear() { b.array = make([]float64, bufferDefaultCapacity) b.head = 0 b.tail = 0 b.size = 0 }
func (l *Legacy) Set(status bool, interval int) { l.Force = true l.Interval = time.Duration(interval) * time.Second }
func (a *API) Init(key string, backends *stripe.Backends) { if backends == nil { backends = &stripe.Backends{ API: stripe.GetBackend(stripe.APIBackend), Uploads: stripe.GetBackend(stripe.UploadsBackend), } } a.Account = &account.Client{B: backends.API, Key: key} a.ApplePayDomains = &applepaydomain.Client{B: backends.API, Key: key} a.Balance = &balance.Client{B: backends.API, Key: key} a.BankAccounts = &bankaccount.Client{B: backends.API, Key: key} a.BitcoinReceivers = &bitcoinreceiver.Client{B: backends.API, Key: key} a.BitcoinTransactions = &bitcointransaction.Client{B: backends.API, Key: key} a.Cards = &card.Client{B: backends.API, Key: key} a.Charges = &charge.Client{B: backends.API, Key: key} a.CheckoutSessions = &checkoutsession.Client{B: backends.API, Key: key} a.CountrySpec = &countryspec.Client{B: backends.API, Key: key} a.Coupons = &coupon.Client{B: backends.API, Key: key} a.CreditNotes = &creditnote.Client{B: backends.API, Key: key} a.Customers = &customer.Client{B: backends.API, Key: key} a.Discounts = &discount.Client{B: backends.API, Key: key} a.Disputes = &dispute.Client{B: backends.API, Key: key} a.EphemeralKeys = &ephemeralkey.Client{B: backends.API, Key: key} a.ExchangeRates = &exchangerate.Client{B: backends.API, Key: key} a.Events = &event.Client{B: backends.API, Key: key} a.Fees = &fee.Client{B: backends.API, Key: key} a.FeeRefunds = &feerefund.Client{B: backends.API, Key: key} a.Files = &file.Client{B: backends.Uploads, Key: key} a.FileLinks = &filelink.Client{B: backends.API, Key: key} a.Invoices = &invoice.Client{B: backends.API, Key: key} a.InvoiceItems = &invoiceitem.Client{B: backends.API, Key: key} a.IssuerFraudRecords = &issuerfraudrecord.Client{B: backends.API, Key: key} a.IssuingAuthorizations = &authorization.Client{B: backends.API, Key: key} a.IssuingCardholders = &cardholder.Client{B: backends.API, Key: key} a.IssuingCards = &issuingcard.Client{B: backends.API, Key: key} a.IssuingDisputes = &issuingdispute.Client{B: backends.API, Key: key} a.IssuingTransactions = &transaction.Client{B: backends.API, Key: key} a.LoginLinks = &loginlink.Client{B: backends.API, Key: key} a.Orders = &order.Client{B: backends.API, Key: key} a.OrderReturns = &orderreturn.Client{B: backends.API, Key: key} a.PaymentIntents = &paymentintent.Client{B: backends.API, Key: key} a.PaymentSource = &paymentsource.Client{B: backends.API, Key: key} a.Payouts = &payout.Client{B: backends.API, Key: key} a.Plans = &plan.Client{B: backends.API, Key: key} a.Products = &product.Client{B: backends.API, Key: key} a.RadarValueLists = &valuelist.Client{B: backends.API, Key: key} a.RadarValueListItems = &valuelistitem.Client{B: backends.API, Key: key} a.Recipients = &recipient.Client{B: backends.API, Key: key} a.Refunds = &refund.Client{B: backends.API, Key: key} a.ReportRuns = &reportrun.Client{B: backends.API, Key: key} a.ReportTypes = &reporttype.Client{B: backends.API, Key: key} a.Reversals = &reversal.Client{B: backends.API, Key: key} a.SigmaScheduledQueryRuns = &scheduledqueryrun.Client{B: backends.API, Key: key} a.Skus = &sku.Client{B: backends.API, Key: key} a.Sources = &source.Client{B: backends.API, Key: key} a.SourceTransactions = &sourcetransaction.Client{B: backends.API, Key: key} a.Subscriptions = &sub.Client{B: backends.API, Key: key} a.SubscriptionItems = &subitem.Client{B: backends.API, Key: key} a.SubscriptionSchedules = &subschedule.Client{B: backends.API, Key: key} a.SubscriptionScheduleRevisions = &subschedulerevision.Client{B: backends.API, Key: key} a.TaxIDs = &taxid.Client{B: backends.API, Key: key} a.TaxRates = &taxrate.Client{B: backends.API, Key: key} a.TerminalConnectionTokens = &terminalconnectiontoken.Client{B: backends.API, Key: key} a.TerminalLocations = &terminallocation.Client{B: backends.API, Key: key} a.TerminalReaders = &terminalreader.Client{B: backends.API, Key: key} a.Tokens = &token.Client{B: backends.API, Key: key} a.Topups = &topup.Client{B: backends.API, Key: key} a.Transfers = &transfer.Client{B: backends.API, Key: key} a.UsageRecords = &usagerecord.Client{B: backends.API, Key: key} a.UsageRecordSummaries = &usagerecordsummary.Client{B: backends.API, Key: key} a.WebhookEndpoints = &webhookendpoint.Client{B: backends.API, Key: key} }
func (v *Assistant) SetPageType(page IWidget, t AssistantPageType) { C.gtk_assistant_set_page_type(ASSISTANT(v), ToNative(page), C.GtkAssistantPageType(t)) }
func (v *Range) SetAdjustment(a *Adjustment) { C.gtk_range_set_adjustment(RANGE(v), a.GAdjustment) }
func (attrs *attributes) Add(attrType asn1.ObjectIdentifier, value interface{}) { attrs.types = append(attrs.types, attrType) attrs.values = append(attrs.values, value) }
func sm2P256Mul(c, a, b *sm2P256FieldElement) { var tmp sm2P256LargeFieldElement tmp[0] = uint64(a[0]) * uint64(b[0]) tmp[1] = uint64(a[0])*(uint64(b[1])<<0) + uint64(a[1])*(uint64(b[0])<<0) tmp[2] = uint64(a[0])*(uint64(b[2])<<0) + uint64(a[1])*(uint64(b[1])<<1) + uint64(a[2])*(uint64(b[0])<<0) tmp[3] = uint64(a[0])*(uint64(b[3])<<0) + uint64(a[1])*(uint64(b[2])<<0) + uint64(a[2])*(uint64(b[1])<<0) + uint64(a[3])*(uint64(b[0])<<0) tmp[4] = uint64(a[0])*(uint64(b[4])<<0) + uint64(a[1])*(uint64(b[3])<<1) + uint64(a[2])*(uint64(b[2])<<0) + uint64(a[3])*(uint64(b[1])<<1) + uint64(a[4])*(uint64(b[0])<<0) tmp[5] = uint64(a[0])*(uint64(b[5])<<0) + uint64(a[1])*(uint64(b[4])<<0) + uint64(a[2])*(uint64(b[3])<<0) + uint64(a[3])*(uint64(b[2])<<0) + uint64(a[4])*(uint64(b[1])<<0) + uint64(a[5])*(uint64(b[0])<<0) tmp[6] = uint64(a[0])*(uint64(b[6])<<0) + uint64(a[1])*(uint64(b[5])<<1) + uint64(a[2])*(uint64(b[4])<<0) + uint64(a[3])*(uint64(b[3])<<1) + uint64(a[4])*(uint64(b[2])<<0) + uint64(a[5])*(uint64(b[1])<<1) + uint64(a[6])*(uint64(b[0])<<0) tmp[7] = uint64(a[0])*(uint64(b[7])<<0) + uint64(a[1])*(uint64(b[6])<<0) + uint64(a[2])*(uint64(b[5])<<0) + uint64(a[3])*(uint64(b[4])<<0) + uint64(a[4])*(uint64(b[3])<<0) + uint64(a[5])*(uint64(b[2])<<0) + uint64(a[6])*(uint64(b[1])<<0) + uint64(a[7])*(uint64(b[0])<<0) // tmp[8] has the greatest value but doesn't overflow. See logic in // p256Square. tmp[8] = uint64(a[0])*(uint64(b[8])<<0) + uint64(a[1])*(uint64(b[7])<<1) + uint64(a[2])*(uint64(b[6])<<0) + uint64(a[3])*(uint64(b[5])<<1) + uint64(a[4])*(uint64(b[4])<<0) + uint64(a[5])*(uint64(b[3])<<1) + uint64(a[6])*(uint64(b[2])<<0) + uint64(a[7])*(uint64(b[1])<<1) + uint64(a[8])*(uint64(b[0])<<0) tmp[9] = uint64(a[1])*(uint64(b[8])<<0) + uint64(a[2])*(uint64(b[7])<<0) + uint64(a[3])*(uint64(b[6])<<0) + uint64(a[4])*(uint64(b[5])<<0) + uint64(a[5])*(uint64(b[4])<<0) + uint64(a[6])*(uint64(b[3])<<0) + uint64(a[7])*(uint64(b[2])<<0) + uint64(a[8])*(uint64(b[1])<<0) tmp[10] = uint64(a[2])*(uint64(b[8])<<0) + uint64(a[3])*(uint64(b[7])<<1) + uint64(a[4])*(uint64(b[6])<<0) + uint64(a[5])*(uint64(b[5])<<1) + uint64(a[6])*(uint64(b[4])<<0) + uint64(a[7])*(uint64(b[3])<<1) + uint64(a[8])*(uint64(b[2])<<0) tmp[11] = uint64(a[3])*(uint64(b[8])<<0) + uint64(a[4])*(uint64(b[7])<<0) + uint64(a[5])*(uint64(b[6])<<0) + uint64(a[6])*(uint64(b[5])<<0) + uint64(a[7])*(uint64(b[4])<<0) + uint64(a[8])*(uint64(b[3])<<0) tmp[12] = uint64(a[4])*(uint64(b[8])<<0) + uint64(a[5])*(uint64(b[7])<<1) + uint64(a[6])*(uint64(b[6])<<0) + uint64(a[7])*(uint64(b[5])<<1) + uint64(a[8])*(uint64(b[4])<<0) tmp[13] = uint64(a[5])*(uint64(b[8])<<0) + uint64(a[6])*(uint64(b[7])<<0) + uint64(a[7])*(uint64(b[6])<<0) + uint64(a[8])*(uint64(b[5])<<0) tmp[14] = uint64(a[6])*(uint64(b[8])<<0) + uint64(a[7])*(uint64(b[7])<<1) + uint64(a[8])*(uint64(b[6])<<0) tmp[15] = uint64(a[7])*(uint64(b[8])<<0) + uint64(a[8])*(uint64(b[7])<<0) tmp[16] = uint64(a[8]) * (uint64(b[8]) << 0) sm2P256ReduceDegree(c, &tmp) }
func sm2P256Square(b, a *sm2P256FieldElement) { var tmp sm2P256LargeFieldElement tmp[0] = uint64(a[0]) * uint64(a[0]) tmp[1] = uint64(a[0]) * (uint64(a[1]) << 1) tmp[2] = uint64(a[0])*(uint64(a[2])<<1) + uint64(a[1])*(uint64(a[1])<<1) tmp[3] = uint64(a[0])*(uint64(a[3])<<1) + uint64(a[1])*(uint64(a[2])<<1) tmp[4] = uint64(a[0])*(uint64(a[4])<<1) + uint64(a[1])*(uint64(a[3])<<2) + uint64(a[2])*uint64(a[2]) tmp[5] = uint64(a[0])*(uint64(a[5])<<1) + uint64(a[1])*(uint64(a[4])<<1) + uint64(a[2])*(uint64(a[3])<<1) tmp[6] = uint64(a[0])*(uint64(a[6])<<1) + uint64(a[1])*(uint64(a[5])<<2) + uint64(a[2])*(uint64(a[4])<<1) + uint64(a[3])*(uint64(a[3])<<1) tmp[7] = uint64(a[0])*(uint64(a[7])<<1) + uint64(a[1])*(uint64(a[6])<<1) + uint64(a[2])*(uint64(a[5])<<1) + uint64(a[3])*(uint64(a[4])<<1) // tmp[8] has the greatest value of 2**61 + 2**60 + 2**61 + 2**60 + 2**60, // which is < 2**64 as required. tmp[8] = uint64(a[0])*(uint64(a[8])<<1) + uint64(a[1])*(uint64(a[7])<<2) + uint64(a[2])*(uint64(a[6])<<1) + uint64(a[3])*(uint64(a[5])<<2) + uint64(a[4])*uint64(a[4]) tmp[9] = uint64(a[1])*(uint64(a[8])<<1) + uint64(a[2])*(uint64(a[7])<<1) + uint64(a[3])*(uint64(a[6])<<1) + uint64(a[4])*(uint64(a[5])<<1) tmp[10] = uint64(a[2])*(uint64(a[8])<<1) + uint64(a[3])*(uint64(a[7])<<2) + uint64(a[4])*(uint64(a[6])<<1) + uint64(a[5])*(uint64(a[5])<<1) tmp[11] = uint64(a[3])*(uint64(a[8])<<1) + uint64(a[4])*(uint64(a[7])<<1) + uint64(a[5])*(uint64(a[6])<<1) tmp[12] = uint64(a[4])*(uint64(a[8])<<1) + uint64(a[5])*(uint64(a[7])<<2) + uint64(a[6])*uint64(a[6]) tmp[13] = uint64(a[5])*(uint64(a[8])<<1) + uint64(a[6])*(uint64(a[7])<<1) tmp[14] = uint64(a[6])*(uint64(a[8])<<1) + uint64(a[7])*(uint64(a[7])<<1) tmp[15] = uint64(a[7]) * (uint64(a[8]) << 1) tmp[16] = uint64(a[8]) * uint64(a[8]) sm2P256ReduceDegree(b, &tmp) }
func cryptBlock(subkeys []uint32, b []uint32, r []byte, dst, src []byte, decrypt bool) { var x uint32 permuteInitialBlock(b, src) if decrypt { for i := 0; i < 8; i++ { x = b[1] ^ b[2] ^ b[3] ^ subkeys[31-4*i] b[0] = b[0] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[0] ^ b[2] ^ b[3] ^ subkeys[31-4*i-1] b[1] = b[1] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[0] ^ b[1] ^ b[3] ^ subkeys[31-4*i-2] b[2] = b[2] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[1] ^ b[2] ^ b[0] ^ subkeys[31-4*i-3] b[3] = b[3] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] } } else { for i := 0; i < 8; i++ { x = b[1] ^ b[2] ^ b[3] ^ subkeys[4*i] b[0] = b[0] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[0] ^ b[2] ^ b[3] ^ subkeys[4*i+1] b[1] = b[1] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[0] ^ b[1] ^ b[3] ^ subkeys[4*i+2] b[2] = b[2] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] x = b[1] ^ b[2] ^ b[0] ^ subkeys[4*i+3] b[3] = b[3] ^ sbox0[x&0xff] ^ sbox1[(x>>8)&0xff] ^ sbox2[(x>>16)&0xff] ^ sbox3[(x>>24)&0xff] } } b[0], b[1], b[2], b[3] = b[3], b[2], b[1], b[0] permuteFinalBlock(r, b) copy(dst, r) }
func writeSignV2Headers(buf *bytes.Buffer, req http.Request) { buf.WriteString(req.Method + "\n") buf.WriteString(req.Header.Get("Content-Md5") + "\n") buf.WriteString(req.Header.Get("Content-Type") + "\n") buf.WriteString(req.Header.Get("Date") + "\n") }
func escapeKey(r rune, reader *bufio.Reader) rune { switch r { case 'b': r = MetaBackward case 'f': r = MetaForward case 'd': r = MetaDelete case CharTranspose: r = MetaTranspose case CharBackspace: r = MetaBackspace case 'O': d, _, _ := reader.ReadRune() switch d { case 'H': r = CharLineStart case 'F': r = CharLineEnd default: reader.UnreadRune() } case CharEsc: } return r }
func (s *Server) RunFcgi(addr string) { s.initServer() s.Logger.Printf("web.go serving fcgi %s\n", addr) s.listenAndServeFcgi(addr) }
func NewITunesItemExtension(extensions map[string][]Extension) *ITunesItemExtension { entry := &ITunesItemExtension{} entry.Author = parseTextExtension("author", extensions) entry.Block = parseTextExtension("block", extensions) entry.Duration = parseTextExtension("duration", extensions) entry.Explicit = parseTextExtension("explicit", extensions) entry.Subtitle = parseTextExtension("subtitle", extensions) entry.Summary = parseTextExtension("summary", extensions) entry.Keywords = parseTextExtension("keywords", extensions) entry.Image = parseImage(extensions) entry.IsClosedCaptioned = parseTextExtension("isClosedCaptioned", extensions) entry.Order = parseTextExtension("order", extensions) return entry }
func NewDublinCoreExtension(extensions map[string][]Extension) *DublinCoreExtension { dc := &DublinCoreExtension{} dc.Title = parseTextArrayExtension("title", extensions) dc.Creator = parseTextArrayExtension("creator", extensions) dc.Author = parseTextArrayExtension("author", extensions) dc.Subject = parseTextArrayExtension("subject", extensions) dc.Description = parseTextArrayExtension("description", extensions) dc.Publisher = parseTextArrayExtension("publisher", extensions) dc.Contributor = parseTextArrayExtension("contributor", extensions) dc.Date = parseTextArrayExtension("date", extensions) dc.Type = parseTextArrayExtension("type", extensions) dc.Format = parseTextArrayExtension("format", extensions) dc.Identifier = parseTextArrayExtension("identifier", extensions) dc.Source = parseTextArrayExtension("source", extensions) dc.Language = parseTextArrayExtension("language", extensions) dc.Relation = parseTextArrayExtension("relation", extensions) dc.Coverage = parseTextArrayExtension("coverage", extensions) dc.Rights = parseTextArrayExtension("rights", extensions) return dc }
func encode(dst, id []byte) { _ = dst[19] _ = id[11] dst[19] = encoding[(id[11]<<4)&0x1F] dst[18] = encoding[(id[11]>>1)&0x1F] dst[17] = encoding[(id[11]>>6)&0x1F|(id[10]<<2)&0x1F] dst[16] = encoding[id[10]>>3] dst[15] = encoding[id[9]&0x1F] dst[14] = encoding[(id[9]>>5)|(id[8]<<3)&0x1F] dst[13] = encoding[(id[8]>>2)&0x1F] dst[12] = encoding[id[8]>>7|(id[7]<<1)&0x1F] dst[11] = encoding[(id[7]>>4)&0x1F|(id[6]<<4)&0x1F] dst[10] = encoding[(id[6]>>1)&0x1F] dst[9] = encoding[(id[6]>>6)&0x1F|(id[5]<<2)&0x1F] dst[8] = encoding[id[5]>>3] dst[7] = encoding[id[4]&0x1F] dst[6] = encoding[id[4]>>5|(id[3]<<3)&0x1F] dst[5] = encoding[(id[3]>>2)&0x1F] dst[4] = encoding[id[3]>>7|(id[2]<<1)&0x1F] dst[3] = encoding[(id[2]>>4)&0x1F|(id[1]<<4)&0x1F] dst[2] = encoding[(id[1]>>1)&0x1F] dst[1] = encoding[(id[1]>>6)&0x1F|(id[0]<<2)&0x1F] dst[0] = encoding[id[0]>>3] }
func decode(id *ID, src []byte) { _ = src[19] _ = id[11] id[11] = dec[src[17]]<<6 | dec[src[18]]<<1 | dec[src[19]]>>4 id[10] = dec[src[16]]<<3 | dec[src[17]]>>2 id[9] = dec[src[14]]<<5 | dec[src[15]] id[8] = dec[src[12]]<<7 | dec[src[13]]<<2 | dec[src[14]]>>3 id[7] = dec[src[11]]<<4 | dec[src[12]]>>1 id[6] = dec[src[9]]<<6 | dec[src[10]]<<1 | dec[src[11]]>>4 id[5] = dec[src[8]]<<3 | dec[src[9]]>>2 id[4] = dec[src[6]]<<5 | dec[src[7]] id[3] = dec[src[4]]<<7 | dec[src[5]]<<2 | dec[src[6]]>>3 id[2] = dec[src[3]]<<4 | dec[src[4]]>>1 id[1] = dec[src[1]]<<6 | dec[src[2]]<<1 | dec[src[3]]>>4 id[0] = dec[src[0]]<<3 | dec[src[1]]>>2 }
func (k *ExtendedKey) Zero() { zero(k.key) zero(k.pubKey) zero(k.chainCode) zero(k.parentFP) k.version = nil k.key = nil k.depth = 0 k.childNum = 0 k.isPrivate = false }
func (p *siprng) Seed(k [16]byte) { p.k0 = binary.LittleEndian.Uint64(k[0:8]) p.k1 = binary.LittleEndian.Uint64(k[8:16]) p.ctr = 1 }
func (l *loopCrosser) startEdge(aj int) { l.crosser = NewEdgeCrosser(l.a.Vertex(aj), l.a.Vertex(aj+1)) l.aj = aj l.bjPrev = -2 }
func (e *EdgeCrosser) RestartAt(c Point) { e.c = c e.acb = -triageSign(e.a, e.b, e.c) }
func (ed *eventData) writeInt32(value int32) { binary.Write(&ed.buffer, binary.LittleEndian, value) }
func BoundPad(b orb.Bound, meters float64) orb.Bound { dy := meters / 111131.75 dx := dy / math.Cos(deg2rad(b.Max[1])) dx = math.Max(dx, dy/math.Cos(deg2rad(b.Min[1]))) b.Min[0] -= dx b.Min[1] -= dy b.Max[0] += dx b.Max[1] += dy b.Min[0] = math.Max(b.Min[0], -180) b.Min[1] = math.Max(b.Min[1], -90) b.Max[0] = math.Min(b.Max[0], 180) b.Max[1] = math.Min(b.Max[1], 90) return b }
func (opts *Options) SetEnv(value *Env) { opts.env = value C.rocksdb_options_set_env(opts.c, value.c) }
func (opts *Options) SetCompressionOptions(value *CompressionOptions) { C.rocksdb_options_set_compression_options(opts.c, C.int(value.WindowBits), C.int(value.Level), C.int(value.Strategy), C.int(value.MaxDictBytes)) }
func (opts *Options) SetRateLimiter(rateLimiter *RateLimiter) { C.rocksdb_options_set_ratelimiter(opts.c, rateLimiter.c) }
func (opts *Options) SetBlockBasedTableFactory(value *BlockBasedTableOptions) { opts.bbto = value C.rocksdb_options_set_block_based_table_factory(opts.c, value.c) }
func centroid3(p1, p2, p3, c geom.Coord) { c[0] = p1[0] + p2[0] + p3[0] c[1] = p1[1] + p2[1] + p3[1] }
func FormatBits(scratch *FormatBitsScratch, dst FormatBitsWriter, u uint64, base int, neg bool) { FormatBits2(dst, u, base, neg) }
func (r *ffReader) Reset(d []byte) { r.s = d r.i = 0 r.l = len(d) }
func (ffl *FFLexer) Reset(input []byte) { ffl.Token = FFTok_init ffl.Error = FFErr_e_ok ffl.BigError = nil ffl.reader.Reset(input) ffl.lastCurrentChar = 0 ffl.Output.Reset() }
func startCleaner(cache *Cache, interval time.Duration) { cleaner := &cleaner{ interval: interval, stop: make(chan bool), } cache.cleaner = cleaner go cleaner.Run(cache) }
func Register(format string, p Packager) { lock.Lock() packagers[format] = p lock.Unlock() }
func (perm *Permissions) AddAdminPath(prefix string) { perm.adminPathPrefixes = append(perm.adminPathPrefixes, prefix) }
func (perm *Permissions) AddPublicPath(prefix string) { perm.publicPathPrefixes = append(perm.publicPathPrefixes, prefix) }
func InitBaseHeader(v *http.Request) { v.Header["Accept"] = []string{"application/json"} v.Header.Set("Content-MD5", "") v.Header["Content-Type"] = []string{"application/json"} v.Header["Date"] = []string{util.GetRFCDate()} v.Header["x-acs-signature-method"] = []string{"HMAC-SHA1"} v.Header["x-acs-signature-version"] = []string{"1.0"} v.Header["x-acs-version"] = []string{"2015-08-15"} }
func NewClient() *Client { baseURL, _ := url.Parse(BaseURL) c := &Client{BaseURL: baseURL, WebSocketURL: WebSocketURL} c.Pairs = &PairsService{client: c} c.Stats = &StatsService{client: c} c.Account = &AccountService{client: c} c.Ticker = &TickerService{client: c} c.Balances = &BalancesService{client: c} c.Offers = &OffersService{client: c} c.Credits = &CreditsService{client: c} c.Deposit = &DepositService{client: c} c.Lendbook = &LendbookService{client: c} c.MarginInfo = &MarginInfoService{client: c} c.MarginFunding = &MarginFundingService{client: c} c.OrderBook = &OrderBookService{client: c} c.Orders = &OrderService{client: c} c.History = &HistoryService{client: c} c.Trades = &TradesService{client: c} c.Positions = &PositionsService{client: c} c.Wallet = &WalletService{client: c} c.WebSocket = NewWebSocketService(c) c.WebSocketTLSSkipVerify = false return c }
func NewClientWithSynchronousURLNonce(sync Synchronous, url string, nonce utils.NonceGenerator) *Client { c := &Client{ Synchronous: sync, nonce: nonce, } c.Orders = OrderService{Synchronous: c, requestFactory: c} c.Book = BookService{Synchronous: c} c.Candles = CandleService{Synchronous: c} c.Trades = TradeService{Synchronous: c, requestFactory: c} c.Tickers = TickerService{Synchronous: c, requestFactory: c} c.Platform = PlatformService{Synchronous: c} c.Positions = PositionService{Synchronous: c, requestFactory: c} c.Wallet = WalletService{Synchronous: c, requestFactory: c} c.Ledgers = LedgerService{Synchronous: c, requestFactory: c} return c }
func (p *UserAgent) initialize() { p.ua = "" p.mozilla = "" p.platform = "" p.os = "" p.localization = "" p.browser.Engine = "" p.browser.EngineVersion = "" p.browser.Name = "" p.browser.Version = "" p.bot = false p.mobile = false p.undecided = false }
func AddStringFuncs(f map[string]interface{}) { f["strings"] = StrNS f["replaceAll"] = StrNS().ReplaceAll f["title"] = StrNS().Title f["toUpper"] = StrNS().ToUpper f["toLower"] = StrNS().ToLower f["trimSpace"] = StrNS().TrimSpace f["indent"] = StrNS().Indent f["quote"] = StrNS().Quote f["squote"] = StrNS().Squote // these are legacy aliases with non-pipelinable arg order f["contains"] = strings.Contains f["hasPrefix"] = strings.HasPrefix f["hasSuffix"] = strings.HasSuffix f["split"] = strings.Split f["splitN"] = strings.SplitN f["trim"] = strings.Trim }
func AddCollFuncs(f map[string]interface{}) { f["coll"] = CollNS f["has"] = CollNS().Has f["slice"] = CollNS().Slice f["dict"] = CollNS().Dict f["keys"] = CollNS().Keys f["values"] = CollNS().Values f["append"] = CollNS().Append f["prepend"] = CollNS().Prepend f["uniq"] = CollNS().Uniq f["reverse"] = CollNS().Reverse f["merge"] = CollNS().Merge f["sort"] = CollNS().Sort f["jsonpath"] = CollNS().JSONPath }
func AddMathFuncs(f map[string]interface{}) { f["math"] = MathNS f["add"] = MathNS().Add f["sub"] = MathNS().Sub f["mul"] = MathNS().Mul f["div"] = MathNS().Div f["rem"] = MathNS().Rem f["pow"] = MathNS().Pow f["seq"] = MathNS().Seq }
func (d *Data) registerReaders() { d.sourceReaders = make(map[string]func(*Source, ...string) ([]byte, error)) d.sourceReaders["aws+smp"] = readAWSSMP d.sourceReaders["boltdb"] = readBoltDB d.sourceReaders["consul"] = readConsul d.sourceReaders["consul+http"] = readConsul d.sourceReaders["consul+https"] = readConsul d.sourceReaders["env"] = readEnv d.sourceReaders["file"] = readFile d.sourceReaders["http"] = readHTTP d.sourceReaders["https"] = readHTTP d.sourceReaders["merge"] = d.readMerge d.sourceReaders["stdin"] = readStdin d.sourceReaders["vault"] = readVault d.sourceReaders["vault+http"] = readVault d.sourceReaders["vault+https"] = readVault }
func AddDataFuncs(f map[string]interface{}, d *data.Data) { f["datasource"] = d.Datasource f["ds"] = d.Datasource f["datasourceExists"] = d.DatasourceExists f["datasourceReachable"] = d.DatasourceReachable f["defineDatasource"] = d.DefineDatasource f["include"] = d.Include f["data"] = DataNS f["json"] = DataNS().JSON f["jsonArray"] = DataNS().JSONArray f["yaml"] = DataNS().YAML f["yamlArray"] = DataNS().YAMLArray f["toml"] = DataNS().TOML f["csv"] = DataNS().CSV f["csvByRow"] = DataNS().CSVByRow f["csvByColumn"] = DataNS().CSVByColumn f["toJSON"] = DataNS().ToJSON f["toJSONPretty"] = DataNS().ToJSONPretty f["toYAML"] = DataNS().ToYAML f["toTOML"] = DataNS().ToTOML f["toCSV"] = DataNS().ToCSV }
func AddConvFuncs(f map[string]interface{}) { f["conv"] = ConvNS f["urlParse"] = ConvNS().URL f["bool"] = ConvNS().Bool f["join"] = ConvNS().Join f["default"] = ConvNS().Default }
func (f *File) PackageComment(comment string) { f.comments = append(f.comments, comment) }
func (r *Request) SetChecksum(h hash.Hash, sum []byte, deleteOnError bool) { r.hash = h r.checksum = sum r.deleteOnError = deleteOnError }
func (nw *NotifyWorker) tearDown(err error) { nw.catacomb.Kill(err) err = nw.config.Handler.TearDown() nw.catacomb.Kill(err) }