text:
@article{Lindon2015,
author = {Lindon, Heather L. and Gardiner, Lauren M. and Brady, Abigail and Vorontsova, Maria S.},
title = {Fewer than three percent of land plant species named by women: Author gender over 260 years},
journal = {TAXON},
volume = {64},
number = {2},
pages = {209-215},
keywords = {Biodiversity inventory, Botany, History of science, New species, Nomenclature, Women in science},
doi = {https://doi.org/10.12705/642.4},
url = {https://onlinelibrary.wiley.com/doi/abs/10.12705/642.4},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.12705/642.4},
year = {2015}
}
@article{groom2020,
    author = {Groom, Quentin J. and Güntsch, Anton and Huybrechts, Pieter and Kearney, Nicole and Leachman, Siobhan and Nicolson, Nicky and Page, Roderic D M and Shorthouse, David P and Thessen, Anne E and Haston, Elspeth},
    title = "{People are essential to linking biodiversity data}",
    journal = {Database},
    volume = {2020},
    year = {2020},
    month = {11},
    abstract = "{People are one of the best known and most stable entities in the biodiversity knowledge graph. The wealth of public information associated with people and the ability to identify them uniquely open up the possibility to make more use of these data in biodiversity science. Person data are almost always associated with entities such as specimens, molecular sequences, taxonomic names, observations, images, traits and publications. For example, the digitization and the aggregation of specimen data from museums and herbaria allow us to view a scientist’s specimen collecting in conjunction with the whole corpus of their works. However, the metadata of these entities are also useful in validating data, integrating data across collections and institutional databases and can be the basis of future research into biodiversity and science. In addition, the ability to reliably credit collectors for their work has the potential to change the incentive structure to promote improved curation and maintenance of natural history collections.}",
    issn = {1758-0463},
    doi = {10.1093/database/baaa072},
    url = {https://doi.org/10.1093/database/baaa072},
    note = {baaa072},
    eprint = {https://academic.oup.com/database/article-pdf/doi/10.1093/database/baaa072/36143659/baaa072.pdf},
}
@article{groom2014herbarium,
  title={Herbarium specimens reveal the exchange network of British and Irish botanists, 1856--1932},
  author={Groom, Quentin J. and O’Reilly, C. and Humphrey, T.},
  journal={New Journal of Botany},
  volume={4},
  number={2},
  pages={95--103},
  year={2014},
  publisher={Taylor \& Francis},
  doi={10.1179/2042349714Y.0000000041}
}
@misc{sqlite2020hipp,
  title={{SQLite}},
  url={https://www.sqlite.org/index.html},
  version={3.31.1},
  year={2020},
  author={Hipp, Richard D}
}
@paper{ICWSM09154,
author = {Mathieu Bastian and Sebastien Heymann and Mathieu Jacomy},
title = {Gephi: An Open Source Software for Exploring and Manipulating Networks},
conference = {International AAAI Conference on Weblogs and Social Media},
year = {2009},
keywords = {network;network science;visualization;graph exploration;open source;free software;dynamic network;interactive interface;graph;force vector;java;OpenGL;3-D visualization;user-centric;graph layout;complex graph rendering;network analysis;webatlas},
abstract = {Gephi is an open source software for graph and network analysis. It uses a 3D render engine to display large networks in real-time and to speed up the exploration. A flexible and multi-task architecture brings new possibilities to work with complex data sets and produce valuable visual results. We present several key features of Gephi in the context of interactive exploration and interpretation of networks. It provides easy and broad access to network data and allows for spatializing, filtering, navigating, manipulating and clustering. Finally, by presenting dynamic features of Gephi, we highlight key aspects of dynamic network visualization.},
url = {http://www.aaai.org/ocs/index.php/ICWSM/09/paper/view/154}
}
@article{de2020new,
  title={New perspectives on analysing data from biological collections based on social network analytics},
  author={de Siracusa, Pedro C and Gadelha, Luiz MR and Ziviani, Artur},
  journal={Scientific reports},
  volume={10},
  number={1},
  pages={1--10},
  year={2020},
  doi={10.1038/s41598-020-60134-y},
  publisher={Nature Publishing Group}
}
@article{arino2010approaches,
  title={Approaches to estimating the universe of natural history collections data},
  author={Ari{\~n}o, Arturo H},
  journal={Biodiversity Informatics},
  volume={7},
  number={2},
  doi={10.17161/bi.v7i2.3991},
  year={2010}
}
@article{Brandes2001,
  author = { Ulrik   Brandes },
  title = {A faster algorithm for betweenness centrality},
  journal = {The Journal of Mathematical Sociology},
  volume = {25},
  number = {2},
  pages = {163-177},
  year  = {2001},
  publisher = {Routledge},
  doi = {10.1080/0022250X.2001.9990249},
  URL = {https://doi.org/10.1080/0022250X.2001.9990249},
  eprint = {https://doi.org/10.1080/0022250X.2001.9990249}
}
@article{Blondel2008,
  	journal={Journal of statistical mechanics: theory and experiment},
	doi = {10.1088/1742-5468/2008/10/p10008},
	url = {https://doi.org/10.1088/1742-5468/2008/10/p10008},
	year = 2008,
	month = {oct},
	publisher = {{IOP} Publishing},
	volume = {2008},
	number = {10},
	pages = {P10008},
	author = {Vincent D Blondel and Jean-Loup Guillaume and Renaud Lambiotte and Etienne Lefebvre},
	title = {Fast unfolding of communities in large networks},
	abstract = {We propose a simple method to extract the community structure of large networks. Our method is a heuristic method that is based on modularity optimization. It is shown to outperform all other known community detection methods in terms of computation time. Moreover, the quality of the communities detected is very good, as measured by the so-called modularity. This is shown first by identifying language communities in a Belgian mobile phone network of 2 million customers and by analysing a web graph of 118 million nodes and more than one billion links. The accuracy of our algorithm is also verified on ad hoc modular networks.}
}
@article{sastre2003alicia,
  title="{A}licia {L}ourteig (1913-2003)",
  author={Sastre, Claude},
  journal={Adansonia},
  volume={25},
  number={2},
  pages={149--150},
  year={2003},
  url={https://sciencepress.mnhn.fr/en/periodiques/adansonia/25/2/alicia-lourteig-1913-2003}
}
@article{Fosberg1959,
 ISSN = {00400262},
 URL = {http://www.jstor.org/stable/1216753},
 author = {F. R. Fosberg and J. R. Swallen},
 journal = {Taxon},
 number = {5},
 pages = {145--151},
 publisher = "{International Association for Plant Taxonomy (IAPT)}",
 title = "{A}gnes {C}hase",
 volume = {8},
 year = {1959},
 doi={10.2307/1216753}
}
@article{Fuglei2006,
author = {Fuglei, Eva and Goldman, Helle V.},
title = "{H}anna {M}arie {R}esvoll-{H}olmsen: a pioneer in {S}valbard",
journal = {Polar Research},
volume = {25},
number = {1},
pages = {1-13},
doi = {10.1111/j.1751-8369.2006.tb00146.x},
url = {https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1751-8369.2006.tb00146.x},
eprint = {https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1751-8369.2006.tb00146.x},
abstract = {This year is a kind of anniversary for the Norwegian Polar Institute: its establishment can be traced back to Svalbard expeditions sponsored by Prince Albert I of Monaco in 1906 and 1907. In this unreviewed biographical article, biologist Eva Fuglei, who has spent many seasons on Spitsbergen (where her research has focused on Arctic foxes), and the editor describe part of the uncommon life of botanist Hanna Marie Resvoll-Holmsen, who participated in the 1907 expedition.},
year = {2006}
}
@article{hu2011algorithms,
  title={Algorithms for visualizing large networks},
  author={Hu, Yifan},
  journal={Combinatorial scientific computing},
  volume={5},
  number={3},
  pages={180--186},
  year={2011},
  publisher={Citeseer}
}
@article{mignan2018metacollecting,
  title={Metacollecting or the process of collecting collections, with examples from The Tricottet Collection Colligo, 1},
  author={Mignan, A},
  year={2018},
  url={https://perma.cc/YQ5W-BN5Z}
}
@article{Lourenco2017,
	author = {Lourenço, Marta C. and Dias, José Pedro Sousa},
	title = {“Time Capsules” of Science: Museums, Collections, and Scientific Heritage in Portugal},
	journal = {Isis},
	volume = {108},
	number = {2},
	pages = {390-398},
	year = {2017},
	doi = {10.1086/692690},
	URL = {10.1086/692690},
	eprint = {https://doi.org/10.1086/692690}
}
@article{fyfe2006sociology,
  title={Sociology and the social aspects of museums},
  author={Fyfe, Gordon},
  journal={A companion to museum studies},
  pages={33--49},
  year={2006},
  publisher={Blackwell Oxford}
}

repository: AugustT/network-analysis

repo_name: AugustT/network-analysis


text:
package httpDownloader

import (
	"net/url"
)

//Target not synchronized
type Target struct {
	resURL         string //檔案位置
	numOfGoroutine int    //使用幾個 Goroutine進行下載
	lengthOfPacket int    //檔案被分割後的美個封包大小
}

func (this *Target) Clone() *Target {
	clone := &Target{}
	clone.resURL = this.resURL
	clone.numOfGoroutine = this.numOfGoroutine
	clone.lengthOfPacket = this.lengthOfPacket
	return clone
}

func TargetBuilder(resURL string) (*Target, error) {
	_, err := url.ParseRequestURI(resURL)
	if err != nil {
		return nil, err
	}

	target := &Target{}
	target.resURL = resURL
	return target, nil
}

func (this *Target) GetURL() string {
	return this.resURL
}

func (this *Target) SetNumOfGoroutine(numOfGoroutine int) *Target {
	this.numOfGoroutine = numOfGoroutine
	return this
}

func (this *Target) GetNumOfGoroutine() int {
	if this.numOfGoroutine < 1 {
		this.numOfGoroutine = 1
	}
	return this.numOfGoroutine
}

func (this *Target) SetLengthOfPacket(lengthOfPacket int) *Target {
	this.lengthOfPacket = lengthOfPacket
	return this
}

func (this *Target) GetLengthOfPacket() int {
	if this.lengthOfPacket < 1 {
		this.lengthOfPacket = 1
	}
	return this.lengthOfPacket
}

func (this *Target) Build() *Target {
	return this.Clone()
}

license: Unlicense

license_type: permissive

branch_name: refs/heads/master

gha_language: Go

extension: go


text:
// --------------------------------------------------------------------------
//                   OpenMS -- Open-Source Mass Spectrometry
// --------------------------------------------------------------------------
// Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
// ETH Zurich, and Freie Universitaet Berlin 2002-2023.
//
// This software is released under a three-clause BSD license:
//  * Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//  * Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the distribution.
//  * Neither the name of any author or any participating institution
//    may be used to endorse or promote products derived from this software
//    without specific prior written permission.
// For a full list of authors, refer to the file AUTHORS.
// --------------------------------------------------------------------------
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
// INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// --------------------------------------------------------------------------
// $Maintainer: Timo Sachsenberg $
// $Authors: $
// --------------------------------------------------------------------------

#include <OpenMS/CONCEPT/ClassTest.h>
#include <OpenMS/test_config.h>

///////////////////////////
#include <OpenMS/TRANSFORMATIONS/RAW2PEAK/TwoDOptimization.h>
#include <OpenMS/FORMAT/MzMLFile.h>
#include <OpenMS/FORMAT/ParamXMLFile.h>
///////////////////////////

using namespace OpenMS;
using namespace std;

START_TEST(TwoDOptimization, "$Id$")
/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////

TwoDOptimization* ptr = 0;
TwoDOptimization* nullPointer = 0;
START_SECTION((TwoDOptimization   ( )))
	ptr = new TwoDOptimization();
	TEST_NOT_EQUAL(ptr, nullPointer)
END_SECTION

START_SECTION((~TwoDOptimization()))
	delete ptr;
END_SECTION

START_SECTION((TwoDOptimization& operator=(const TwoDOptimization& opt)))
  TwoDOptimization opt_2d;
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties;
  penalties.pos = 2;
  penalties.height = 3;
  penalties.lWidth = 4;
  penalties.rWidth = 5;
  opt_2d.setPenalties(penalties);
  opt_2d.setMaxIterations(10);

  TwoDOptimization opt_2d_copy;
  opt_2d_copy = opt_2d;
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties_copy = opt_2d_copy.getPenalties();
  unsigned int number = opt_2d_copy.getMaxIterations();
  TEST_REAL_SIMILAR(penalties.pos,penalties_copy.pos)
  TEST_REAL_SIMILAR(penalties.lWidth,penalties_copy.lWidth)
  TEST_REAL_SIMILAR(penalties.rWidth,penalties_copy.rWidth)
  TEST_REAL_SIMILAR(penalties.height,penalties_copy.height)

  TEST_TRUE(number == 10)
END_SECTION

START_SECTION((TwoDOptimization(const TwoDOptimization& opt)))
  TOLERANCE_ABSOLUTE(0.001)
  TwoDOptimization opt_2d;
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties;
  opt_2d.setPenalties(penalties);
  opt_2d.setMaxIterations(10);

  TwoDOptimization opt_2d_copy(opt_2d);
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties_copy = opt_2d_copy.getPenalties();
  unsigned int number = opt_2d_copy.getMaxIterations();
  TEST_REAL_SIMILAR(penalties.pos,penalties_copy.pos)
  TEST_REAL_SIMILAR(penalties.lWidth,penalties_copy.lWidth)
  TEST_REAL_SIMILAR(penalties.rWidth,penalties_copy.rWidth)
  TEST_REAL_SIMILAR(penalties.height,penalties_copy.height)

  TEST_TRUE(number == 10)
END_SECTION

START_SECTION(( template <typename InputSpectrumIterator,typename OutputPeakType>  void optimize(InputSpectrumIterator first,InputSpectrumIterator last,MSExperiment< OutputPeakType >& ms_exp,bool real2D=true)))
  //******************************************************************
  //test exception with unequal number of scans
  {
  	PeakMap exp_in;
	  exp_in.resize(1);
	  PeakMap::const_iterator first1 = exp_in.begin();
	  PeakMap::const_iterator last1 = exp_in.end();
	  PeakMap exp_out;
		TwoDOptimization opt1;
		TEST_EXCEPTION(Exception::IllegalArgument, opt1.optimize(first1,last1,exp_out));
  }

  //******************************************************************
  //test exception when meta data is missing
  {
  	PeakMap exp_in;
	  exp_in.resize(1);
	  PeakMap::const_iterator first1 = exp_in.begin();
	  PeakMap::const_iterator last1 = exp_in.end();
	  PeakMap exp_out;
	  exp_out.resize(1);
		TwoDOptimization opt1;
		TEST_EXCEPTION(Exception::IllegalArgument, opt1.optimize(first1,last1,exp_out));
  }

  //******************************************************************
// test for 2D optimization
  TOLERANCE_ABSOLUTE(0.04)
  TOLERANCE_RELATIVE(1.001)
  MSSpectrum peaks;
  peaks.getFloatDataArrays().resize(6);
  peaks.getFloatDataArrays()[1].setName("maximumIntensity");
  peaks.getFloatDataArrays()[1].push_back(700.); //intensity
  peaks.getFloatDataArrays()[3].setName("leftWidth");
	peaks.getFloatDataArrays()[3].push_back(12.5f); //left width
  peaks.getFloatDataArrays()[4].setName("rightWidth");
	peaks.getFloatDataArrays()[4].push_back(12.5f); //right width
  peaks.getFloatDataArrays()[5].setName("peakShape");
	peaks.getFloatDataArrays()[5].push_back(0); //shape
  peaks.getFloatDataArrays()[1].push_back(700.); //intensity
	peaks.getFloatDataArrays()[3].push_back(12.5f); //left width
	peaks.getFloatDataArrays()[4].push_back(12.5f); //right width
	peaks.getFloatDataArrays()[5].push_back(0); //shape
  MSSpectrum peaks2;
  peaks2.getFloatDataArrays().resize(6);
  peaks2.getFloatDataArrays()[1].setName("maximumIntensity");
  peaks2.getFloatDataArrays()[1].push_back(700.); //intensity
  peaks2.getFloatDataArrays()[3].setName("leftWidth");
	peaks2.getFloatDataArrays()[3].push_back(12.5f); //left width
  peaks2.getFloatDataArrays()[4].setName("rightWidth");
	peaks2.getFloatDataArrays()[4].push_back(12.5f); //right width
  peaks2.getFloatDataArrays()[5].setName("peakShape");
	peaks2.getFloatDataArrays()[5].push_back(0); //shape
  peaks2.getFloatDataArrays()[1].push_back(700.); //intensity
	peaks2.getFloatDataArrays()[3].push_back(12.5f); //left width
	peaks2.getFloatDataArrays()[4].push_back(12.5f); //right width
	peaks2.getFloatDataArrays()[5].push_back(0); //shape

	Peak1D peak;
  PeakShape peak_shape,peak_shape2;
  peak.setMZ(500.);
  peak.setIntensity(171.69f);
  peak_shape.mz_position = 500;
  peak_shape.left_width = 12.5;
  peak_shape.right_width = 12.5;
  peak_shape.area = 171.69;
  peak_shape.height = 700;
  peak_shape.type = PeakShape::LORENTZ_PEAK;
	peaks.push_back(peak);
  peak.setMZ(501.);
  peak.setIntensity(171.69f);
  peak_shape2.mz_position = 501;
  peak_shape2.left_width = 12.5;
  peak_shape2.right_width = 12.5;
  peak_shape2.area = 171.69;
  peak_shape2.height = 700;
  peak_shape2.type = PeakShape::LORENTZ_PEAK;
	peaks.push_back(peak);

  PeakMap ms_exp;
	ms_exp.addSpectrum(peaks);
	ms_exp.begin()->setRT(100);

  float origin = 499;
  float spacing = 0.1f;

	MSSpectrum	 raw_spec;
  for (Size i = 0; i < 20 ;++i)
  {
		Peak1D data_point;
		data_point.setMZ(origin +i*spacing);
		data_point.setIntensity(peak_shape(origin +i*spacing)+peak_shape2(origin +i*spacing));
    raw_spec.push_back(data_point);
  }
  peak.setMZ(500.02);
  peak.setIntensity(171.69f);
  peak_shape.mz_position = 500;
  peak_shape.left_width = 12.5;
  peak_shape.right_width = 12.5;
  peak_shape.area = 171.69;
  peak_shape.height = 700;
  peak_shape.type = PeakShape::LORENTZ_PEAK;
	peaks2.push_back(peak);
  peak.setMZ(501);
  peak.setIntensity(171.69f);
  peak_shape2.mz_position = 501;
  peak_shape2.left_width = 12.5;
  peak_shape2.right_width = 12.5;
  peak_shape2.area = 171.69;
  peak_shape2.height = 700;
  peak_shape2.type = PeakShape::LORENTZ_PEAK;
	peaks2.push_back(peak);

	ms_exp.addSpectrum(peaks2);
 (ms_exp.begin()+1)->setRT(101);

  MSSpectrum	 raw_spec2;
  for (Size i = 0; i < 20 ;++i)
  {
		Peak1D data_point;
		data_point.setMZ(origin +i*spacing);
		data_point.setIntensity(peak_shape(origin +i*spacing)+peak_shape2(origin +i*spacing));
    raw_spec2.push_back(data_point);
  }

  PeakMap raw_exp;
  raw_exp.addSpectrum(raw_spec);
  raw_exp.addSpectrum(raw_spec2);
	raw_exp.begin()->setRT(100);
  (raw_exp.begin()+1)->setRT(101);
  String file = OPENMS_GET_TEST_DATA_PATH("TwoDOptimization.xml");
  Param param;
  ParamXMLFile paramFile;
	paramFile.load(file, param);
  PeakMap::const_iterator first,last;
  first = raw_exp.begin();
  last = raw_exp.end();
  TwoDOptimization opt_2d;
 	opt_2d.setParameters(param);
  opt_2d.optimize(first,last,ms_exp,true);
  TEST_REAL_SIMILAR(ms_exp[0][0].getMZ(),500)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[3][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[4][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0][0].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[0][1].getMZ(),501)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[3][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[4][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0][1].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[1][0].getMZ(),500)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[3][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[4][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1][0].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[1][1].getMZ(),501)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[3][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[4][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1][1].getIntensity(),171.69)

  peaks2.clear(false);
  peaks2.getFloatDataArrays()[3][0]=12.5; //left width
  peaks2.getFloatDataArrays()[4][0]=12.5; //right width
  peaks2.getFloatDataArrays()[3][1]=12.5; //left width
	peaks2.getFloatDataArrays()[4][1]=12.5; //right width
  peaks2.getFloatDataArrays()[1][0]=700.; //intensity
  peaks2.getFloatDataArrays()[1][1]=800.; //intensity

  peak.setMZ(900);
  peak.setIntensity(105.79f);
  peak_shape.mz_position = 900;
  peak_shape.left_width = 12.5;
  peak_shape.right_width = 12.5;
  peak_shape.area = 171.69;
  peak_shape.height = 700;
  peak_shape.type = PeakShape::LORENTZ_PEAK;
	peaks2.push_back(peak);
  peak.setMZ(901);
  peak.setIntensity(105.79f);
  peak_shape2.mz_position = 901;
  peak_shape2.left_width = 12.5;
  peak_shape2.right_width = 12.5;
  peak_shape2.area = 171.69;
  peak_shape2.height = 700;
  peak_shape2.type = PeakShape::LORENTZ_PEAK;
	peaks2.push_back(peak);
	ms_exp.addSpectrum(peaks2);
  (ms_exp.begin()+2)->setRT(102);

  raw_spec2.clear(true);
  origin = 899;
  for (Size i = 0; i < 20 ;++i)
  {
		Peak1D data_point;
		data_point.setMZ(origin +i*spacing);
		data_point.setIntensity(peak_shape(origin +i*spacing)+peak_shape2(origin +i*spacing));
    raw_spec2.push_back(data_point);
  }

  raw_exp.addSpectrum(raw_spec2);
  (raw_exp.begin()+2)->setRT(102);
  first = raw_exp.begin();
  last = raw_exp.end();
  TwoDOptimization opt_1d;
 	opt_1d.setParameters(param);
  opt_1d.optimize(first,last,ms_exp,false); // test 1D optimization
  TEST_REAL_SIMILAR(ms_exp[0][0].getMZ(),500)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[3][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[4][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0][0].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[0][1].getMZ(),501)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[3][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0].getFloatDataArrays()[4][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[0][1].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[1][0].getMZ(),500)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[3][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[4][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1][0].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[1][1].getMZ(),501)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[3][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1].getFloatDataArrays()[4][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[1][1].getIntensity(),171.69)

  TEST_REAL_SIMILAR(ms_exp[2][0].getMZ(),900)
 	TEST_REAL_SIMILAR(ms_exp[2].getFloatDataArrays()[3][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[2].getFloatDataArrays()[4][0],12.5)
 	TEST_REAL_SIMILAR(ms_exp[2][0].getIntensity(),171.69)
	TEST_REAL_SIMILAR(ms_exp[2][1].getMZ(),901)
 	TEST_REAL_SIMILAR(ms_exp[2].getFloatDataArrays()[3][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[2].getFloatDataArrays()[4][1],12.5)
 	TEST_REAL_SIMILAR(ms_exp[2][1].getIntensity(),171.69)

END_SECTION

START_SECTION((void setMaxPeakDistance(double max_peak_distance)))
  TOLERANCE_ABSOLUTE(0.0001)
  double max_peak_distance = 0.01;

  TwoDOptimization opt_2d;
  opt_2d.setMaxPeakDistance(max_peak_distance);

 	TEST_REAL_SIMILAR(max_peak_distance, opt_2d.getMaxPeakDistance())
END_SECTION

START_SECTION((double getMaxPeakDistance() const))
  TOLERANCE_ABSOLUTE(0.0001)
  double max_peak_distance = 0.01;

  TwoDOptimization opt_2d;
  opt_2d.setMaxPeakDistance(max_peak_distance);

 	TEST_REAL_SIMILAR(max_peak_distance, opt_2d.getMaxPeakDistance())
END_SECTION

START_SECTION((void setMZTolerance(double tolerance_mz)))
  TOLERANCE_ABSOLUTE(0.0001)
  double mz_tolerance = 0.01;

  TwoDOptimization opt_2d;
  opt_2d.setMZTolerance(mz_tolerance);

 	TEST_REAL_SIMILAR(mz_tolerance, opt_2d.getMZTolerance())
END_SECTION

START_SECTION((double getMZTolerance() const))
  TOLERANCE_ABSOLUTE(0.0001)
  double mz_tolerance = 0.01;

  TwoDOptimization opt_2d;
  opt_2d.setMZTolerance(mz_tolerance);

 	TEST_REAL_SIMILAR(mz_tolerance, opt_2d.getMZTolerance())
END_SECTION

START_SECTION((void setMaxIterations(UInt max_iteration)))
	UInt number = 20;

  TwoDOptimization opt_2d;
  opt_2d.setMaxIterations(number);

 	TEST_EQUAL(number == opt_2d.getMaxIterations(), true)
END_SECTION

START_SECTION((UInt getMaxIterations() const))
  UInt number = 20;

  TwoDOptimization opt_2d;
  opt_2d.setMaxIterations(number);

 	TEST_EQUAL(number == opt_2d.getMaxIterations(), true)
END_SECTION

START_SECTION((void setPenalties(OptimizationFunctions::PenaltyFactorsIntensity& penalties)))
  TOLERANCE_ABSOLUTE(0.0001)
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties;
  penalties.pos = 0;
  penalties.lWidth = 1;
  penalties.rWidth = 2;
  penalties.height = 3;

  TwoDOptimization opt_2d;
  opt_2d.setPenalties(penalties);
  TEST_REAL_SIMILAR(penalties.pos,opt_2d.getPenalties().pos)
  TEST_REAL_SIMILAR(penalties.lWidth,opt_2d.getPenalties().lWidth)
  TEST_REAL_SIMILAR(penalties.rWidth,opt_2d.getPenalties().rWidth)
	TEST_REAL_SIMILAR(penalties.height,opt_2d.getPenalties().height)
END_SECTION

START_SECTION((const OptimizationFunctions::PenaltyFactorsIntensity& getPenalties() const))
  TOLERANCE_ABSOLUTE(0.0001)
  struct OptimizationFunctions::PenaltyFactorsIntensity penalties;
  penalties.pos = 0;
  penalties.lWidth = 1;
  penalties.rWidth = 2;
  penalties.height = 3;

  TwoDOptimization opt_2d;
  opt_2d.setPenalties(penalties);
  TEST_REAL_SIMILAR(penalties.pos,opt_2d.getPenalties().pos)
  TEST_REAL_SIMILAR(penalties.lWidth,opt_2d.getPenalties().lWidth)
  TEST_REAL_SIMILAR(penalties.rWidth,opt_2d.getPenalties().rWidth)
	TEST_REAL_SIMILAR(penalties.height,opt_2d.getPenalties().height)
END_SECTION

/////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////
END_TEST

repository: OpenMS/OpenMS

repo_name: OpenMS/OpenMS

branch_name: refs/heads/develop

gha_license_id: NOASSERTION

extension: cpp


text:
// Copyright 2016 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package grumpy

import (
	"fmt"
	"reflect"
)

// CodeType is the object representing the Python 'code' type.
var CodeType = newBasisType("code", reflect.TypeOf(Code{}), toCodeUnsafe, ObjectType)

// CodeFlag is a switch controlling the behavior of a Code object.
type CodeFlag int

const (
	// CodeFlagVarArg means a Code object accepts *arg parameters.
	CodeFlagVarArg CodeFlag = 4
	// CodeFlagKWArg means a Code object accepts **kwarg parameters.
	CodeFlagKWArg CodeFlag = 8
)

// Code represents Python 'code' objects.
type Code struct {
	Object
	name     string `attr:"co_name"`
	filename string `attr:"co_filename"`
	// argc is the number of positional arguments.
	argc int `attr:"co_argcount"`
	// minArgc is the number of positional non-keyword arguments (i.e. the
	// minimum number of positional arguments that must be passed).
	minArgc int
	flags   CodeFlag `attr:"co_flags"`
	args    []FunctionArg
	fn      func(*Frame, []*Object) (*Object, *BaseException)
}

// NewCode creates a new Code object that executes the given fn.
func NewCode(name, filename string, args []FunctionArg, flags CodeFlag, fn func(*Frame, []*Object) (*Object, *BaseException)) *Code {
	argc := len(args)
	minArgc := 0
	for ; minArgc < argc; minArgc++ {
		if args[minArgc].Def != nil {
			break
		}
	}
	for _, arg := range args[minArgc:argc] {
		if arg.Def == nil {
			format := "%s() non-keyword arg %s after keyword arg"
			logFatal(fmt.Sprintf(format, name, arg.Name))
		}
	}
	return &Code{Object{typ: CodeType}, name, filename, argc, minArgc, flags, args, fn}
}

func toCodeUnsafe(o *Object) *Code {
	return (*Code)(o.toPointer())
}

// Eval runs the code object c in the context of the given globals.
func (c *Code) Eval(f *Frame, globals *Dict, args Args, kwargs KWArgs) (*Object, *BaseException) {
	// Validate parameters.
	argc := len(args)
	if argc > c.argc && c.flags&CodeFlagVarArg == 0 {
		format := "%s() takes %d arguments (%d given)"
		return nil, f.RaiseType(TypeErrorType, fmt.Sprintf(format, c.name, c.argc, argc))
	}
	numBodyArgs := c.argc
	varArgIndex, kwArgIndex := -1, -1
	if c.flags&CodeFlagVarArg != 0 {
		varArgIndex = numBodyArgs
		numBodyArgs++
	}
	if c.flags&CodeFlagKWArg != 0 {
		kwArgIndex = numBodyArgs
		numBodyArgs++
	}
	bodyArgs := f.MakeArgs(numBodyArgs)
	i := 0
	for ; i < argc && i < c.argc; i++ {
		bodyArgs[i] = args[i]
	}
	if varArgIndex != -1 {
		bodyArgs[varArgIndex] = NewTuple(args[i:].makeCopy()...).ToObject()
	}
	var kwargDict *Dict
	if kwArgIndex != -1 {
		kwargDict = NewDict()
		bodyArgs[kwArgIndex] = kwargDict.ToObject()
	}
	for _, kw := range kwargs {
		name := kw.Name
		j := 0
		for ; j < c.argc; j++ {
			if c.args[j].Name == name {
				if bodyArgs[j] != nil {
					format := "%s() got multiple values for keyword argument '%s'"
					return nil, f.RaiseType(TypeErrorType, fmt.Sprintf(format, c.name, name))
				}
				bodyArgs[j] = kw.Value
				break
			}
		}
		if j == c.argc {
			if kwargDict == nil {
				format := "%s() got an unexpected keyword argument '%s'"
				return nil, f.RaiseType(TypeErrorType, fmt.Sprintf(format, c.name, name))
			}
			if raised := kwargDict.SetItemString(f, name, kw.Value); raised != nil {
				return nil, raised
			}
		}
	}
	for ; i < c.argc; i++ {
		arg := c.args[i]
		if bodyArgs[i] == nil {
			if arg.Def == nil {
				format := "%s() takes at least %d arguments (%d given)"
				return nil, f.RaiseType(TypeErrorType, fmt.Sprintf(format, c.name, c.minArgc, argc))
			}
			bodyArgs[i] = arg.Def
		}
	}
	oldExc, oldTraceback := f.ExcInfo()
	next := newFrame(f)
	next.code = c
	next.globals = globals
	ret, raised := c.fn(next, bodyArgs)
	f.FreeArgs(bodyArgs)
	if raised == nil {
		// Restore exc_info to what it was when we left the previous
		// frame.
		f.RestoreExc(oldExc, oldTraceback)
		if ret == nil {
			ret = None
		}
	} else {
		_, tb := f.ExcInfo()
		tb = newTraceback(f, tb)
		f.RestoreExc(raised, tb)
	}
	return ret, raised
}

repository: paulsmith/grumpy

repo_name: paulsmith/grumpy


text:
# Recipe created by recipetool
SUMMARY = "YANG-based configuration and operational state data store for Unix/Linux applications."
DESCRIPTION = ""
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ef345f161efb68c3836e6f5648b2312f"

SRC_URI = "git://github.com/sysrepo/sysrepo.git;protocol=https;branch=devel file://sysrepo"

PV = "2.2.71+git${SRCPV}"
SRCREV = "b828f0ab4693c613cc66efd053a146e05854d5c8"

S = "${WORKDIR}/git"

DEPENDS = "libyang protobuf protobuf-c protobuf-c-native libredblack libev libnetconf2"

FILES:${PN} += "/usr/share/yang/* /usr/lib/sysrepo-plugind/*"

inherit cmake pkgconfig python3native python3-dir

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = " -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String=Release -DBUILD_EXAMPLES:String=False -DENABLE_TESTS:String=False -DREPOSITORY_LOC:PATH=/etc/sysrepo  -DCALL_TARGET_BINS_DIRECTLY=False -DGEN_LANGUAGE_BINDINGS:String=False "

BBCLASSEXTEND = "native nativesdk"

do_install:append () {
    install -d ${D}/etc/sysrepo/data/notifications
    install -d ${D}/etc/sysrepo/yang
    install -o root -g root ${S}/modules/ietf-netconf-notifications.yang ${D}/etc/sysrepo/yang/ietf-netconf-notifications@2012-02-06.yang
    install -o root -g root ${S}/modules/ietf-netconf-with-defaults.yang ${D}/etc/sysrepo/yang/ietf-netconf-with-defaults@2011-06-01.yang
    install -o root -g root ${S}/modules/ietf-netconf.yang ${D}/etc/sysrepo/yang/ietf-netconf@2011-06-01.yang
    install -d ${D}/etc/init.d
    install -m 0775 ${WORKDIR}/sysrepo ${D}/etc/init.d/
    install -d ${D}/usr/lib/sysrepo/plugins
}

license: MIT

repository: rcn-ee/meta-arago

repo_name: rcn-ee/meta-arago

extension: bb


text:
@Manual{R-base,
  title = {R: A Language and Environment for Statistical Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2020},
  url = {https://www.R-project.org/},
}
@Manual{R-papaja,
  author = {Frederik Aust and Marius Barth},
  title = {{papaja}: {Create} {APA} manuscripts with {R Markdown}},
  year = {2020},
  note = {R package version 0.1.0.9997},
  url = {https://github.com/crsh/papaja},
}
@Manual{R-dplyr,
  title = {dplyr: A Grammar of Data Manipulation},
  author = {Hadley Wickham and Romain François and Lionel {
             Henry} and Kirill Müller},
  year = {2020},
  note = {R package version 1.0.2},
  url = {https://CRAN.R-project.org/package=dplyr},
}
@Manual{R-forcats,
  title = {forcats: Tools for Working with Categorical Variables (Factors)},
  author = {Hadley Wickham},
  year = {2020},
  note = {R package version 0.5.0},
  url = {https://CRAN.R-project.org/package=forcats},
}
@Book{R-ggplot2,
  author = {Hadley Wickham},
  title = {ggplot2: Elegant Graphics for Data Analysis},
  publisher = {Springer-Verlag New York},
  year = {2016},
  isbn = {978-3-319-24277-4},
  url = {https://ggplot2.tidyverse.org},
}
@Manual{R-janitor,
  title = {janitor: Simple Tools for Examining and Cleaning Dirty Data},
  author = {Sam Firke},
  year = {2020},
  note = {R package version 2.0.1},
  url = {https://CRAN.R-project.org/package=janitor},
}
@Book{R-knitr,
  title = {Dynamic Documents with {R} and knitr},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2015},
  edition = {2nd},
  note = {ISBN 978-1498716963},
  url = {https://yihui.org/knitr/},
}
@Manual{R-magrittr,
  title = {magrittr: A Forward-Pipe Operator for R},
  author = {Stefan Milton Bache and Hadley Wickham},
  year = {2014},
  note = {R package version 1.5},
  url = {https://CRAN.R-project.org/package=magrittr},
}
@Manual{R-purrr,
  title = {purrr: Functional Programming Tools},
  author = {Lionel Henry and Hadley Wickham},
  year = {2020},
  note = {R package version 0.3.4},
  url = {https://CRAN.R-project.org/package=purrr},
}
@Manual{R-readr,
  title = {readr: Read Rectangular Text Data},
  author = {Hadley Wickham and Jim Hester and Romain Francois},
  year = {2018},
  note = {R package version 1.3.1},
  url = {https://CRAN.R-project.org/package=readr},
}
@Manual{R-rio,
  title = {rio: A Swiss-army knife for data file I/O},
  author = {Chung-hong Chan and Geoffrey CH Chan and Thomas J. Leeper and Jason Becker},
  year = {2018},
  note = {R package version 0.5.16},
}
@Manual{R-stringr,
  title = {stringr: Simple, Consistent Wrappers for Common String Operations},
  author = {Hadley Wickham},
  year = {2019},
  note = {R package version 1.4.0},
  url = {https://CRAN.R-project.org/package=stringr},
}
@Manual{R-tibble,
  title = {tibble: Simple Data Frames},
  author = {Kirill Müller and Hadley Wickham},
  year = {2020},
  note = {R package version 3.0.3},
  url = {https://CRAN.R-project.org/package=tibble},
}
@Manual{R-tidyr,
  title = {tidyr: Tidy Messy Data},
  author = {Hadley Wickham},
  year = {2020},
  note = {R package version 1.1.2},
  url = {https://CRAN.R-project.org/package=tidyr},
}
@Article{R-tidyverse,
  title = {Welcome to the {tidyverse}},
  author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani},
  year = {2019},
  journal = {Journal of Open Source Software},
  volume = {4},
  number = {43},
  pages = {1686},
  doi = {10.21105/joss.01686},
}
@Manual{R-here,
  title = {here: A Simpler Way to Find Your Files},
  author = {Kirill Müller},
  year = {2017},
  note = {R package version 0.1},
  url = {https://CRAN.R-project.org/package=here},
}
@Manual{R-kableExtra,
  title = {kableExtra: Construct Complex Table with 'kable' and Pipe Syntax},
  author = {Hao Zhu},
  year = {2020},
  note = {R package version 1.3.1},
  url = {https://CRAN.R-project.org/package=kableExtra},
}
@Manual{R-usmap,
  title = {usmap: US Maps Including Alaska and Hawaii},
  author = {Paolo {Di Lorenzo}},
  year = {2020},
  note = {R package version 0.5.1},
  url = {https://CRAN.R-project.org/package=usmap},
}
@Manual{R-broom,
  title = {broom: Convert Statistical Objects into Tidy Tibbles},
  author = {David Robinson and Alex Hayes and Simon Couch},
  year = {2020},
  note = {R package version 0.7.2},
  url = {https://CRAN.R-project.org/package=broom},
}
@Manual{R-corx,
  title = {corx: Create and Format Correlation Matrices},
  author = {James Conigrave},
  year = {2020},
  note = {R package version 1.0.6.1},
  url = {https://CRAN.R-project.org/package=corx},
}
@Article{R-sjmisc,
  title = {sjmisc: Data and Variable Transformation Functions.},
  volume = {3},
  doi = {10.21105/joss.00754},
  number = {26},
  journal = {Journal of Open Source Software},
  author = {Daniel Lüdecke},
  year = {2018},
  pages = {754},
}
@Manual{R-scales,
  title = {scales: Scale Functions for Visualization},
  author = {Hadley Wickham and Dana Seidel},
  year = {2020},
  note = {R package version 1.1.1},
  url = {https://CRAN.R-project.org/package=scales},
}
@Manual{R-ggpubr,
  title = {ggpubr: 'ggplot2' Based Publication Ready Plots},
  author = {Alboukadel Kassambara},
  year = {2020},
  note = {R package version 0.4.0},
  url = {https://CRAN.R-project.org/package=ggpubr},
}
@misc{data6science,
  title={Science Lab, 2018," County Presidential Election Returns 2000-2016},
  author={Data, MIT Election},
  publisher={Harvard}
}
@techreport{giuliano2020,
  title={Who voted for Trump? Populism and social capital},
  author={Giuliano, Paola and Wacziarg, Romain},
  year={2020},
  institution={National Bureau of Economic Research}
}
@article{jottier2012,
  title={Does social capital increase political accountability? An empirical test for Flemish municipalities},
  author={Jottier, Dimi and Heyndels, Bruno},
  journal={Public Choice},
  volume={150},
  number={3-4},
  pages={731--744},
  year={2012},
  publisher={Springer}
}
@article{la1998,
  title={Social capital, social networks, and political participation},
  author={La Due Lake, Ronald and Huckfeldt, Robert},
  journal={Political Psychology},
  volume={19},
  number={3},
  pages={567--584},
  year={1998},
  publisher={Wiley Online Library}
}
@article{lee2020,
  title={Golfing with Trump. Social capital, decline, inequality, and the rise of populism in the US},
  author={Lee, Neil and Lipp, Cornelius and Rodriguez-Pose, Andres},
  journal={Social Capital, Decline, Inequality, and the Rise of Populism in the Us (September 2020). CEPR Discussion Paper No. DP15259},
  year={2020}
}
@book{morales2016,
  title={Social capital, political participation and migration in Europe: making multicultural democracy work?},
  author={Morales, Laura and Giugni, Marco},
  year={2016},
  publisher={Springer}
}
@incollection{putnam2000,
  title={Bowling alone: America’s declining social capital},
  author={Putnam, Robert D},
  booktitle={Culture and politics},
  pages={223--234},
  year={2000},
  publisher={Springer}
}
@article{rupasingha2006,
  title={The production of social capital in US counties},
  author={Rupasingha, Anil and Goetz, Stephan J and Freshwater, David},
  journal={The journal of socio-economics},
  volume={35},
  number={1},
  pages={83--101},
  year={2006},
  publisher={Elsevier}
}

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: TeX

extension: bib


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: go.chromium.org/luci/scheduler/appengine/messages/config.proto

package messages

import (
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	_ "go.chromium.org/luci/common/proto"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type Acl_Role int32

const (
	// Can do read-only operations, such as listing invocations of a Job.
	Acl_READER Acl_Role = 0
	// Can emit triggers for a Job.
	//
	// Being TRIGGERER implicitly grants READER permission.
	Acl_TRIGGERER Acl_Role = 2
	// Same as READER + TRIGGERER + can modify state of a Job or Invocation such
	// as aborting them.
	// LUCI scheduler (this service) is an OWNER of each `Job` and `Trigger`,
	// thus `Trigger`s are allowed to trigger all `Job`s defined in the same
	// project, regardless of their respective ACLs.
	Acl_OWNER Acl_Role = 1
)

var Acl_Role_name = map[int32]string{
	0: "READER",
	2: "TRIGGERER",
	1: "OWNER",
}

var Acl_Role_value = map[string]int32{
	"READER":    0,
	"TRIGGERER": 2,
	"OWNER":     1,
}

func (x Acl_Role) String() string {
	return proto.EnumName(Acl_Role_name, int32(x))
}

func (Acl_Role) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{1, 0}
}

type TriggeringPolicy_Kind int32

const (
	// A placeholder for unrecognized policy kind.
	TriggeringPolicy_UNDEFINED TriggeringPolicy_Kind = 0
	// A greedy triggering function that takes all pending triggers (up to
	// max_batch_size limit) and collapses them into one new invocation,
	// deriving its properties from the most recent trigger alone. It doesn't
	// wait for a full batch, nor tries to batch evenly.
	TriggeringPolicy_GREEDY_BATCHING TriggeringPolicy_Kind = 1
	// A logarithmic triggering function that takes log_k N pending triggers (up
	// to max_batch_size limit) and collapses them into one new incovation,
	// deriving its properties from the most recent trigger alone, where N is
	// the total number of pending triggers and k is specified by the log_base
	// field below.
	TriggeringPolicy_LOGARITHMIC_BATCHING TriggeringPolicy_Kind = 2
)

var TriggeringPolicy_Kind_name = map[int32]string{
	0: "UNDEFINED",
	1: "GREEDY_BATCHING",
	2: "LOGARITHMIC_BATCHING",
}

var TriggeringPolicy_Kind_value = map[string]int32{
	"UNDEFINED":            0,
	"GREEDY_BATCHING":      1,
	"LOGARITHMIC_BATCHING": 2,
}

func (x TriggeringPolicy_Kind) String() string {
	return proto.EnumName(TriggeringPolicy_Kind_name, int32(x))
}

func (TriggeringPolicy_Kind) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{4, 0}
}

// ProjectConfig defines a schema for a config file that describe jobs belonging
// to some project.
type ProjectConfig struct {
	// Job is a set of jobs defined in the project.
	Job []*Job `protobuf:"bytes,1,rep,name=job,proto3" json:"job,omitempty"`
	// Trigger is a set of triggering jobs defined in the project.
	Trigger []*Trigger `protobuf:"bytes,2,rep,name=trigger,proto3" json:"trigger,omitempty"`
	// A list of ACL sets. Names must be unique.
	AclSets []*AclSet `protobuf:"bytes,3,rep,name=acl_sets,json=aclSets,proto3" json:"acl_sets,omitempty"`
	// A set of security options to be enabled individually for the project.
	SecurityOptions      *SecurityOptions `protobuf:"bytes,4,opt,name=security_options,json=securityOptions,proto3" json:"security_options,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *ProjectConfig) Reset()         { *m = ProjectConfig{} }
func (m *ProjectConfig) String() string { return proto.CompactTextString(m) }
func (*ProjectConfig) ProtoMessage()    {}
func (*ProjectConfig) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{0}
}

func (m *ProjectConfig) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ProjectConfig.Unmarshal(m, b)
}
func (m *ProjectConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ProjectConfig.Marshal(b, m, deterministic)
}
func (m *ProjectConfig) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ProjectConfig.Merge(m, src)
}
func (m *ProjectConfig) XXX_Size() int {
	return xxx_messageInfo_ProjectConfig.Size(m)
}
func (m *ProjectConfig) XXX_DiscardUnknown() {
	xxx_messageInfo_ProjectConfig.DiscardUnknown(m)
}

var xxx_messageInfo_ProjectConfig proto.InternalMessageInfo

func (m *ProjectConfig) GetJob() []*Job {
	if m != nil {
		return m.Job
	}
	return nil
}

func (m *ProjectConfig) GetTrigger() []*Trigger {
	if m != nil {
		return m.Trigger
	}
	return nil
}

func (m *ProjectConfig) GetAclSets() []*AclSet {
	if m != nil {
		return m.AclSets
	}
	return nil
}

func (m *ProjectConfig) GetSecurityOptions() *SecurityOptions {
	if m != nil {
		return m.SecurityOptions
	}
	return nil
}

// A single access control rule.
type Acl struct {
	// Role denotes a list of actions that an identity can perform.
	Role Acl_Role `protobuf:"varint,1,opt,name=role,proto3,enum=scheduler.config.Acl_Role" json:"role,omitempty"`
	// Either email or "group:xyz" or auth service identity string "kind:name".
	GrantedTo            string   `protobuf:"bytes,2,opt,name=granted_to,json=grantedTo,proto3" json:"granted_to,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Acl) Reset()         { *m = Acl{} }
func (m *Acl) String() string { return proto.CompactTextString(m) }
func (*Acl) ProtoMessage()    {}
func (*Acl) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{1}
}

func (m *Acl) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Acl.Unmarshal(m, b)
}
func (m *Acl) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Acl.Marshal(b, m, deterministic)
}
func (m *Acl) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Acl.Merge(m, src)
}
func (m *Acl) XXX_Size() int {
	return xxx_messageInfo_Acl.Size(m)
}
func (m *Acl) XXX_DiscardUnknown() {
	xxx_messageInfo_Acl.DiscardUnknown(m)
}

var xxx_messageInfo_Acl proto.InternalMessageInfo

func (m *Acl) GetRole() Acl_Role {
	if m != nil {
		return m.Role
	}
	return Acl_READER
}

func (m *Acl) GetGrantedTo() string {
	if m != nil {
		return m.GrantedTo
	}
	return ""
}

// A set of Acl messages. Can be referenced in a Job or Trigger by name.
type AclSet struct {
	// A name of the ACL set, unique for a project.
	// Required. Must match regex '^[0-9A-Za-z_\-\.]{1,100}$'.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// List of access control rules.
	// The order does not matter.
	Acls                 []*Acl   `protobuf:"bytes,2,rep,name=acls,proto3" json:"acls,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *AclSet) Reset()         { *m = AclSet{} }
func (m *AclSet) String() string { return proto.CompactTextString(m) }
func (*AclSet) ProtoMessage()    {}
func (*AclSet) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{2}
}

func (m *AclSet) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_AclSet.Unmarshal(m, b)
}
func (m *AclSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_AclSet.Marshal(b, m, deterministic)
}
func (m *AclSet) XXX_Merge(src proto.Message) {
	xxx_messageInfo_AclSet.Merge(m, src)
}
func (m *AclSet) XXX_Size() int {
	return xxx_messageInfo_AclSet.Size(m)
}
func (m *AclSet) XXX_DiscardUnknown() {
	xxx_messageInfo_AclSet.DiscardUnknown(m)
}

var xxx_messageInfo_AclSet proto.InternalMessageInfo

func (m *AclSet) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

func (m *AclSet) GetAcls() []*Acl {
	if m != nil {
		return m.Acls
	}
	return nil
}

// SecurityOptions enable project specific security features.
type SecurityOptions struct {
	// Enables the use of project scoped service accounts.
	ProjectScopedServiceAccounts bool     `protobuf:"varint,1,opt,name=project_scoped_service_accounts,json=projectScopedServiceAccounts,proto3" json:"project_scoped_service_accounts,omitempty"`
	XXX_NoUnkeyedLiteral         struct{} `json:"-"`
	XXX_unrecognized             []byte   `json:"-"`
	XXX_sizecache                int32    `json:"-"`
}

func (m *SecurityOptions) Reset()         { *m = SecurityOptions{} }
func (m *SecurityOptions) String() string { return proto.CompactTextString(m) }
func (*SecurityOptions) ProtoMessage()    {}
func (*SecurityOptions) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{3}
}

func (m *SecurityOptions) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_SecurityOptions.Unmarshal(m, b)
}
func (m *SecurityOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_SecurityOptions.Marshal(b, m, deterministic)
}
func (m *SecurityOptions) XXX_Merge(src proto.Message) {
	xxx_messageInfo_SecurityOptions.Merge(m, src)
}
func (m *SecurityOptions) XXX_Size() int {
	return xxx_messageInfo_SecurityOptions.Size(m)
}
func (m *SecurityOptions) XXX_DiscardUnknown() {
	xxx_messageInfo_SecurityOptions.DiscardUnknown(m)
}

var xxx_messageInfo_SecurityOptions proto.InternalMessageInfo

func (m *SecurityOptions) GetProjectScopedServiceAccounts() bool {
	if m != nil {
		return m.ProjectScopedServiceAccounts
	}
	return false
}

// TriggeringPolicy defines a function that decides when and how to launch a
// job invocation, given the job's current state and a set of pending triggers.
type TriggeringPolicy struct {
	// Defines an algorithm to use for the triggering decisions.
	//
	// See comments for Kind enum field.
	//
	// Default is GREEDY_BATCHING.
	Kind TriggeringPolicy_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=scheduler.config.TriggeringPolicy_Kind" json:"kind,omitempty"`
	// Limits number of job invocations running at the same time.
	//
	// If the number of current active invocations is more or equal to this
	// setting, the triggering function will be skipped completely, since it isn't
	// allowed to trigger anything anyway.
	//
	// Default is 1.
	MaxConcurrentInvocations int64 `protobuf:"varint,2,opt,name=max_concurrent_invocations,json=maxConcurrentInvocations,proto3" json:"max_concurrent_invocations,omitempty"`
	// Limits how many triggers can be put into one invocation request.
	//
	// For example, setting this to 1 will make each trigger launch its own
	// invocation.
	//
	// Default is 1000 (which is ~= unlimited).
	MaxBatchSize int64 `protobuf:"varint,3,opt,name=max_batch_size,json=maxBatchSize,proto3" json:"max_batch_size,omitempty"`
	// Base of the logarithm operation during logarithmic batching.
	//
	// For example, setting this to 2, will cause 3 out of 8 pending triggers to
	// be combined into a single invocation with LOGARITHMIC_BATCHING kind. This
	// value is ignored by other policy kinds. Must be larger or equal to 1.0001
	// for numerical stability reasons.
	//
	// Required.
	LogBase              float32  `protobuf:"fixed32,4,opt,name=log_base,json=logBase,proto3" json:"log_base,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *TriggeringPolicy) Reset()         { *m = TriggeringPolicy{} }
func (m *TriggeringPolicy) String() string { return proto.CompactTextString(m) }
func (*TriggeringPolicy) ProtoMessage()    {}
func (*TriggeringPolicy) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{4}
}

func (m *TriggeringPolicy) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_TriggeringPolicy.Unmarshal(m, b)
}
func (m *TriggeringPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_TriggeringPolicy.Marshal(b, m, deterministic)
}
func (m *TriggeringPolicy) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TriggeringPolicy.Merge(m, src)
}
func (m *TriggeringPolicy) XXX_Size() int {
	return xxx_messageInfo_TriggeringPolicy.Size(m)
}
func (m *TriggeringPolicy) XXX_DiscardUnknown() {
	xxx_messageInfo_TriggeringPolicy.DiscardUnknown(m)
}

var xxx_messageInfo_TriggeringPolicy proto.InternalMessageInfo

func (m *TriggeringPolicy) GetKind() TriggeringPolicy_Kind {
	if m != nil {
		return m.Kind
	}
	return TriggeringPolicy_UNDEFINED
}

func (m *TriggeringPolicy) GetMaxConcurrentInvocations() int64 {
	if m != nil {
		return m.MaxConcurrentInvocations
	}
	return 0
}

func (m *TriggeringPolicy) GetMaxBatchSize() int64 {
	if m != nil {
		return m.MaxBatchSize
	}
	return 0
}

func (m *TriggeringPolicy) GetLogBase() float32 {
	if m != nil {
		return m.LogBase
	}
	return 0
}

// Job specifies a single regular job belonging to a project.
//
// Such jobs runs on a schedule or can be triggered by some trigger.
type Job struct {
	// Id is a name of the job (unique for the project).
	//
	// Must match '^[0-9A-Za-z_\-\. \)\(]{1,100}$'.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Schedule describes when to run the job.
	//
	// A job with a schedule can still be triggered by other triggering jobs
	// and via "Trigger" button in UI.
	//
	// Supported kinds of schedules (illustrated by examples):
	//   - "* 0 * * * *": cron-like expression, in a syntax supported by
	//     https://github.com/gorhill/cronexpr (see its docs for full reference).
	//     The cron engine will attempt to start a job at specified moments in
	//     time (based on UTC clock). If when triggering a job, previous
	//     invocation is still running, an overrun will be recorded (and next
	//     attempt to start a job happens based on the schedule, not when the
	//     previous invocation finishes). Some examples:
	//       "0 */3 * * * *" - each 3 hours: at 12:00 AM UTC, 3:00 AM UTC, ...
	//       "0 */3 * * *" - exact same thing (last field is optional)
	//       "0 1/3 * * *" - each 3 hours but starting 1:00 AM UTC
	//       "0 2,10,18 * * *" - at 2 AM UTC, 10 AM UTC, 6 PM UTC
	//       "0 7 * * *" - at 7 AM UTC, once a day.
	//   - "with 10s interval": runs invocations in a loop, waiting 10s after
	//     finishing invocation before starting a new one. Overruns are not
	//     possible.
	//   - "continuously" is alias for "with 0s interval", meaning the job will
	//     run in a loop without any pauses.
	//   - "triggered" schedule indicates that job is only started via a trigger.
	//
	// Default is "triggered".
	Schedule string `protobuf:"bytes,2,opt,name=schedule,proto3" json:"schedule,omitempty"`
	// Disabled is true to disable this job.
	//
	// Disabled job is equivalent to a deleted job: it can't be triggered, it
	// can't be referenced by other jobs and it doesn't show up in UI or API.
	//
	// Use this instead of commenting out the definition in case you want to
	// temporarily git rid of the job.
	Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"`
	// List of access control rules for the Job.
	// The order does not matter.
	// There can be at most 32 different acls for a Job, including those from
	// acl_sets.
	Acls []*Acl `protobuf:"bytes,5,rep,name=acls,proto3" json:"acls,omitempty"`
	// A list of ACL set names. Each ACL in each referenced ACL set will be
	// included in this Job.
	// The order does not matter.
	AclSets []string `protobuf:"bytes,6,rep,name=acl_sets,json=aclSets,proto3" json:"acl_sets,omitempty"`
	// TriggeringPolicy defines how job handles incoming triggering events.
	//
	// If not specified defaults to GREEDY_BATCHING with 1 max concurrent
	// invocation. See comments in TriggeringPolicy for more details.
	TriggeringPolicy *TriggeringPolicy `protobuf:"bytes,7,opt,name=triggering_policy,json=triggeringPolicy,proto3" json:"triggering_policy,omitempty"`
	// Noop is used for testing. It is "do nothing" task.
	Noop *NoopTask `protobuf:"bytes,100,opt,name=noop,proto3" json:"noop,omitempty"`
	// UrlFetch can be used to make a simple HTTP call.
	UrlFetch *UrlFetchTask `protobuf:"bytes,101,opt,name=url_fetch,json=urlFetch,proto3" json:"url_fetch,omitempty"`
	// BuildbucketTask can be used to schedule buildbucket job.
	Buildbucket          *BuildbucketTask `protobuf:"bytes,103,opt,name=buildbucket,proto3" json:"buildbucket,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *Job) Reset()         { *m = Job{} }
func (m *Job) String() string { return proto.CompactTextString(m) }
func (*Job) ProtoMessage()    {}
func (*Job) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{5}
}

func (m *Job) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Job.Unmarshal(m, b)
}
func (m *Job) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Job.Marshal(b, m, deterministic)
}
func (m *Job) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Job.Merge(m, src)
}
func (m *Job) XXX_Size() int {
	return xxx_messageInfo_Job.Size(m)
}
func (m *Job) XXX_DiscardUnknown() {
	xxx_messageInfo_Job.DiscardUnknown(m)
}

var xxx_messageInfo_Job proto.InternalMessageInfo

func (m *Job) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *Job) GetSchedule() string {
	if m != nil {
		return m.Schedule
	}
	return ""
}

func (m *Job) GetDisabled() bool {
	if m != nil {
		return m.Disabled
	}
	return false
}

func (m *Job) GetAcls() []*Acl {
	if m != nil {
		return m.Acls
	}
	return nil
}

func (m *Job) GetAclSets() []string {
	if m != nil {
		return m.AclSets
	}
	return nil
}

func (m *Job) GetTriggeringPolicy() *TriggeringPolicy {
	if m != nil {
		return m.TriggeringPolicy
	}
	return nil
}

func (m *Job) GetNoop() *NoopTask {
	if m != nil {
		return m.Noop
	}
	return nil
}

func (m *Job) GetUrlFetch() *UrlFetchTask {
	if m != nil {
		return m.UrlFetch
	}
	return nil
}

func (m *Job) GetBuildbucket() *BuildbucketTask {
	if m != nil {
		return m.Buildbucket
	}
	return nil
}

// Trigger specifies a job that triggers other jobs.
//
// It is a special kind of a job that periodically checks the state of the world
// and triggers other jobs.
type Trigger struct {
	// Id is a name of the job (unique for the project).
	//
	// Must match '^[0-9A-Za-z_\-\. \)\(]{1,100}$'. It's in the same namespace as
	// regular jobs.
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Schedule describes when to run this triggering job.
	//
	// See Job.schedule for more info. Default is "with 30s interval".
	Schedule string `protobuf:"bytes,2,opt,name=schedule,proto3" json:"schedule,omitempty"`
	// Disabled is true to disable this job.
	//
	// Se Job.disabled for more info.
	Disabled bool `protobuf:"varint,3,opt,name=disabled,proto3" json:"disabled,omitempty"`
	// ACLs, see Job.acls and Job.acl_sets.
	Acls    []*Acl   `protobuf:"bytes,4,rep,name=acls,proto3" json:"acls,omitempty"`
	AclSets []string `protobuf:"bytes,5,rep,name=acl_sets,json=aclSets,proto3" json:"acl_sets,omitempty"`
	// TriggeringPolicy defines how job handles incoming triggering events.
	//
	// It is rare for a trigger itself to have a non-default triggering policy,
	// so most likely you should not touch this field.
	TriggeringPolicy *TriggeringPolicy `protobuf:"bytes,6,opt,name=triggering_policy,json=triggeringPolicy,proto3" json:"triggering_policy,omitempty"`
	// Triggers are IDs of jobs triggered by this trigger.
	Triggers []string `protobuf:"bytes,200,rep,name=triggers,proto3" json:"triggers,omitempty"`
	// Noop is used for testing. It is "do nothing" trigger.
	Noop *NoopTask `protobuf:"bytes,100,opt,name=noop,proto3" json:"noop,omitempty"`
	// Gitiles is used to trigger jobs for new commits on Gitiles.
	Gitiles              *GitilesTask `protobuf:"bytes,101,opt,name=gitiles,proto3" json:"gitiles,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *Trigger) Reset()         { *m = Trigger{} }
func (m *Trigger) String() string { return proto.CompactTextString(m) }
func (*Trigger) ProtoMessage()    {}
func (*Trigger) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{6}
}

func (m *Trigger) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Trigger.Unmarshal(m, b)
}
func (m *Trigger) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Trigger.Marshal(b, m, deterministic)
}
func (m *Trigger) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Trigger.Merge(m, src)
}
func (m *Trigger) XXX_Size() int {
	return xxx_messageInfo_Trigger.Size(m)
}
func (m *Trigger) XXX_DiscardUnknown() {
	xxx_messageInfo_Trigger.DiscardUnknown(m)
}

var xxx_messageInfo_Trigger proto.InternalMessageInfo

func (m *Trigger) GetId() string {
	if m != nil {
		return m.Id
	}
	return ""
}

func (m *Trigger) GetSchedule() string {
	if m != nil {
		return m.Schedule
	}
	return ""
}

func (m *Trigger) GetDisabled() bool {
	if m != nil {
		return m.Disabled
	}
	return false
}

func (m *Trigger) GetAcls() []*Acl {
	if m != nil {
		return m.Acls
	}
	return nil
}

func (m *Trigger) GetAclSets() []string {
	if m != nil {
		return m.AclSets
	}
	return nil
}

func (m *Trigger) GetTriggeringPolicy() *TriggeringPolicy {
	if m != nil {
		return m.TriggeringPolicy
	}
	return nil
}

func (m *Trigger) GetTriggers() []string {
	if m != nil {
		return m.Triggers
	}
	return nil
}

func (m *Trigger) GetNoop() *NoopTask {
	if m != nil {
		return m.Noop
	}
	return nil
}

func (m *Trigger) GetGitiles() *GitilesTask {
	if m != nil {
		return m.Gitiles
	}
	return nil
}

// NoopTask is used for testing. It is a "do nothing" task that can emit fake
// triggers.
type NoopTask struct {
	SleepMs              int64    `protobuf:"varint,1,opt,name=sleep_ms,json=sleepMs,proto3" json:"sleep_ms,omitempty"`
	TriggersCount        int64    `protobuf:"varint,2,opt,name=triggers_count,json=triggersCount,proto3" json:"triggers_count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *NoopTask) Reset()         { *m = NoopTask{} }
func (m *NoopTask) String() string { return proto.CompactTextString(m) }
func (*NoopTask) ProtoMessage()    {}
func (*NoopTask) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{7}
}

func (m *NoopTask) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_NoopTask.Unmarshal(m, b)
}
func (m *NoopTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_NoopTask.Marshal(b, m, deterministic)
}
func (m *NoopTask) XXX_Merge(src proto.Message) {
	xxx_messageInfo_NoopTask.Merge(m, src)
}
func (m *NoopTask) XXX_Size() int {
	return xxx_messageInfo_NoopTask.Size(m)
}
func (m *NoopTask) XXX_DiscardUnknown() {
	xxx_messageInfo_NoopTask.DiscardUnknown(m)
}

var xxx_messageInfo_NoopTask proto.InternalMessageInfo

func (m *NoopTask) GetSleepMs() int64 {
	if m != nil {
		return m.SleepMs
	}
	return 0
}

func (m *NoopTask) GetTriggersCount() int64 {
	if m != nil {
		return m.TriggersCount
	}
	return 0
}

// GitilesTask specifies parameters of what repo and which refs to watch for new
// commits.
//
// GitilesTask will trigger other jobs if either:
//   * ref's tip has changed (e.g. new commit landed on a ref),
//   * a ref has just been created.
//
// LIMITATIONS:
//
//  1. Per each fast-forward ref's tip change as observed by scheduler,
//     no more than 50 latest (according to gitiles default ordering) commits
//     will result in emitted triggers.
//     This is a safeguard against mistaken or deliberate but unusual git push
//     actions, which typically don't have intent of triggering a build for each
//     such commit.
//     If you absolutely need to act on every new commit even in such cases,
//     you will need to roll your own implementation, though you may still find
//     Scheduler GitilesTask useful to trigger your code on new changes.
//
//  2. No hard latency guarantee. A single invocation of GitilesTask may not be
//     able to process all the backlog. This is particularly true after a config
//     change changes the set of watched ref. However, GitilesTask is designed
//     to make continuous progress with each invocation.
type GitilesTask struct {
	// Repo is the URL of the Gitiles repository.
	Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"`
	// Refs is a list of Git references to track.
	//
	// Each ref can be either:
	//   * a fully qualified ref like "refs/heads/master" or "refs/tags/v1.2.3"
	//   * a regular expression with "regexp:" prefix to match multiple refs, e.g.
	//     "regexp:refs/heads/[^/]+" or "regexp:refs/branch-heads/\d+\.\d+", but
	//     the regular expression should have a literal prefix with at least two
	//     slashes present, e.g. "refs/release-\d+/foobar" is not allowed, because
	//     the literal prefix "refs/release-" contains only one slash. The regexp
	//     should not start with ^ or end with $ as they will be added
	//     automatically.
	//
	// Each tracked ref, either fully qualified or regexp, must match at least 1
	// ref in gitiles output.
	Refs []string `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"`
	// Optional path_regexps and path_regexps_exclude are lists of regular
	// expressions limiting emitted triggers only to commits whose tree diff
	// touches relevant files.
	//
	// If neither path_regexps nor path_regexps_exclude is specified (default),
	// emits triggers for any commit.
	// Specifying just path_regexps_exclude is not allowed.
	//
	// path_regexps and path_regexps_exclude rules apply on each individual commit
	// independently. For each commit, a set of all filepaths referenced in Git
	// commit diff is used for matching.  On top of simple file additions and file
	// modifications, this also includes: file removals, file moves (old and new
	// path is considered), and changing of file metadata (e.g., chmod +x). This
	// doesn't include directories (git doesn't track them explicitly).
	//
	// Triggers are emitted for a commit if only if at least 1 touched filepath
	//  1. is not matched by any path_regexps_exclude,
	//  2. AND is matched at least 1 path_regexps
	// **subject to caveats below** for exceptional cases.
	//
	// Each path_regexps and path_regexps_exclude is a regular expression
	// "a/b/c/.+". It should not start with ^ or end with $ as they will be added
	// automatically.
	//
	// CAVEATS:
	//  1. path_regexps: ".+"
	//     will NOT match commits which modify no files (aka empty commits) and
	//     as such differs from default case of not specifying any `path_regexps`.
	//  2. Per GitilesTask doc, if a ref fast-forwards >=50 commits, only the last
	//     50 commits are checked. If none of them matches any path specified here,
	//     a single trigger is emitted for the ref's new tip.
	//     Rational: it's better to emit redundant triggers than silently not emit
	//     triggers for commits beyond latest 50.
	//     TODO(tandrii): it's possible to improve this by examining diff
	//     between ref's last and new tips, but one has to worry about gitiles
	//     taking potentially very long time to compute it.
	//  3. If a ref tip has just been created, a trigger would be emitted
	//     regardless of corresponding commit's diff.
	PathRegexps          []string `protobuf:"bytes,3,rep,name=path_regexps,json=pathRegexps,proto3" json:"path_regexps,omitempty"`
	PathRegexpsExclude   []string `protobuf:"bytes,4,rep,name=path_regexps_exclude,json=pathRegexpsExclude,proto3" json:"path_regexps_exclude,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GitilesTask) Reset()         { *m = GitilesTask{} }
func (m *GitilesTask) String() string { return proto.CompactTextString(m) }
func (*GitilesTask) ProtoMessage()    {}
func (*GitilesTask) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{8}
}

func (m *GitilesTask) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GitilesTask.Unmarshal(m, b)
}
func (m *GitilesTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GitilesTask.Marshal(b, m, deterministic)
}
func (m *GitilesTask) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GitilesTask.Merge(m, src)
}
func (m *GitilesTask) XXX_Size() int {
	return xxx_messageInfo_GitilesTask.Size(m)
}
func (m *GitilesTask) XXX_DiscardUnknown() {
	xxx_messageInfo_GitilesTask.DiscardUnknown(m)
}

var xxx_messageInfo_GitilesTask proto.InternalMessageInfo

func (m *GitilesTask) GetRepo() string {
	if m != nil {
		return m.Repo
	}
	return ""
}

func (m *GitilesTask) GetRefs() []string {
	if m != nil {
		return m.Refs
	}
	return nil
}

func (m *GitilesTask) GetPathRegexps() []string {
	if m != nil {
		return m.PathRegexps
	}
	return nil
}

func (m *GitilesTask) GetPathRegexpsExclude() []string {
	if m != nil {
		return m.PathRegexpsExclude
	}
	return nil
}

// UrlFetchTask specifies parameters for simple HTTP call.
type UrlFetchTask struct {
	// Method is HTTP method to use, such as "GET" or "POST". Default is "GET".
	Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	// Url to send the request to.
	Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"`
	// Timeout is how long to wait for request to complete. Default is 60 sec.
	TimeoutSec           int32    `protobuf:"varint,3,opt,name=timeout_sec,json=timeoutSec,proto3" json:"timeout_sec,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *UrlFetchTask) Reset()         { *m = UrlFetchTask{} }
func (m *UrlFetchTask) String() string { return proto.CompactTextString(m) }
func (*UrlFetchTask) ProtoMessage()    {}
func (*UrlFetchTask) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{9}
}

func (m *UrlFetchTask) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_UrlFetchTask.Unmarshal(m, b)
}
func (m *UrlFetchTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_UrlFetchTask.Marshal(b, m, deterministic)
}
func (m *UrlFetchTask) XXX_Merge(src proto.Message) {
	xxx_messageInfo_UrlFetchTask.Merge(m, src)
}
func (m *UrlFetchTask) XXX_Size() int {
	return xxx_messageInfo_UrlFetchTask.Size(m)
}
func (m *UrlFetchTask) XXX_DiscardUnknown() {
	xxx_messageInfo_UrlFetchTask.DiscardUnknown(m)
}

var xxx_messageInfo_UrlFetchTask proto.InternalMessageInfo

func (m *UrlFetchTask) GetMethod() string {
	if m != nil {
		return m.Method
	}
	return ""
}

func (m *UrlFetchTask) GetUrl() string {
	if m != nil {
		return m.Url
	}
	return ""
}

func (m *UrlFetchTask) GetTimeoutSec() int32 {
	if m != nil {
		return m.TimeoutSec
	}
	return 0
}

// BuildbucketTask specifies parameters of Buildbucket-based jobs.
type BuildbucketTask struct {
	// Server is hostname of the buildbucket service to use.
	// Typically, "cr-buildbucket.appspot.com".
	Server string `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"`
	// Bucket defines what bucket to add the task to.
	Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"`
	// Builder defines what to run.
	Builder string `protobuf:"bytes,3,opt,name=builder,proto3" json:"builder,omitempty"`
	// Properties is arbitrary "key:value" pairs describing the task.
	// TODO(tandrii): which properties will be overridden if triggered?
	Properties []string `protobuf:"bytes,4,rep,name=properties,proto3" json:"properties,omitempty"`
	// Tags is a list of tags (as "key:value" pairs) to assign to the task.
	Tags                 []string `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *BuildbucketTask) Reset()         { *m = BuildbucketTask{} }
func (m *BuildbucketTask) String() string { return proto.CompactTextString(m) }
func (*BuildbucketTask) ProtoMessage()    {}
func (*BuildbucketTask) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{10}
}

func (m *BuildbucketTask) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_BuildbucketTask.Unmarshal(m, b)
}
func (m *BuildbucketTask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_BuildbucketTask.Marshal(b, m, deterministic)
}
func (m *BuildbucketTask) XXX_Merge(src proto.Message) {
	xxx_messageInfo_BuildbucketTask.Merge(m, src)
}
func (m *BuildbucketTask) XXX_Size() int {
	return xxx_messageInfo_BuildbucketTask.Size(m)
}
func (m *BuildbucketTask) XXX_DiscardUnknown() {
	xxx_messageInfo_BuildbucketTask.DiscardUnknown(m)
}

var xxx_messageInfo_BuildbucketTask proto.InternalMessageInfo

func (m *BuildbucketTask) GetServer() string {
	if m != nil {
		return m.Server
	}
	return ""
}

func (m *BuildbucketTask) GetBucket() string {
	if m != nil {
		return m.Bucket
	}
	return ""
}

func (m *BuildbucketTask) GetBuilder() string {
	if m != nil {
		return m.Builder
	}
	return ""
}

func (m *BuildbucketTask) GetProperties() []string {
	if m != nil {
		return m.Properties
	}
	return nil
}

func (m *BuildbucketTask) GetTags() []string {
	if m != nil {
		return m.Tags
	}
	return nil
}

// TaskDefWrapper is a union type of all possible tasks known to the scheduler.
//
// It is used internally when storing jobs in the datastore.
type TaskDefWrapper struct {
	Noop                 *NoopTask        `protobuf:"bytes,1,opt,name=noop,proto3" json:"noop,omitempty"`
	UrlFetch             *UrlFetchTask    `protobuf:"bytes,2,opt,name=url_fetch,json=urlFetch,proto3" json:"url_fetch,omitempty"`
	Buildbucket          *BuildbucketTask `protobuf:"bytes,4,opt,name=buildbucket,proto3" json:"buildbucket,omitempty"`
	Gitiles              *GitilesTask     `protobuf:"bytes,5,opt,name=gitiles,proto3" json:"gitiles,omitempty"`
	XXX_NoUnkeyedLiteral struct{}         `json:"-"`
	XXX_unrecognized     []byte           `json:"-"`
	XXX_sizecache        int32            `json:"-"`
}

func (m *TaskDefWrapper) Reset()         { *m = TaskDefWrapper{} }
func (m *TaskDefWrapper) String() string { return proto.CompactTextString(m) }
func (*TaskDefWrapper) ProtoMessage()    {}
func (*TaskDefWrapper) Descriptor() ([]byte, []int) {
	return fileDescriptor_3b38e5823bccf1c5, []int{11}
}

func (m *TaskDefWrapper) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_TaskDefWrapper.Unmarshal(m, b)
}
func (m *TaskDefWrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_TaskDefWrapper.Marshal(b, m, deterministic)
}
func (m *TaskDefWrapper) XXX_Merge(src proto.Message) {
	xxx_messageInfo_TaskDefWrapper.Merge(m, src)
}
func (m *TaskDefWrapper) XXX_Size() int {
	return xxx_messageInfo_TaskDefWrapper.Size(m)
}
func (m *TaskDefWrapper) XXX_DiscardUnknown() {
	xxx_messageInfo_TaskDefWrapper.DiscardUnknown(m)
}

var xxx_messageInfo_TaskDefWrapper proto.InternalMessageInfo

func (m *TaskDefWrapper) GetNoop() *NoopTask {
	if m != nil {
		return m.Noop
	}
	return nil
}

func (m *TaskDefWrapper) GetUrlFetch() *UrlFetchTask {
	if m != nil {
		return m.UrlFetch
	}
	return nil
}

func (m *TaskDefWrapper) GetBuildbucket() *BuildbucketTask {
	if m != nil {
		return m.Buildbucket
	}
	return nil
}

func (m *TaskDefWrapper) GetGitiles() *GitilesTask {
	if m != nil {
		return m.Gitiles
	}
	return nil
}

func init() {
	proto.RegisterEnum("scheduler.config.Acl_Role", Acl_Role_name, Acl_Role_value)
	proto.RegisterEnum("scheduler.config.TriggeringPolicy_Kind", TriggeringPolicy_Kind_name, TriggeringPolicy_Kind_value)
	proto.RegisterType((*ProjectConfig)(nil), "scheduler.config.ProjectConfig")
	proto.RegisterType((*Acl)(nil), "scheduler.config.Acl")
	proto.RegisterType((*AclSet)(nil), "scheduler.config.AclSet")
	proto.RegisterType((*SecurityOptions)(nil), "scheduler.config.SecurityOptions")
	proto.RegisterType((*TriggeringPolicy)(nil), "scheduler.config.TriggeringPolicy")
	proto.RegisterType((*Job)(nil), "scheduler.config.Job")
	proto.RegisterType((*Trigger)(nil), "scheduler.config.Trigger")
	proto.RegisterType((*NoopTask)(nil), "scheduler.config.NoopTask")
	proto.RegisterType((*GitilesTask)(nil), "scheduler.config.GitilesTask")
	proto.RegisterType((*UrlFetchTask)(nil), "scheduler.config.UrlFetchTask")
	proto.RegisterType((*BuildbucketTask)(nil), "scheduler.config.BuildbucketTask")
	proto.RegisterType((*TaskDefWrapper)(nil), "scheduler.config.TaskDefWrapper")
}

func init() {
	proto.RegisterFile("go.chromium.org/luci/scheduler/appengine/messages/config.proto", fileDescriptor_3b38e5823bccf1c5)
}

var fileDescriptor_3b38e5823bccf1c5 = []byte{
	// 1094 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xc1, 0x6e, 0xdb, 0x46,
	0x13, 0x0e, 0x45, 0x4a, 0xa2, 0x46, 0x89, 0xcd, 0x7f, 0xff, 0xa4, 0x60, 0xdc, 0x26, 0x71, 0xd8,
	0x16, 0x71, 0x81, 0x56, 0x2a, 0x92, 0x43, 0x81, 0xa4, 0x28, 0x20, 0x4b, 0x8c, 0x22, 0xd7, 0xb1,
	0x83, 0x95, 0x82, 0x34, 0xbd, 0x10, 0xd4, 0x72, 0x45, 0x31, 0x26, 0xb9, 0xc4, 0xee, 0x32, 0x70,
	0x72, 0x6b, 0x8f, 0xbd, 0xf4, 0xd2, 0x27, 0xc8, 0xd3, 0xf4, 0x69, 0x8a, 0x3e, 0x41, 0x51, 0x70,
	0x49, 0xca, 0xaa, 0xed, 0x20, 0x75, 0xd2, 0x93, 0x38, 0xb3, 0xdf, 0x37, 0x3b, 0xbb, 0xdf, 0xcc,
	0x68, 0xe1, 0xbb, 0x90, 0xf5, 0xc8, 0x92, 0xb3, 0x24, 0xca, 0x93, 0x1e, 0xe3, 0x61, 0x3f, 0xce,
	0x49, 0xd4, 0x17, 0x64, 0x49, 0x83, 0x3c, 0xa6, 0xbc, 0xef, 0x67, 0x19, 0x4d, 0xc3, 0x28, 0xa5,
	0xfd, 0x84, 0x0a, 0xe1, 0x87, 0x54, 0xf4, 0x09, 0x4b, 0x17, 0x51, 0xd8, 0xcb, 0x38, 0x93, 0x0c,
	0x59, 0x2b, 0x68, 0xaf, 0xf4, 0x6f, 0xf5, 0xcf, 0x8d, 0x48, 0x58, 0x92, 0xb0, 0xb4, 0xaf, 0x48,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, 0xe1, 0x36, 0x6f, 0xa9, 0xf7, 0xd6, 0xbd, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x21,
	0x7a, 0x28, 0xf4, 0x09, 0x00, 0x00,
}

repository: linhailan/luci-go

repo_name: linhailan/luci-go


text:
//go:build openbsd
// +build openbsd

package net

import (
	"context"
	"errors"
	"fmt"
	"os/exec"
	"regexp"
	"strconv"
	"strings"
	"syscall"

	"github.com/gofiber/fiber/v2/internal/gopsutil/common"
)

var portMatch = regexp.MustCompile(`(.*)\.(\d+)$`)

func ParseNetstat(output string, mode string,
	iocs map[string]IOCountersStat) error {
	lines := strings.Split(output, "\n")

	exists := make([]string, 0, len(lines)-1)

	columns := 6
	if mode == "ind" {
		columns = 10
	}
	for _, line := range lines {
		values := strings.Fields(line)
		if len(values) < 1 || values[0] == "Name" {
			continue
		}
		if common.StringsHas(exists, values[0]) {
			// skip if already get
			continue
		}

		if len(values) < columns {
			continue
		}
		base := 1
		// sometimes Address is omitted
		if len(values) < columns {
			base = 0
		}

		parsed := make([]uint64, 0, 8)
		var vv []string
		if mode == "inb" {
			vv = []string{
				values[base+3], // BytesRecv
				values[base+4], // BytesSent
			}
		} else {
			vv = []string{
				values[base+3], // Ipkts
				values[base+4], // Ierrs
				values[base+5], // Opkts
				values[base+6], // Oerrs
				values[base+8], // Drops
			}
		}
		for _, target := range vv {
			if target == "-" {
				parsed = append(parsed, 0)
				continue
			}

			t, err := strconv.ParseUint(target, 10, 64)
			if err != nil {
				return err
			}
			parsed = append(parsed, t)
		}
		exists = append(exists, values[0])

		n, present := iocs[values[0]]
		if !present {
			n = IOCountersStat{Name: values[0]}
		}
		if mode == "inb" {
			n.BytesRecv = parsed[0]
			n.BytesSent = parsed[1]
		} else {
			n.PacketsRecv = parsed[0]
			n.Errin = parsed[1]
			n.PacketsSent = parsed[2]
			n.Errout = parsed[3]
			n.Dropin = parsed[4]
			n.Dropout = parsed[4]
		}

		iocs[n.Name] = n
	}
	return nil
}

func IOCounters(pernic bool) ([]IOCountersStat, error) {
	return IOCountersWithContext(context.Background(), pernic)
}

func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat, error) {
	netstat, err := exec.LookPath("netstat")
	if err != nil {
		return nil, err
	}
	out, err := invoke.CommandWithContext(ctx, netstat, "-inb")
	if err != nil {
		return nil, err
	}
	out2, err := invoke.CommandWithContext(ctx, netstat, "-ind")
	if err != nil {
		return nil, err
	}
	iocs := make(map[string]IOCountersStat)

	lines := strings.Split(string(out), "\n")
	ret := make([]IOCountersStat, 0, len(lines)-1)

	err = ParseNetstat(string(out), "inb", iocs)
	if err != nil {
		return nil, err
	}
	err = ParseNetstat(string(out2), "ind", iocs)
	if err != nil {
		return nil, err
	}

	for _, ioc := range iocs {
		ret = append(ret, ioc)
	}

	if pernic == false {
		return getIOCountersAll(ret)
	}

	return ret, nil
}

// NetIOCountersByFile is an method which is added just a compatibility for linux.
func IOCountersByFile(pernic bool, filename string) ([]IOCountersStat, error) {
	return IOCountersByFileWithContext(context.Background(), pernic, filename)
}

func IOCountersByFileWithContext(ctx context.Context, pernic bool, filename string) ([]IOCountersStat, error) {
	return IOCounters(pernic)
}

func FilterCounters() ([]FilterStat, error) {
	return FilterCountersWithContext(context.Background())
}

func FilterCountersWithContext(ctx context.Context) ([]FilterStat, error) {
	return nil, errors.New("NetFilterCounters not implemented for openbsd")
}

func ConntrackStats(percpu bool) ([]ConntrackStat, error) {
	return ConntrackStatsWithContext(context.Background(), percpu)
}

func ConntrackStatsWithContext(ctx context.Context, percpu bool) ([]ConntrackStat, error) {
	return nil, common.ErrNotImplementedError
}

// NetProtoCounters returns network statistics for the entire system
// If protocols is empty then all protocols are returned, otherwise
// just the protocols in the list are returned.
// Not Implemented for OpenBSD
func ProtoCounters(protocols []string) ([]ProtoCountersStat, error) {
	return ProtoCountersWithContext(context.Background(), protocols)
}

func ProtoCountersWithContext(ctx context.Context, protocols []string) ([]ProtoCountersStat, error) {
	return nil, errors.New("NetProtoCounters not implemented for openbsd")
}

func parseNetstatLine(line string) (ConnectionStat, error) {
	f := strings.Fields(line)
	if len(f) < 5 {
		return ConnectionStat{}, fmt.Errorf("wrong line,%s", line)
	}

	var netType, netFamily uint32
	switch f[0] {
	case "tcp":
		netType = syscall.SOCK_STREAM
		netFamily = syscall.AF_INET
	case "udp":
		netType = syscall.SOCK_DGRAM
		netFamily = syscall.AF_INET
	case "tcp6":
		netType = syscall.SOCK_STREAM
		netFamily = syscall.AF_INET6
	case "udp6":
		netType = syscall.SOCK_DGRAM
		netFamily = syscall.AF_INET6
	default:
		return ConnectionStat{}, fmt.Errorf("unknown type, %s", f[0])
	}

	laddr, raddr, err := parseNetstatAddr(f[3], f[4], netFamily)
	if err != nil {
		return ConnectionStat{}, fmt.Errorf("failed to parse netaddr, %s %s", f[3], f[4])
	}

	n := ConnectionStat{
		Fd:     uint32(0), // not supported
		Family: uint32(netFamily),
		Type:   uint32(netType),
		Laddr:  laddr,
		Raddr:  raddr,
		Pid:    int32(0), // not supported
	}
	if len(f) == 6 {
		n.Status = f[5]
	}

	return n, nil
}

func parseNetstatAddr(local string, remote string, family uint32) (laddr Addr, raddr Addr, err error) {
	parse := func(l string) (Addr, error) {
		matches := portMatch.FindStringSubmatch(l)
		if matches == nil {
			return Addr{}, fmt.Errorf("wrong addr, %s", l)
		}
		host := matches[1]
		port := matches[2]
		if host == "*" {
			switch family {
			case syscall.AF_INET:
				host = "0.0.0.0"
			case syscall.AF_INET6:
				host = "::"
			default:
				return Addr{}, fmt.Errorf("unknown family, %d", family)
			}
		}
		lport, err := strconv.Atoi(port)
		if err != nil {
			return Addr{}, err
		}
		return Addr{IP: host, Port: uint32(lport)}, nil
	}

	laddr, err = parse(local)
	if remote != "*.*" { // remote addr exists
		raddr, err = parse(remote)
		if err != nil {
			return laddr, raddr, err
		}
	}

	return laddr, raddr, err
}

// Return a list of network connections opened.
func Connections(kind string) ([]ConnectionStat, error) {
	return ConnectionsWithContext(context.Background(), kind)
}

func ConnectionsWithContext(ctx context.Context, kind string) ([]ConnectionStat, error) {
	var ret []ConnectionStat

	args := []string{"-na"}
	switch strings.ToLower(kind) {
	default:
		fallthrough
	case "":
		fallthrough
	case "all":
		fallthrough
	case "inet":
		// nothing to add
	case "inet4":
		args = append(args, "-finet")
	case "inet6":
		args = append(args, "-finet6")
	case "tcp":
		args = append(args, "-ptcp")
	case "tcp4":
		args = append(args, "-ptcp", "-finet")
	case "tcp6":
		args = append(args, "-ptcp", "-finet6")
	case "udp":
		args = append(args, "-pudp")
	case "udp4":
		args = append(args, "-pudp", "-finet")
	case "udp6":
		args = append(args, "-pudp", "-finet6")
	case "unix":
		return ret, common.ErrNotImplementedError
	}

	netstat, err := exec.LookPath("netstat")
	if err != nil {
		return nil, err
	}
	out, err := invoke.CommandWithContext(ctx, netstat, args...)

	if err != nil {
		return nil, err
	}
	lines := strings.Split(string(out), "\n")
	for _, line := range lines {
		if !(strings.HasPrefix(line, "tcp") || strings.HasPrefix(line, "udp")) {
			continue
		}
		n, err := parseNetstatLine(line)
		if err != nil {
			continue
		}

		ret = append(ret, n)
	}

	return ret, nil
}

repository: gofiber/fiber

repo_name: gofiber/fiber


text:
DESCRIPTION = "multi threaded daap server for POSIX Systems: iTunes Server."
SECTION = "console/network"
PRIORITY = "optional"
MAINTAINER = "NSLU2 Linux <nslu2-linux@yahoogroups.com>"
DEPENDS = "zlib gdbm libid3tag"
PR = "r2"
LICENSE = "GPL"

SRC_URI = "http://optusnet.dl.sourceforge.net/sourceforge/mt-daapd/mt-daapd-0.2.1.1.tar.gz \
	   file://mt-daapd.init"
S = "${WORKDIR}/mt-daapd-0.2.1.1/"

inherit autotools update-rc.d

INITSCRIPT_NAME = "mt-daapd"
INITSCRIPT_PARAMS = "defaults 84"

EXTRA_OECONF = "ac_cv_func_setpgrp_void=yes"

do_install() {
	autotools_do_install
	install -d ${D}${sysconfdir}
	install -d ${D}${sysconfdir}/init.d
	install -m 0644 ${S}contrib/mt-daapd.conf ${D}${sysconfdir}
	install -m 0755 ${WORKDIR}/mt-daapd.init ${D}${sysconfdir}/init.d/mt-daapd
}

CONFFILES_${PN} = "${sysconfdir}/mt-daapd.conf"

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
package resourcedelete

import (
	"fmt"
	"sync"
	"time"

	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/klog/v2"
)

const DeleteAnnotation = "release.openshift.io/delete"

type Resource struct {
	Kind      string
	Namespace string
	Name      string
}

type deleteTimes struct {
	Requested time.Time
	Expected  *metav1.Time
	Verified  time.Time
}

var (
	deletedResources = struct {
		lock sync.RWMutex
		m    map[Resource]deleteTimes
	}{m: make(map[Resource]deleteTimes)}
)

// ValidDeleteAnnotation returns whether the delete annotation is found and an error if it is found
// but not set to "true".
func ValidDeleteAnnotation(annotations map[string]string) (bool, error) {
	if value, ok := annotations[DeleteAnnotation]; !ok {
		return false, nil
	} else if value != "true" {
		return true, fmt.Errorf("Invalid delete annotation \"%s\" value: \"%s\"", DeleteAnnotation, value)
	}
	return true, nil
}

func (r Resource) uniqueName() string {
	if len(r.Namespace) == 0 {
		return r.Name
	}
	return r.Namespace + "/" + r.Name
}

func (r Resource) String() string {
	return fmt.Sprintf("%s \"%s\"", r.Kind, r.uniqueName())
}

// SetDeleteRequested creates or updates entry in map to indicate resource deletion has been requested.
func SetDeleteRequested(obj metav1.Object, resource Resource) {
	times := deleteTimes{
		Requested: time.Now(),
		Expected:  obj.GetDeletionTimestamp(),
	}
	deletedResources.lock.Lock()
	deletedResources.m[resource] = times
	deletedResources.lock.Unlock()
	klog.V(2).Infof("Delete requested for %s.", resource)
}

// SetDeleteVerified updates map entry to indicate resource deletion has been completed.
func SetDeleteVerified(resource Resource) {
	times := deleteTimes{
		Verified: time.Now(),
	}
	deletedResources.lock.Lock()
	deletedResources.m[resource] = times
	deletedResources.lock.Unlock()
	klog.V(2).Infof("Delete of %s completed.", resource)
}

// getDeleteTimes returns map entry for given resource.
func getDeleteTimes(resource Resource) (deleteTimes, bool) {
	deletedResources.lock.Lock()
	defer deletedResources.lock.Unlock()
	deletionTimes, ok := deletedResources.m[resource]
	return deletionTimes, ok
}

// setDeleteRequestedAndVerified creates or updates a map entry to indicate resource deletion has been requested
// and completed.
func setDeleteRequestedAndVerified(resource Resource) {
	times := deleteTimes{
		Requested: time.Now(),
		Verified:  time.Now(),
	}
	deletedResources.lock.Lock()
	deletedResources.m[resource] = times
	deletedResources.lock.Unlock()
	klog.Warningf("%s not found. It either has already been removed or it has never been installed on this cluster.", resource)
}

// GetDeleteProgress checks if resource deletion has been requested. If it has it checks if the deletion has completed
// and if not logs deletion progress. This method returns an indication of whether resource deletion has already been
// requested and any error that occurs.
func GetDeleteProgress(resource Resource, getError error) (bool, error) {
	if deletionTimes, ok := getDeleteTimes(resource); ok {
		if !deletionTimes.Verified.IsZero() {
			if getError == nil || !apierrors.IsNotFound(getError) {
				klog.Warningf("%s has reappeared after having been deleted at %s.", resource, deletionTimes.Verified.Format(time.RFC3339))
			}
		} else {
			if apierrors.IsNotFound(getError) {
				SetDeleteVerified(resource)
			} else {
				if deletionTimes.Expected != nil {
					klog.V(2).Infof("Delete of %s is expected by %s.", resource, deletionTimes.Expected.Format(time.RFC3339))
				} else {
					klog.V(2).Infof("Delete of %s has already been requested.", resource)
				}
			}
		}
		return true, nil
	}
	// During an upgrade CVO restarts one or more times. The resource may have been deleted during one of the
	// previous CVO life cycles. Simply set the resource as delete verified and log warning.
	if apierrors.IsNotFound(getError) {
		setDeleteRequestedAndVerified(resource)
		return true, nil
	}
	if getError != nil {
		return false, fmt.Errorf("Cannot get %s to delete, err=%v.", resource, getError)
	}
	return false, nil
}

// DeletesInProgress returns the set of resources for which deletion has been requested but not yet verified.
func DeletesInProgress() []string {
	deletedResources.lock.Lock()
	defer deletedResources.lock.Unlock()
	deletes := make([]string, 0, len(deletedResources.m))
	for k := range deletedResources.m {
		if deletedResources.m[k].Verified.IsZero() {
			deletes = append(deletes, k.String())
		}
	}
	return deletes
}

repository: openshift/cluster-version-operator

repo_name: openshift/cluster-version-operator