Andrey Kovalev
4 months ago
396 changed files with 201780 additions and 2153 deletions
@ -1,16 +1,16 @@
@@ -1,16 +1,16 @@
|
||||
module gitea.russia9.dev/Russia9/chatwars-offers |
||||
|
||||
go 1.18 |
||||
go 1.23 |
||||
|
||||
require ( |
||||
github.com/confluentinc/confluent-kafka-go v1.8.2 |
||||
github.com/rs/zerolog v1.26.1 |
||||
github.com/confluentinc/confluent-kafka-go v1.9.2 |
||||
github.com/rs/zerolog v1.33.0 |
||||
gopkg.in/tucnak/telebot.v2 v2.5.0 |
||||
) |
||||
|
||||
require ( |
||||
github.com/davecgh/go-spew v1.1.1 // indirect |
||||
github.com/mattn/go-colorable v0.1.13 // indirect |
||||
github.com/mattn/go-isatty v0.0.20 // indirect |
||||
github.com/pkg/errors v0.9.1 // indirect |
||||
github.com/stretchr/testify v1.7.0 // indirect |
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect |
||||
golang.org/x/sys v0.24.0 // indirect |
||||
) |
||||
|
@ -1,52 +1,236 @@
@@ -1,52 +1,236 @@
|
||||
github.com/confluentinc/confluent-kafka-go v1.8.2 h1:PBdbvYpyOdFLehj8j+9ba7FL4c4Moxn79gy9cYKxG5E= |
||||
github.com/confluentinc/confluent-kafka-go v1.8.2/go.mod h1:u2zNLny2xq+5rWeTQjFHbDzzNuba4P1vo31r9r4uAdg= |
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= |
||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= |
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= |
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= |
||||
github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu1fXES56uXniYFv4yDA= |
||||
github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= |
||||
github.com/actgardner/gogen-avro/v9 v9.1.0/go.mod h1:nyTj6wPqDJoxM3qdnjcLv+EnMDSDFqE0qDpva2QRmKc= |
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= |
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= |
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= |
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= |
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= |
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= |
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= |
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= |
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= |
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= |
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= |
||||
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= |
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= |
||||
github.com/confluentinc/confluent-kafka-go v1.9.2 h1:gV/GxhMBUb03tFWkN+7kdhg+zf+QUM+wVkI9zwh770Q= |
||||
github.com/confluentinc/confluent-kafka-go v1.9.2/go.mod h1:ptXNqsuDfYbAE/LBW6pnwWZElUoWxHoV8E43DCrliyo= |
||||
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= |
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= |
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= |
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= |
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= |
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= |
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= |
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= |
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= |
||||
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= |
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= |
||||
github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20= |
||||
github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= |
||||
github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= |
||||
github.com/frankban/quicktest v1.14.0/go.mod h1:NeW+ay9A/U67EYXNFA1nPE8e/tnQv/09mUdL/ijj8og= |
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= |
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= |
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= |
||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= |
||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= |
||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= |
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= |
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= |
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= |
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= |
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= |
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= |
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= |
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= |
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= |
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= |
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= |
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= |
||||
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= |
||||
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= |
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= |
||||
github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= |
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= |
||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= |
||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= |
||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= |
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= |
||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= |
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= |
||||
github.com/google/pprof v0.0.0-20211008130755-947d60d73cc0/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= |
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= |
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= |
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= |
||||
github.com/hamba/avro v1.5.6/go.mod h1:3vNT0RLXXpFm2Tb/5KC71ZRJlOroggq1Rcitb6k4Fr8= |
||||
github.com/heetch/avro v0.3.1/go.mod h1:4xn38Oz/+hiEUTpbVfGVLfvOg0yKLlRP7Q9+gJJILgA= |
||||
github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= |
||||
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= |
||||
github.com/invopop/jsonschema v0.4.0/go.mod h1:O9uiLokuu0+MGFlyiaqtWxwqJm41/+8Nj0lD7A36YH0= |
||||
github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= |
||||
github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= |
||||
github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= |
||||
github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= |
||||
github.com/jhump/protoreflect v1.12.0/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= |
||||
github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= |
||||
github.com/juju/qthttptest v0.1.1/go.mod h1:aTlAv8TYaflIiTDIQYzxnl1QdPjAg8Q8qJMErpKy6A4= |
||||
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= |
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= |
||||
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= |
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= |
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= |
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= |
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= |
||||
github.com/linkedin/goavro v2.1.0+incompatible/go.mod h1:bBCwI2eGYpUI/4820s67MElg9tdeLbINjLjiM2xZFYM= |
||||
github.com/linkedin/goavro/v2 v2.10.0/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= |
||||
github.com/linkedin/goavro/v2 v2.10.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= |
||||
github.com/linkedin/goavro/v2 v2.11.1/go.mod h1:UgQUb2N/pmueQYH9bfqFioWxzYCZXSfF8Jw03O5sjqA= |
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= |
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= |
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= |
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= |
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= |
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= |
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= |
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= |
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= |
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= |
||||
github.com/nrwiersma/avro-benchmarks v0.0.0-20210913175520-21aec48c8f76/go.mod h1:iKyFMidsk/sVYONJRE372sJuX/QTRPacU7imPqqsu7g= |
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= |
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= |
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= |
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= |
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= |
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= |
||||
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= |
||||
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc= |
||||
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc= |
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= |
||||
github.com/rogpeppe/clock v0.0.0-20190514195947-2896927a307a/go.mod h1:4r5QyqhjIWCcK8DO4KMclc5Iknq5qVBAlbYYzAbUScQ= |
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= |
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= |
||||
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= |
||||
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= |
||||
github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= |
||||
github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= |
||||
github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= |
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= |
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= |
||||
github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= |
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= |
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= |
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= |
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= |
||||
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= |
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= |
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= |
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= |
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= |
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= |
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= |
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= |
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= |
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= |
||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= |
||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= |
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= |
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= |
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= |
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= |
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= |
||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= |
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= |
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= |
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= |
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= |
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= |
||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= |
||||
golang.org/x/net v0.0.0-20200505041828-1ed23360d12c/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= |
||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= |
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= |
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= |
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= |
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= |
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= |
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= |
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= |
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= |
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= |
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= |
||||
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= |
||||
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= |
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= |
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= |
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= |
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= |
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= |
||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= |
||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= |
||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= |
||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= |
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= |
||||
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= |
||||
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= |
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= |
||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= |
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= |
||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= |
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= |
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= |
||||
google.golang.org/genproto v0.0.0-20220503193339-ba3ae3f07e29/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= |
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= |
||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= |
||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= |
||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= |
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= |
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= |
||||
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= |
||||
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= |
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= |
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= |
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= |
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= |
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= |
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= |
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= |
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= |
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= |
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= |
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= |
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= |
||||
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= |
||||
gopkg.in/avro.v0 v0.0.0-20171217001914-a730b5802183/go.mod h1:FvqrFXt+jCsyQibeRv4xxEJBL5iG2DDW5aeJwzDiq4A= |
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
||||
gopkg.in/errgo.v1 v1.0.0/go.mod h1:CxwszS/Xz1C49Ucd2i6Zil5UToP1EmyrFhKaMVbg1mk= |
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= |
||||
gopkg.in/httprequest.v1 v1.2.1/go.mod h1:x2Otw96yda5+8+6ZeWwHIJTFkEHWP/qP8pJOzqEtWPM= |
||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= |
||||
gopkg.in/retry.v1 v1.0.3/go.mod h1:FJkXmWiMaAo7xB+xhvDF59zhfjDWyzmyAxiT4dB688g= |
||||
gopkg.in/tucnak/telebot.v2 v2.5.0 h1:i+NynLo443Vp+Zn3Gv9JBjh3Z/PaiKAQwcnhNI7y6Po= |
||||
gopkg.in/tucnak/telebot.v2 v2.5.0/go.mod h1:BgaIIx50PSRS9pG59JH+geT82cfvoJU/IaI5TJdN3v8= |
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
||||
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= |
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= |
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= |
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= |
||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
// +build !dynamic
|
||||
|
||||
|
||||
// This file was auto-generated by librdkafka_vendor/bundle-import.sh, DO NOT EDIT.
|
||||
|
||||
package kafka |
||||
|
||||
// #cgo CFLAGS: -DUSE_VENDORED_LIBRDKAFKA -DLIBRDKAFKA_STATICLIB
|
||||
// #cgo LDFLAGS: ${SRCDIR}/librdkafka_vendor/librdkafka_darwin_arm64.a -lm -lsasl2 -ldl -lpthread -framework CoreFoundation -framework SystemConfiguration
|
||||
import "C" |
||||
|
||||
// LibrdkafkaLinkInfo explains how librdkafka was linked to the Go client
|
||||
const LibrdkafkaLinkInfo = "static darwin_arm64 from librdkafka-static-bundle-v1.9.2.tgz" |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,331 @@
@@ -0,0 +1,331 @@
|
||||
/*
|
||||
* librdkafka - Apache Kafka C library |
||||
* |
||||
* Copyright (c) 2019 Magnus Edenhill |
||||
* All rights reserved. |
||||
* |
||||
* Redistribution and use in source and binary forms, with or without |
||||
* modification, are permitted provided that the following conditions are met: |
||||
* |
||||
* 1. Redistributions of source code must retain the above copyright notice, |
||||
* this list of conditions and the following disclaimer. |
||||
* 2. 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. |
||||
* |
||||
* 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 THE COPYRIGHT OWNER OR CONTRIBUTORS 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. |
||||
*/ |
||||
|
||||
#ifndef _RDKAFKA_MOCK_H_ |
||||
#define _RDKAFKA_MOCK_H_ |
||||
|
||||
#ifndef _RDKAFKA_H_ |
||||
#error "rdkafka_mock.h must be included after rdkafka.h" |
||||
#endif |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#if 0 |
||||
} /* Restore indent */ |
||||
#endif |
||||
#endif |
||||
|
||||
|
||||
/**
|
||||
* @name Mock cluster |
||||
* |
||||
* Provides a mock Kafka cluster with a configurable number of brokers |
||||
* that support a reasonable subset of Kafka protocol operations, |
||||
* error injection, etc. |
||||
* |
||||
* There are two ways to use the mock clusters, the most simple approach |
||||
* is to configure `test.mock.num.brokers` (to e.g. 3) on the rd_kafka_t |
||||
* in an existing application, which will replace the configured |
||||
* `bootstrap.servers` with the mock cluster brokers. |
||||
* This approach is convenient to easily test existing applications. |
||||
* |
||||
* The second approach is to explicitly create a mock cluster on an |
||||
* rd_kafka_t instance by using rd_kafka_mock_cluster_new(). |
||||
* |
||||
* Mock clusters provide localhost listeners that can be used as the bootstrap |
||||
* servers by multiple rd_kafka_t instances. |
||||
* |
||||
* Currently supported functionality: |
||||
* - Producer |
||||
* - Idempotent Producer |
||||
* - Transactional Producer |
||||
* - Low-level consumer |
||||
* - High-level balanced consumer groups with offset commits |
||||
* - Topic Metadata and auto creation |
||||
* |
||||
* @remark High-level consumers making use of the balanced consumer groups |
||||
* are not supported. |
||||
* |
||||
* @remark This is an experimental public API that is NOT covered by the |
||||
* librdkafka API or ABI stability guarantees. |
||||
* |
||||
* |
||||
* @warning THIS IS AN EXPERIMENTAL API, SUBJECT TO CHANGE OR REMOVAL. |
||||
* |
||||
* @{ |
||||
*/ |
||||
|
||||
typedef struct rd_kafka_mock_cluster_s rd_kafka_mock_cluster_t; |
||||
|
||||
|
||||
/**
|
||||
* @brief Create new mock cluster with \p broker_cnt brokers. |
||||
* |
||||
* The broker ids will start at 1 up to and including \p broker_cnt. |
||||
* |
||||
* The \p rk instance is required for internal book keeping but continues |
||||
* to operate as usual. |
||||
*/ |
||||
RD_EXPORT |
||||
rd_kafka_mock_cluster_t *rd_kafka_mock_cluster_new (rd_kafka_t *rk, |
||||
int broker_cnt); |
||||
|
||||
|
||||
/**
|
||||
* @brief Destroy mock cluster. |
||||
*/ |
||||
RD_EXPORT |
||||
void rd_kafka_mock_cluster_destroy (rd_kafka_mock_cluster_t *mcluster); |
||||
|
||||
|
||||
|
||||
/**
|
||||
* @returns the rd_kafka_t instance for a cluster as passed to |
||||
* rd_kafka_mock_cluster_new(). |
||||
*/ |
||||
RD_EXPORT rd_kafka_t * |
||||
rd_kafka_mock_cluster_handle (const rd_kafka_mock_cluster_t *mcluster); |
||||
|
||||
|
||||
/**
|
||||
* @returns the rd_kafka_mock_cluster_t instance as created by |
||||
* setting the `test.mock.num.brokers` configuration property, |
||||
* or NULL if no such instance. |
||||
*/ |
||||
RD_EXPORT rd_kafka_mock_cluster_t * |
||||
rd_kafka_handle_mock_cluster (const rd_kafka_t *rk); |
||||
|
||||
|
||||
|
||||
/**
|
||||
* @returns the mock cluster's bootstrap.servers list |
||||
*/ |
||||
RD_EXPORT const char * |
||||
rd_kafka_mock_cluster_bootstraps (const rd_kafka_mock_cluster_t *mcluster); |
||||
|
||||
|
||||
/**
|
||||
* @brief Clear the cluster's error state for the given \p ApiKey. |
||||
*/ |
||||
RD_EXPORT |
||||
void rd_kafka_mock_clear_request_errors (rd_kafka_mock_cluster_t *mcluster, |
||||
int16_t ApiKey); |
||||
|
||||
|
||||
/**
|
||||
* @brief Push \p cnt errors in the \p ... va-arg list onto the cluster's |
||||
* error stack for the given \p ApiKey. |
||||
* |
||||
* \p ApiKey is the Kafka protocol request type, e.g., ProduceRequest (0). |
||||
* |
||||
* The following \p cnt protocol requests matching \p ApiKey will fail with the |
||||
* provided error code and removed from the stack, starting with |
||||
* the first error code, then the second, etc. |
||||
* |
||||
* Passing \c RD_KAFKA_RESP_ERR__TRANSPORT will make the mock broker |
||||
* disconnect the client which can be useful to trigger a disconnect on certain |
||||
* requests. |
||||
*/ |
||||
RD_EXPORT |
||||
void rd_kafka_mock_push_request_errors (rd_kafka_mock_cluster_t *mcluster, |
||||
int16_t ApiKey, size_t cnt, ...); |
||||
|
||||
|
||||
/**
|
||||
* @brief Same as rd_kafka_mock_push_request_errors() but takes |
||||
* an array of errors. |
||||
*/ |
||||
RD_EXPORT void |
||||
rd_kafka_mock_push_request_errors_array (rd_kafka_mock_cluster_t *mcluster, |
||||
int16_t ApiKey, |
||||
size_t cnt, |
||||
const rd_kafka_resp_err_t *errors); |
||||
|
||||
|
||||
/**
|
||||
* @brief Push \p cnt errors and RTT tuples in the \p ... va-arg list onto |
||||
* the broker's error stack for the given \p ApiKey. |
||||
* |
||||
* \p ApiKey is the Kafka protocol request type, e.g., ProduceRequest (0). |
||||
* |
||||
* Each entry is a tuple of: |
||||
* rd_kafka_resp_err_t err - error to return (or 0) |
||||
* int rtt_ms - response RTT/delay in milliseconds (or 0) |
||||
* |
||||
* The following \p cnt protocol requests matching \p ApiKey will fail with the |
||||
* provided error code and removed from the stack, starting with |
||||
* the first error code, then the second, etc. |
||||
* |
||||
* @remark The broker errors take precedence over the cluster errors. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_broker_push_request_error_rtts (rd_kafka_mock_cluster_t *mcluster, |
||||
int32_t broker_id, |
||||
int16_t ApiKey, size_t cnt, ...); |
||||
|
||||
|
||||
/**
|
||||
* @brief Set the topic error to return in protocol requests. |
||||
* |
||||
* Currently only used for TopicMetadataRequest and AddPartitionsToTxnRequest. |
||||
*/ |
||||
RD_EXPORT |
||||
void rd_kafka_mock_topic_set_error (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *topic, |
||||
rd_kafka_resp_err_t err); |
||||
|
||||
|
||||
/**
|
||||
* @brief Creates a topic. |
||||
* |
||||
* This is an alternative to automatic topic creation as performed by |
||||
* the client itself. |
||||
* |
||||
* @remark The Topic Admin API (CreateTopics) is not supported by the |
||||
* mock broker. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_topic_create (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *topic, int partition_cnt, |
||||
int replication_factor); |
||||
|
||||
|
||||
/**
|
||||
* @brief Sets the partition leader. |
||||
* |
||||
* The topic will be created if it does not exist. |
||||
* |
||||
* \p broker_id needs to be an existing broker, or -1 to make the |
||||
* partition leader-less. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_partition_set_leader (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *topic, int32_t partition, |
||||
int32_t broker_id); |
||||
|
||||
/**
|
||||
* @brief Sets the partition's preferred replica / follower. |
||||
* |
||||
* The topic will be created if it does not exist. |
||||
* |
||||
* \p broker_id does not need to point to an existing broker. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_partition_set_follower (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *topic, int32_t partition, |
||||
int32_t broker_id); |
||||
|
||||
/**
|
||||
* @brief Sets the partition's preferred replica / follower low and high |
||||
* watermarks. |
||||
* |
||||
* The topic will be created if it does not exist. |
||||
* |
||||
* Setting an offset to -1 will revert back to the leader's corresponding |
||||
* watermark. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_partition_set_follower_wmarks (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *topic, |
||||
int32_t partition, |
||||
int64_t lo, int64_t hi); |
||||
|
||||
|
||||
/**
|
||||
* @brief Disconnects the broker and disallows any new connections. |
||||
* This does NOT trigger leader change. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_broker_set_down (rd_kafka_mock_cluster_t *mcluster, |
||||
int32_t broker_id); |
||||
|
||||
/**
|
||||
* @brief Makes the broker accept connections again. |
||||
* This does NOT trigger leader change. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_broker_set_up (rd_kafka_mock_cluster_t *mcluster, |
||||
int32_t broker_id); |
||||
|
||||
|
||||
/**
|
||||
* @brief Set broker round-trip-time delay in milliseconds. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_broker_set_rtt (rd_kafka_mock_cluster_t *mcluster, |
||||
int32_t broker_id, int rtt_ms); |
||||
|
||||
/**
|
||||
* @brief Sets the broker's rack as reported in Metadata to the client. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_broker_set_rack (rd_kafka_mock_cluster_t *mcluster, |
||||
int32_t broker_id, const char *rack); |
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Explicitly sets the coordinator. If this API is not a standard |
||||
* hashing scheme will be used. |
||||
* |
||||
* @param key_type "transaction" or "group" |
||||
* @param key The transactional.id or group.id |
||||
* @param broker_id The new coordinator, does not have to be a valid broker. |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_coordinator_set (rd_kafka_mock_cluster_t *mcluster, |
||||
const char *key_type, const char *key, |
||||
int32_t broker_id); |
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Set the allowed ApiVersion range for \p ApiKey. |
||||
* |
||||
* Set \p MinVersion and \p MaxVersion to -1 to disable the API |
||||
* completely. |
||||
* |
||||
* \p MaxVersion MUST not exceed the maximum implemented value, |
||||
* see rdkafka_mock_handlers.c. |
||||
* |
||||
* @param ApiKey Protocol request type/key |
||||
* @param MinVersion Minimum version supported (or -1 to disable). |
||||
* @param MinVersion Maximum version supported (or -1 to disable). |
||||
*/ |
||||
RD_EXPORT rd_kafka_resp_err_t |
||||
rd_kafka_mock_set_apiversion (rd_kafka_mock_cluster_t *mcluster, |
||||
int16_t ApiKey, |
||||
int16_t MinVersion, int16_t MaxVersion); |
||||
|
||||
|
||||
/**@}*/ |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
#endif /* _RDKAFKA_MOCK_H_ */ |
@ -0,0 +1,84 @@
@@ -0,0 +1,84 @@
|
||||
/** |
||||
* Copyright 2022 Confluent Inc. |
||||
* |
||||
* 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 kafka |
||||
|
||||
import "unsafe" |
||||
|
||||
/* |
||||
#include <stdlib.h> |
||||
#include "select_rdkafka.h" |
||||
#include "glue_rdkafka.h" |
||||
*/ |
||||
import "C" |
||||
|
||||
// MockCluster represents a Kafka mock cluster instance which can be used
|
||||
// for testing.
|
||||
type MockCluster struct { |
||||
rk *C.rd_kafka_t |
||||
mcluster *C.rd_kafka_mock_cluster_t |
||||
} |
||||
|
||||
// NewMockCluster provides a mock Kafka cluster with a configurable
|
||||
// number of brokers that support a reasonable subset of Kafka protocol
|
||||
// operations, error injection, etc.
|
||||
//
|
||||
// Mock clusters provide localhost listeners that can be used as the bootstrap
|
||||
// servers by multiple Kafka client instances.
|
||||
//
|
||||
// Currently supported functionality:
|
||||
// - Producer
|
||||
// - Idempotent Producer
|
||||
// - Transactional Producer
|
||||
// - Low-level consumer
|
||||
// - High-level balanced consumer groups with offset commits
|
||||
// - Topic Metadata and auto creation
|
||||
//
|
||||
// Warning THIS IS AN EXPERIMENTAL API, SUBJECT TO CHANGE OR REMOVAL.
|
||||
func NewMockCluster(brokerCount int) (*MockCluster, error) { |
||||
|
||||
mc := &MockCluster{} |
||||
|
||||
cErrstr := (*C.char)(C.malloc(C.size_t(512))) |
||||
defer C.free(unsafe.Pointer(cErrstr)) |
||||
|
||||
cConf := C.rd_kafka_conf_new() |
||||
|
||||
mc.rk = C.rd_kafka_new(C.RD_KAFKA_PRODUCER, cConf, cErrstr, 256) |
||||
if mc.rk == nil { |
||||
C.rd_kafka_conf_destroy(cConf) |
||||
return nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr) |
||||
} |
||||
|
||||
mc.mcluster = C.rd_kafka_mock_cluster_new(mc.rk, C.int(brokerCount)) |
||||
if mc.mcluster == nil { |
||||
C.rd_kafka_destroy(mc.rk) |
||||
return nil, newErrorFromCString(C.RD_KAFKA_RESP_ERR__INVALID_ARG, cErrstr) |
||||
} |
||||
|
||||
return mc, nil |
||||
} |
||||
|
||||
// BootstrapServers returns the bootstrap.servers property for this MockCluster
|
||||
func (mc *MockCluster) BootstrapServers() string { |
||||
return C.GoString(C.rd_kafka_mock_cluster_bootstraps(mc.mcluster)) |
||||
} |
||||
|
||||
// Close and destroy the MockCluster
|
||||
func (mc *MockCluster) Close() { |
||||
C.rd_kafka_mock_cluster_destroy(mc.mcluster) |
||||
C.rd_kafka_destroy(mc.rk) |
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT) |
||||
|
||||
Copyright (c) 2016 Yasuhiro Matsumoto |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
# go-colorable |
||||
|
||||
[![Build Status](https://github.com/mattn/go-colorable/workflows/test/badge.svg)](https://github.com/mattn/go-colorable/actions?query=workflow%3Atest) |
||||
[![Codecov](https://codecov.io/gh/mattn/go-colorable/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-colorable) |
||||
[![GoDoc](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable) |
||||
[![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable) |
||||
|
||||
Colorable writer for windows. |
||||
|
||||
For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) |
||||
This package is possible to handle escape sequence for ansi color on windows. |
||||
|
||||
## Too Bad! |
||||
|
||||
![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) |
||||
|
||||
|
||||
## So Good! |
||||
|
||||
![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) |
||||
|
||||
## Usage |
||||
|
||||
```go |
||||
logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) |
||||
logrus.SetOutput(colorable.NewColorableStdout()) |
||||
|
||||
logrus.Info("succeeded") |
||||
logrus.Warn("not correct") |
||||
logrus.Error("something error") |
||||
logrus.Fatal("panic") |
||||
``` |
||||
|
||||
You can compile above code on non-windows OSs. |
||||
|
||||
## Installation |
||||
|
||||
``` |
||||
$ go get github.com/mattn/go-colorable |
||||
``` |
||||
|
||||
# License |
||||
|
||||
MIT |
||||
|
||||
# Author |
||||
|
||||
Yasuhiro Matsumoto (a.k.a mattn) |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
//go:build appengine
|
||||
// +build appengine
|
||||
|
||||
package colorable |
||||
|
||||
import ( |
||||
"io" |
||||
"os" |
||||
|
||||
_ "github.com/mattn/go-isatty" |
||||
) |
||||
|
||||
// NewColorable returns new instance of Writer which handles escape sequence.
|
||||
func NewColorable(file *os.File) io.Writer { |
||||
if file == nil { |
||||
panic("nil passed instead of *os.File to NewColorable()") |
||||
} |
||||
|
||||
return file |
||||
} |
||||
|
||||
// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
|
||||
func NewColorableStdout() io.Writer { |
||||
return os.Stdout |
||||
} |
||||
|
||||
// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
|
||||
func NewColorableStderr() io.Writer { |
||||
return os.Stderr |
||||
} |
||||
|
||||
// EnableColorsStdout enable colors if possible.
|
||||
func EnableColorsStdout(enabled *bool) func() { |
||||
if enabled != nil { |
||||
*enabled = true |
||||
} |
||||
return func() {} |
||||
} |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
//go:build !windows && !appengine
|
||||
// +build !windows,!appengine
|
||||
|
||||
package colorable |
||||
|
||||
import ( |
||||
"io" |
||||
"os" |
||||
|
||||
_ "github.com/mattn/go-isatty" |
||||
) |
||||
|
||||
// NewColorable returns new instance of Writer which handles escape sequence.
|
||||
func NewColorable(file *os.File) io.Writer { |
||||
if file == nil { |
||||
panic("nil passed instead of *os.File to NewColorable()") |
||||
} |
||||
|
||||
return file |
||||
} |
||||
|
||||
// NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
|
||||
func NewColorableStdout() io.Writer { |
||||
return os.Stdout |
||||
} |
||||
|
||||
// NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
|
||||
func NewColorableStderr() io.Writer { |
||||
return os.Stderr |
||||
} |
||||
|
||||
// EnableColorsStdout enable colors if possible.
|
||||
func EnableColorsStdout(enabled *bool) func() { |
||||
if enabled != nil { |
||||
*enabled = true |
||||
} |
||||
return func() {} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
echo "" > coverage.txt |
||||
|
||||
for d in $(go list ./... | grep -v vendor); do |
||||
go test -race -coverprofile=profile.out -covermode=atomic "$d" |
||||
if [ -f profile.out ]; then |
||||
cat profile.out >> coverage.txt |
||||
rm profile.out |
||||
fi |
||||
done |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
package colorable |
||||
|
||||
import ( |
||||
"bytes" |
||||
"io" |
||||
) |
||||
|
||||
// NonColorable holds writer but removes escape sequence.
|
||||
type NonColorable struct { |
||||
out io.Writer |
||||
} |
||||
|
||||
// NewNonColorable returns new instance of Writer which removes escape sequence from Writer.
|
||||
func NewNonColorable(w io.Writer) io.Writer { |
||||
return &NonColorable{out: w} |
||||
} |
||||
|
||||
// Write writes data on console
|
||||
func (w *NonColorable) Write(data []byte) (n int, err error) { |
||||
er := bytes.NewReader(data) |
||||
var plaintext bytes.Buffer |
||||
loop: |
||||
for { |
||||
c1, err := er.ReadByte() |
||||
if err != nil { |
||||
plaintext.WriteTo(w.out) |
||||
break loop |
||||
} |
||||
if c1 != 0x1b { |
||||
plaintext.WriteByte(c1) |
||||
continue |
||||
} |
||||
_, err = plaintext.WriteTo(w.out) |
||||
if err != nil { |
||||
break loop |
||||
} |
||||
c2, err := er.ReadByte() |
||||
if err != nil { |
||||
break loop |
||||
} |
||||
if c2 != 0x5b { |
||||
continue |
||||
} |
||||
|
||||
for { |
||||
c, err := er.ReadByte() |
||||
if err != nil { |
||||
break loop |
||||
} |
||||
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { |
||||
break |
||||
} |
||||
} |
||||
} |
||||
|
||||
return len(data), nil |
||||
} |
@ -0,0 +1,9 @@
@@ -0,0 +1,9 @@
|
||||
Copyright (c) Yasuhiro MATSUMOTO <mattn.jp@gmail.com> |
||||
|
||||
MIT License (Expat) |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
# go-isatty |
||||
|
||||
[![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) |
||||
[![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) |
||||
[![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) |
||||
[![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) |
||||
|
||||
isatty for golang |
||||
|
||||
## Usage |
||||
|
||||
```go |
||||
package main |
||||
|
||||
import ( |
||||
"fmt" |
||||
"github.com/mattn/go-isatty" |
||||
"os" |
||||
) |
||||
|
||||
func main() { |
||||
if isatty.IsTerminal(os.Stdout.Fd()) { |
||||
fmt.Println("Is Terminal") |
||||
} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { |
||||
fmt.Println("Is Cygwin/MSYS2 Terminal") |
||||
} else { |
||||
fmt.Println("Is Not Terminal") |
||||
} |
||||
} |
||||
``` |
||||
|
||||
## Installation |
||||
|
||||
``` |
||||
$ go get github.com/mattn/go-isatty |
||||
``` |
||||
|
||||
## License |
||||
|
||||
MIT |
||||
|
||||
## Author |
||||
|
||||
Yasuhiro Matsumoto (a.k.a mattn) |
||||
|
||||
## Thanks |
||||
|
||||
* k-takata: base idea for IsCygwinTerminal |
||||
|
||||
https://github.com/k-takata/go-iscygpty |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
// Package isatty implements interface to isatty
|
||||
package isatty |
@ -0,0 +1,12 @@
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash |
||||
|
||||
set -e |
||||
echo "" > coverage.txt |
||||
|
||||
for d in $(go list ./... | grep -v vendor); do |
||||
go test -race -coverprofile=profile.out -covermode=atomic "$d" |
||||
if [ -f profile.out ]; then |
||||
cat profile.out >> coverage.txt |
||||
rm profile.out |
||||
fi |
||||
done |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo
|
||||
// +build darwin freebsd openbsd netbsd dragonfly hurd
|
||||
// +build !appengine
|
||||
// +build !tinygo
|
||||
|
||||
package isatty |
||||
|
||||
import "golang.org/x/sys/unix" |
||||
|
||||
// IsTerminal return true if the file descriptor is terminal.
|
||||
func IsTerminal(fd uintptr) bool { |
||||
_, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) |
||||
return err == nil |
||||
} |
||||
|
||||
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
|
||||
// terminal. This is also always false on this environment.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
//go:build (appengine || js || nacl || tinygo || wasm) && !windows
|
||||
// +build appengine js nacl tinygo wasm
|
||||
// +build !windows
|
||||
|
||||
package isatty |
||||
|
||||
// IsTerminal returns true if the file descriptor is terminal which
|
||||
// is always false on js and appengine classic which is a sandboxed PaaS.
|
||||
func IsTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
||||
|
||||
// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
|
||||
// terminal. This is also always false on this environment.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
//go:build plan9
|
||||
// +build plan9
|
||||
|
||||
package isatty |
||||
|
||||
import ( |
||||
"syscall" |
||||
) |
||||
|
||||
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||
func IsTerminal(fd uintptr) bool { |
||||
path, err := syscall.Fd2path(int(fd)) |
||||
if err != nil { |
||||
return false |
||||
} |
||||
return path == "/dev/cons" || path == "/mnt/term/dev/cons" |
||||
} |
||||
|
||||
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
|
||||
// terminal. This is also always false on this environment.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
//go:build solaris && !appengine
|
||||
// +build solaris,!appengine
|
||||
|
||||
package isatty |
||||
|
||||
import ( |
||||
"golang.org/x/sys/unix" |
||||
) |
||||
|
||||
// IsTerminal returns true if the given file descriptor is a terminal.
|
||||
// see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c
|
||||
func IsTerminal(fd uintptr) bool { |
||||
_, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) |
||||
return err == nil |
||||
} |
||||
|
||||
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
|
||||
// terminal. This is also always false on this environment.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
//go:build (linux || aix || zos) && !appengine && !tinygo
|
||||
// +build linux aix zos
|
||||
// +build !appengine
|
||||
// +build !tinygo
|
||||
|
||||
package isatty |
||||
|
||||
import "golang.org/x/sys/unix" |
||||
|
||||
// IsTerminal return true if the file descriptor is terminal.
|
||||
func IsTerminal(fd uintptr) bool { |
||||
_, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) |
||||
return err == nil |
||||
} |
||||
|
||||
// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2
|
||||
// terminal. This is also always false on this environment.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
return false |
||||
} |
@ -0,0 +1,125 @@
@@ -0,0 +1,125 @@
|
||||
//go:build windows && !appengine
|
||||
// +build windows,!appengine
|
||||
|
||||
package isatty |
||||
|
||||
import ( |
||||
"errors" |
||||
"strings" |
||||
"syscall" |
||||
"unicode/utf16" |
||||
"unsafe" |
||||
) |
||||
|
||||
const ( |
||||
objectNameInfo uintptr = 1 |
||||
fileNameInfo = 2 |
||||
fileTypePipe = 3 |
||||
) |
||||
|
||||
var ( |
||||
kernel32 = syscall.NewLazyDLL("kernel32.dll") |
||||
ntdll = syscall.NewLazyDLL("ntdll.dll") |
||||
procGetConsoleMode = kernel32.NewProc("GetConsoleMode") |
||||
procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") |
||||
procGetFileType = kernel32.NewProc("GetFileType") |
||||
procNtQueryObject = ntdll.NewProc("NtQueryObject") |
||||
) |
||||
|
||||
func init() { |
||||
// Check if GetFileInformationByHandleEx is available.
|
||||
if procGetFileInformationByHandleEx.Find() != nil { |
||||
procGetFileInformationByHandleEx = nil |
||||
} |
||||
} |
||||
|
||||
// IsTerminal return true if the file descriptor is terminal.
|
||||
func IsTerminal(fd uintptr) bool { |
||||
var st uint32 |
||||
r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) |
||||
return r != 0 && e == 0 |
||||
} |
||||
|
||||
// Check pipe name is used for cygwin/msys2 pty.
|
||||
// Cygwin/MSYS2 PTY has a name like:
|
||||
// \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master
|
||||
func isCygwinPipeName(name string) bool { |
||||
token := strings.Split(name, "-") |
||||
if len(token) < 5 { |
||||
return false |
||||
} |
||||
|
||||
if token[0] != `\msys` && |
||||
token[0] != `\cygwin` && |
||||
token[0] != `\Device\NamedPipe\msys` && |
||||
token[0] != `\Device\NamedPipe\cygwin` { |
||||
return false |
||||
} |
||||
|
||||
if token[1] == "" { |
||||
return false |
||||
} |
||||
|
||||
if !strings.HasPrefix(token[2], "pty") { |
||||
return false |
||||
} |
||||
|
||||
if token[3] != `from` && token[3] != `to` { |
||||
return false |
||||
} |
||||
|
||||
if token[4] != "master" { |
||||
return false |
||||
} |
||||
|
||||
return true |
||||
} |
||||
|
||||
// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler
|
||||
// since GetFileInformationByHandleEx is not available under windows Vista and still some old fashion
|
||||
// guys are using Windows XP, this is a workaround for those guys, it will also work on system from
|
||||
// Windows vista to 10
|
||||
// see https://stackoverflow.com/a/18792477 for details
|
||||
func getFileNameByHandle(fd uintptr) (string, error) { |
||||
if procNtQueryObject == nil { |
||||
return "", errors.New("ntdll.dll: NtQueryObject not supported") |
||||
} |
||||
|
||||
var buf [4 + syscall.MAX_PATH]uint16 |
||||
var result int |
||||
r, _, e := syscall.Syscall6(procNtQueryObject.Addr(), 5, |
||||
fd, objectNameInfo, uintptr(unsafe.Pointer(&buf)), uintptr(2*len(buf)), uintptr(unsafe.Pointer(&result)), 0) |
||||
if r != 0 { |
||||
return "", e |
||||
} |
||||
return string(utf16.Decode(buf[4 : 4+buf[0]/2])), nil |
||||
} |
||||
|
||||
// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2
|
||||
// terminal.
|
||||
func IsCygwinTerminal(fd uintptr) bool { |
||||
if procGetFileInformationByHandleEx == nil { |
||||
name, err := getFileNameByHandle(fd) |
||||
if err != nil { |
||||
return false |
||||
} |
||||
return isCygwinPipeName(name) |
||||
} |
||||
|
||||
// Cygwin/msys's pty is a pipe.
|
||||
ft, _, e := syscall.Syscall(procGetFileType.Addr(), 1, fd, 0, 0) |
||||
if ft != fileTypePipe || e != 0 { |
||||
return false |
||||
} |
||||
|
||||
var buf [2 + syscall.MAX_PATH]uint16 |
||||
r, _, e := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), |
||||
4, fd, fileNameInfo, uintptr(unsafe.Pointer(&buf)), |
||||
uintptr(len(buf)*2), 0, 0) |
||||
if r == 0 || e != 0 { |
||||
return false |
||||
} |
||||
|
||||
l := *(*uint32)(unsafe.Pointer(&buf)) |
||||
return isCygwinPipeName(string(utf16.Decode(buf[2 : 2+l/2]))) |
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
{"time":"5:41PM","level":"info","message":"Starting listener","listen":":8080","pid":37556} |
||||
{"time":"5:41PM","level":"debug","message":"Access","database":"myapp","host":"localhost:4962","pid":37556} |
||||
{"time":"5:41PM","level":"info","message":"Access","method":"GET","path":"/users","pid":37556,"resp_time":23} |
||||
{"time":"5:41PM","level":"info","message":"Access","method":"POST","path":"/posts","pid":37556,"resp_time":532} |
||||
{"time":"5:41PM","level":"warn","message":"Slow request","method":"POST","path":"/posts","pid":37556,"resp_time":532} |
||||
{"time":"5:41PM","level":"info","message":"Access","method":"GET","path":"/users","pid":37556,"resp_time":10} |
||||
{"time":"5:41PM","level":"error","message":"Database connection lost","database":"myapp","pid":37556,"error":"connection reset by peer"} |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 116 KiB |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
Copyright 2009 The Go Authors. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are |
||||
met: |
||||
|
||||
* 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 Google LLC nor the names of its |
||||
contributors may be used to endorse or promote products derived from |
||||
this software without specific prior written permission. |
||||
|
||||
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 THE COPYRIGHT |
||||
OWNER OR CONTRIBUTORS 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. |
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
Additional IP Rights Grant (Patents) |
||||
|
||||
"This implementation" means the copyrightable works distributed by |
||||
Google as part of the Go project. |
||||
|
||||
Google hereby grants to You a perpetual, worldwide, non-exclusive, |
||||
no-charge, royalty-free, irrevocable (except as stated in this section) |
||||
patent license to make, have made, use, offer to sell, sell, import, |
||||
transfer and otherwise run, modify and propagate the contents of this |
||||
implementation of Go, where such license applies only to those patent |
||||
claims, both currently owned or controlled by Google and acquired in |
||||
the future, licensable by Google that are necessarily infringed by this |
||||
implementation of Go. This grant does not include claims that would be |
||||
infringed only as a consequence of further modification of this |
||||
implementation. If you or your agent or exclusive licensee institute or |
||||
order or agree to the institution of patent litigation against any |
||||
entity (including a cross-claim or counterclaim in a lawsuit) alleging |
||||
that this implementation of Go or any code incorporated within this |
||||
implementation of Go constitutes direct or contributory patent |
||||
infringement, or inducement of patent infringement, then any patent |
||||
rights granted to you under this License for this implementation of Go |
||||
shall terminate as of the date such litigation is filed. |
@ -0,0 +1,2 @@
@@ -0,0 +1,2 @@
|
||||
_obj/ |
||||
unix.test |
@ -0,0 +1,184 @@
@@ -0,0 +1,184 @@
|
||||
# Building `sys/unix` |
||||
|
||||
The sys/unix package provides access to the raw system call interface of the |
||||
underlying operating system. See: https://godoc.org/golang.org/x/sys/unix |
||||
|
||||
Porting Go to a new architecture/OS combination or adding syscalls, types, or |
||||
constants to an existing architecture/OS pair requires some manual effort; |
||||
however, there are tools that automate much of the process. |
||||
|
||||
## Build Systems |
||||
|
||||
There are currently two ways we generate the necessary files. We are currently |
||||
migrating the build system to use containers so the builds are reproducible. |
||||
This is being done on an OS-by-OS basis. Please update this documentation as |
||||
components of the build system change. |
||||
|
||||
### Old Build System (currently for `GOOS != "linux"`) |
||||
|
||||
The old build system generates the Go files based on the C header files |
||||
present on your system. This means that files |
||||
for a given GOOS/GOARCH pair must be generated on a system with that OS and |
||||
architecture. This also means that the generated code can differ from system |
||||
to system, based on differences in the header files. |
||||
|
||||
To avoid this, if you are using the old build system, only generate the Go |
||||
files on an installation with unmodified header files. It is also important to |
||||
keep track of which version of the OS the files were generated from (ex. |
||||
Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes |
||||
and have each OS upgrade correspond to a single change. |
||||
|
||||
To build the files for your current OS and architecture, make sure GOOS and |
||||
GOARCH are set correctly and run `mkall.sh`. This will generate the files for |
||||
your specific system. Running `mkall.sh -n` shows the commands that will be run. |
||||
|
||||
Requirements: bash, go |
||||
|
||||
### New Build System (currently for `GOOS == "linux"`) |
||||
|
||||
The new build system uses a Docker container to generate the go files directly |
||||
from source checkouts of the kernel and various system libraries. This means |
||||
that on any platform that supports Docker, all the files using the new build |
||||
system can be generated at once, and generated files will not change based on |
||||
what the person running the scripts has installed on their computer. |
||||
|
||||
The OS specific files for the new build system are located in the `${GOOS}` |
||||
directory, and the build is coordinated by the `${GOOS}/mkall.go` program. When |
||||
the kernel or system library updates, modify the Dockerfile at |
||||
`${GOOS}/Dockerfile` to checkout the new release of the source. |
||||
|
||||
To build all the files under the new build system, you must be on an amd64/Linux |
||||
system and have your GOOS and GOARCH set accordingly. Running `mkall.sh` will |
||||
then generate all of the files for all of the GOOS/GOARCH pairs in the new build |
||||
system. Running `mkall.sh -n` shows the commands that will be run. |
||||
|
||||
Requirements: bash, go, docker |
||||
|
||||
## Component files |
||||
|
||||
This section describes the various files used in the code generation process. |
||||
It also contains instructions on how to modify these files to add a new |
||||
architecture/OS or to add additional syscalls, types, or constants. Note that |
||||
if you are using the new build system, the scripts/programs cannot be called normally. |
||||
They must be called from within the docker container. |
||||
|
||||
### asm files |
||||
|
||||
The hand-written assembly file at `asm_${GOOS}_${GOARCH}.s` implements system |
||||
call dispatch. There are three entry points: |
||||
``` |
||||
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) |
||||
func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) |
||||
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) |
||||
``` |
||||
The first and second are the standard ones; they differ only in how many |
||||
arguments can be passed to the kernel. The third is for low-level use by the |
||||
ForkExec wrapper. Unlike the first two, it does not call into the scheduler to |
||||
let it know that a system call is running. |
||||
|
||||
When porting Go to a new architecture/OS, this file must be implemented for |
||||
each GOOS/GOARCH pair. |
||||
|
||||
### mksysnum |
||||
|
||||
Mksysnum is a Go program located at `${GOOS}/mksysnum.go` (or `mksysnum_${GOOS}.go` |
||||
for the old system). This program takes in a list of header files containing the |
||||
syscall number declarations and parses them to produce the corresponding list of |
||||
Go numeric constants. See `zsysnum_${GOOS}_${GOARCH}.go` for the generated |
||||
constants. |
||||
|
||||
Adding new syscall numbers is mostly done by running the build on a sufficiently |
||||
new installation of the target OS (or updating the source checkouts for the |
||||
new build system). However, depending on the OS, you may need to update the |
||||
parsing in mksysnum. |
||||
|
||||
### mksyscall.go |
||||
|
||||
The `syscall.go`, `syscall_${GOOS}.go`, `syscall_${GOOS}_${GOARCH}.go` are |
||||
hand-written Go files which implement system calls (for unix, the specific OS, |
||||
or the specific OS/Architecture pair respectively) that need special handling |
||||
and list `//sys` comments giving prototypes for ones that can be generated. |
||||
|
||||
The mksyscall.go program takes the `//sys` and `//sysnb` comments and converts |
||||
them into syscalls. This requires the name of the prototype in the comment to |
||||
match a syscall number in the `zsysnum_${GOOS}_${GOARCH}.go` file. The function |
||||
prototype can be exported (capitalized) or not. |
||||
|
||||
Adding a new syscall often just requires adding a new `//sys` function prototype |
||||
with the desired arguments and a capitalized name so it is exported. However, if |
||||
you want the interface to the syscall to be different, often one will make an |
||||
unexported `//sys` prototype, and then write a custom wrapper in |
||||
`syscall_${GOOS}.go`. |
||||
|
||||
### types files |
||||
|
||||
For each OS, there is a hand-written Go file at `${GOOS}/types.go` (or |
||||
`types_${GOOS}.go` on the old system). This file includes standard C headers and |
||||
creates Go type aliases to the corresponding C types. The file is then fed |
||||
through godef to get the Go compatible definitions. Finally, the generated code |
||||
is fed though mkpost.go to format the code correctly and remove any hidden or |
||||
private identifiers. This cleaned-up code is written to |
||||
`ztypes_${GOOS}_${GOARCH}.go`. |
||||
|
||||
The hardest part about preparing this file is figuring out which headers to |
||||
include and which symbols need to be `#define`d to get the actual data |
||||
structures that pass through to the kernel system calls. Some C libraries |
||||
preset alternate versions for binary compatibility and translate them on the |
||||
way in and out of system calls, but there is almost always a `#define` that can |
||||
get the real ones. |
||||
See `types_darwin.go` and `linux/types.go` for examples. |
||||
|
||||
To add a new type, add in the necessary include statement at the top of the |
||||
file (if it is not already there) and add in a type alias line. Note that if |
||||
your type is significantly different on different architectures, you may need |
||||
some `#if/#elif` macros in your include statements. |
||||
|
||||
### mkerrors.sh |
||||
|
||||
This script is used to generate the system's various constants. This doesn't |
||||
just include the error numbers and error strings, but also the signal numbers |
||||
and a wide variety of miscellaneous constants. The constants come from the list |
||||
of include files in the `includes_${uname}` variable. A regex then picks out |
||||
the desired `#define` statements, and generates the corresponding Go constants. |
||||
The error numbers and strings are generated from `#include <errno.h>`, and the |
||||
signal numbers and strings are generated from `#include <signal.h>`. All of |
||||
these constants are written to `zerrors_${GOOS}_${GOARCH}.go` via a C program, |
||||
`_errors.c`, which prints out all the constants. |
||||
|
||||
To add a constant, add the header that includes it to the appropriate variable. |
||||
Then, edit the regex (if necessary) to match the desired constant. Avoid making |
||||
the regex too broad to avoid matching unintended constants. |
||||
|
||||
### internal/mkmerge |
||||
|
||||
This program is used to extract duplicate const, func, and type declarations |
||||
from the generated architecture-specific files listed below, and merge these |
||||
into a common file for each OS. |
||||
|
||||
The merge is performed in the following steps: |
||||
1. Construct the set of common code that is idential in all architecture-specific files. |
||||
2. Write this common code to the merged file. |
||||
3. Remove the common code from all architecture-specific files. |
||||
|
||||
|
||||
## Generated files |
||||
|
||||
### `zerrors_${GOOS}_${GOARCH}.go` |
||||
|
||||
A file containing all of the system's generated error numbers, error strings, |
||||
signal numbers, and constants. Generated by `mkerrors.sh` (see above). |
||||
|
||||
### `zsyscall_${GOOS}_${GOARCH}.go` |
||||
|
||||
A file containing all the generated syscalls for a specific GOOS and GOARCH. |
||||
Generated by `mksyscall.go` (see above). |
||||
|
||||
### `zsysnum_${GOOS}_${GOARCH}.go` |
||||
|
||||
A list of numeric constants for all the syscall number of the specific GOOS |
||||
and GOARCH. Generated by mksysnum (see above). |
||||
|
||||
### `ztypes_${GOOS}_${GOARCH}.go` |
||||
|
||||
A file containing Go types for passing into (or returning from) syscalls. |
||||
Generated by godefs and the types file (see above). |
@ -0,0 +1,86 @@
@@ -0,0 +1,86 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// CPU affinity functions
|
||||
|
||||
package unix |
||||
|
||||
import ( |
||||
"math/bits" |
||||
"unsafe" |
||||
) |
||||
|
||||
const cpuSetSize = _CPU_SETSIZE / _NCPUBITS |
||||
|
||||
// CPUSet represents a CPU affinity mask.
|
||||
type CPUSet [cpuSetSize]cpuMask |
||||
|
||||
func schedAffinity(trap uintptr, pid int, set *CPUSet) error { |
||||
_, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) |
||||
if e != 0 { |
||||
return errnoErr(e) |
||||
} |
||||
return nil |
||||
} |
||||
|
||||
// SchedGetaffinity gets the CPU affinity mask of the thread specified by pid.
|
||||
// If pid is 0 the calling thread is used.
|
||||
func SchedGetaffinity(pid int, set *CPUSet) error { |
||||
return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) |
||||
} |
||||
|
||||
// SchedSetaffinity sets the CPU affinity mask of the thread specified by pid.
|
||||
// If pid is 0 the calling thread is used.
|
||||
func SchedSetaffinity(pid int, set *CPUSet) error { |
||||
return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) |
||||
} |
||||
|
||||
// Zero clears the set s, so that it contains no CPUs.
|
||||
func (s *CPUSet) Zero() { |
||||
for i := range s { |
||||
s[i] = 0 |
||||
} |
||||
} |
||||
|
||||
func cpuBitsIndex(cpu int) int { |
||||
return cpu / _NCPUBITS |
||||
} |
||||
|
||||
func cpuBitsMask(cpu int) cpuMask { |
||||
return cpuMask(1 << (uint(cpu) % _NCPUBITS)) |
||||
} |
||||
|
||||
// Set adds cpu to the set s.
|
||||
func (s *CPUSet) Set(cpu int) { |
||||
i := cpuBitsIndex(cpu) |
||||
if i < len(s) { |
||||
s[i] |= cpuBitsMask(cpu) |
||||
} |
||||
} |
||||
|
||||
// Clear removes cpu from the set s.
|
||||
func (s *CPUSet) Clear(cpu int) { |
||||
i := cpuBitsIndex(cpu) |
||||
if i < len(s) { |
||||
s[i] &^= cpuBitsMask(cpu) |
||||
} |
||||
} |
||||
|
||||
// IsSet reports whether cpu is in the set s.
|
||||
func (s *CPUSet) IsSet(cpu int) bool { |
||||
i := cpuBitsIndex(cpu) |
||||
if i < len(s) { |
||||
return s[i]&cpuBitsMask(cpu) != 0 |
||||
} |
||||
return false |
||||
} |
||||
|
||||
// Count returns the number of CPUs in the set s.
|
||||
func (s *CPUSet) Count() int { |
||||
c := 0 |
||||
for _, b := range s { |
||||
c += bits.OnesCount64(uint64(b)) |
||||
} |
||||
return c |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||
|
||||
package unix |
||||
|
||||
import "syscall" |
||||
|
||||
type Signal = syscall.Signal |
||||
type Errno = syscall.Errno |
||||
type SysProcAttr = syscall.SysProcAttr |
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
// Copyright 2018 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for ppc64, AIX are implemented in runtime/syscall_aix.go |
||||
// |
||||
|
||||
TEXT ·syscall6(SB),NOSPLIT,$0-88 |
||||
JMP syscall·syscall6(SB) |
||||
|
||||
TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 |
||||
JMP syscall·rawSyscall6(SB) |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// System call support for 386 BSD |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·RawSyscall6(SB) |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// System call support for AMD64 BSD |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// System call support for ARM BSD |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28 |
||||
B syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40 |
||||
B syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52 |
||||
B syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 |
||||
B syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 |
||||
B syscall·RawSyscall6(SB) |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// System call support for ARM64 BSD |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System call support for ppc64, BSD |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
// Copyright 2021 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// System call support for RISCV64 BSD |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-104 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for 386, Linux |
||||
// |
||||
|
||||
// See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 |
||||
// instead of the glibc-specific "CALL 0x10(GS)". |
||||
#define INVOKE_SYSCALL INT $0x80 |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 |
||||
CALL runtime·entersyscall(SB) |
||||
MOVL trap+0(FP), AX // syscall entry |
||||
MOVL a1+4(FP), BX |
||||
MOVL a2+8(FP), CX |
||||
MOVL a3+12(FP), DX |
||||
MOVL $0, SI |
||||
MOVL $0, DI |
||||
INVOKE_SYSCALL |
||||
MOVL AX, r1+16(FP) |
||||
MOVL DX, r2+20(FP) |
||||
CALL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 |
||||
MOVL trap+0(FP), AX // syscall entry |
||||
MOVL a1+4(FP), BX |
||||
MOVL a2+8(FP), CX |
||||
MOVL a3+12(FP), DX |
||||
MOVL $0, SI |
||||
MOVL $0, DI |
||||
INVOKE_SYSCALL |
||||
MOVL AX, r1+16(FP) |
||||
MOVL DX, r2+20(FP) |
||||
RET |
||||
|
||||
TEXT ·socketcall(SB),NOSPLIT,$0-36 |
||||
JMP syscall·socketcall(SB) |
||||
|
||||
TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 |
||||
JMP syscall·rawsocketcall(SB) |
||||
|
||||
TEXT ·seek(SB),NOSPLIT,$0-28 |
||||
JMP syscall·seek(SB) |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for AMD64, Linux |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
CALL runtime·entersyscall(SB) |
||||
MOVQ a1+8(FP), DI |
||||
MOVQ a2+16(FP), SI |
||||
MOVQ a3+24(FP), DX |
||||
MOVQ $0, R10 |
||||
MOVQ $0, R8 |
||||
MOVQ $0, R9 |
||||
MOVQ trap+0(FP), AX // syscall entry |
||||
SYSCALL |
||||
MOVQ AX, r1+32(FP) |
||||
MOVQ DX, r2+40(FP) |
||||
CALL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOVQ a1+8(FP), DI |
||||
MOVQ a2+16(FP), SI |
||||
MOVQ a3+24(FP), DX |
||||
MOVQ $0, R10 |
||||
MOVQ $0, R8 |
||||
MOVQ $0, R9 |
||||
MOVQ trap+0(FP), AX // syscall entry |
||||
SYSCALL |
||||
MOVQ AX, r1+32(FP) |
||||
MOVQ DX, r2+40(FP) |
||||
RET |
||||
|
||||
TEXT ·gettimeofday(SB),NOSPLIT,$0-16 |
||||
JMP syscall·gettimeofday(SB) |
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
// Copyright 2009 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for arm, Linux |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28 |
||||
B syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40 |
||||
B syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 |
||||
BL runtime·entersyscall(SB) |
||||
MOVW trap+0(FP), R7 |
||||
MOVW a1+4(FP), R0 |
||||
MOVW a2+8(FP), R1 |
||||
MOVW a3+12(FP), R2 |
||||
MOVW $0, R3 |
||||
MOVW $0, R4 |
||||
MOVW $0, R5 |
||||
SWI $0 |
||||
MOVW R0, r1+16(FP) |
||||
MOVW $0, R0 |
||||
MOVW R0, r2+20(FP) |
||||
BL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 |
||||
B syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 |
||||
B syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 |
||||
MOVW trap+0(FP), R7 // syscall entry |
||||
MOVW a1+4(FP), R0 |
||||
MOVW a2+8(FP), R1 |
||||
MOVW a3+12(FP), R2 |
||||
SWI $0 |
||||
MOVW R0, r1+16(FP) |
||||
MOVW $0, R0 |
||||
MOVW R0, r2+20(FP) |
||||
RET |
||||
|
||||
TEXT ·seek(SB),NOSPLIT,$0-28 |
||||
B syscall·seek(SB) |
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build linux && arm64 && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
B syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
B syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
BL runtime·entersyscall(SB) |
||||
MOVD a1+8(FP), R0 |
||||
MOVD a2+16(FP), R1 |
||||
MOVD a3+24(FP), R2 |
||||
MOVD $0, R3 |
||||
MOVD $0, R4 |
||||
MOVD $0, R5 |
||||
MOVD trap+0(FP), R8 // syscall entry |
||||
SVC |
||||
MOVD R0, r1+32(FP) // r1 |
||||
MOVD R1, r2+40(FP) // r2 |
||||
BL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
B syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
B syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOVD a1+8(FP), R0 |
||||
MOVD a2+16(FP), R1 |
||||
MOVD a3+24(FP), R2 |
||||
MOVD $0, R3 |
||||
MOVD $0, R4 |
||||
MOVD $0, R5 |
||||
MOVD trap+0(FP), R8 // syscall entry |
||||
SVC |
||||
MOVD R0, r1+32(FP) |
||||
MOVD R1, r2+40(FP) |
||||
RET |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
// Copyright 2022 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build linux && loong64 && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
JAL runtime·entersyscall(SB) |
||||
MOVV a1+8(FP), R4 |
||||
MOVV a2+16(FP), R5 |
||||
MOVV a3+24(FP), R6 |
||||
MOVV R0, R7 |
||||
MOVV R0, R8 |
||||
MOVV R0, R9 |
||||
MOVV trap+0(FP), R11 // syscall entry |
||||
SYSCALL |
||||
MOVV R4, r1+32(FP) |
||||
MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 |
||||
JAL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOVV a1+8(FP), R4 |
||||
MOVV a2+16(FP), R5 |
||||
MOVV a3+24(FP), R6 |
||||
MOVV R0, R7 |
||||
MOVV R0, R8 |
||||
MOVV R0, R9 |
||||
MOVV trap+0(FP), R11 // syscall entry |
||||
SYSCALL |
||||
MOVV R4, r1+32(FP) |
||||
MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 |
||||
RET |
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
// Copyright 2015 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build linux && (mips64 || mips64le) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for mips64, Linux |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
JAL runtime·entersyscall(SB) |
||||
MOVV a1+8(FP), R4 |
||||
MOVV a2+16(FP), R5 |
||||
MOVV a3+24(FP), R6 |
||||
MOVV R0, R7 |
||||
MOVV R0, R8 |
||||
MOVV R0, R9 |
||||
MOVV trap+0(FP), R2 // syscall entry |
||||
SYSCALL |
||||
MOVV R2, r1+32(FP) |
||||
MOVV R3, r2+40(FP) |
||||
JAL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOVV a1+8(FP), R4 |
||||
MOVV a2+16(FP), R5 |
||||
MOVV a3+24(FP), R6 |
||||
MOVV R0, R7 |
||||
MOVV R0, R8 |
||||
MOVV R0, R9 |
||||
MOVV trap+0(FP), R2 // syscall entry |
||||
SYSCALL |
||||
MOVV R2, r1+32(FP) |
||||
MOVV R3, r2+40(FP) |
||||
RET |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
// Copyright 2016 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build linux && (mips || mipsle) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for mips, Linux |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52 |
||||
JMP syscall·Syscall9(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 |
||||
JAL runtime·entersyscall(SB) |
||||
MOVW a1+4(FP), R4 |
||||
MOVW a2+8(FP), R5 |
||||
MOVW a3+12(FP), R6 |
||||
MOVW R0, R7 |
||||
MOVW trap+0(FP), R2 // syscall entry |
||||
SYSCALL |
||||
MOVW R2, r1+16(FP) // r1 |
||||
MOVW R3, r2+20(FP) // r2 |
||||
JAL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 |
||||
MOVW a1+4(FP), R4 |
||||
MOVW a2+8(FP), R5 |
||||
MOVW a3+12(FP), R6 |
||||
MOVW trap+0(FP), R2 // syscall entry |
||||
SYSCALL |
||||
MOVW R2, r1+16(FP) |
||||
MOVW R3, r2+20(FP) |
||||
RET |
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
// Copyright 2014 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build linux && (ppc64 || ppc64le) && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for ppc64, Linux |
||||
// |
||||
|
||||
// Just jump to package syscall's implementation for all these functions. |
||||
// The runtime may know about them. |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
BL runtime·entersyscall(SB) |
||||
MOVD a1+8(FP), R3 |
||||
MOVD a2+16(FP), R4 |
||||
MOVD a3+24(FP), R5 |
||||
MOVD R0, R6 |
||||
MOVD R0, R7 |
||||
MOVD R0, R8 |
||||
MOVD trap+0(FP), R9 // syscall entry |
||||
SYSCALL R9 |
||||
MOVD R3, r1+32(FP) |
||||
MOVD R4, r2+40(FP) |
||||
BL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOVD a1+8(FP), R3 |
||||
MOVD a2+16(FP), R4 |
||||
MOVD a3+24(FP), R5 |
||||
MOVD R0, R6 |
||||
MOVD R0, R7 |
||||
MOVD R0, R8 |
||||
MOVD trap+0(FP), R9 // syscall entry |
||||
SYSCALL R9 |
||||
MOVD R3, r1+32(FP) |
||||
MOVD R4, r2+40(FP) |
||||
RET |
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
// Copyright 2019 The Go Authors. All rights reserved. |
||||
// Use of this source code is governed by a BSD-style |
||||
// license that can be found in the LICENSE file. |
||||
|
||||
//go:build riscv64 && gc |
||||
|
||||
#include "textflag.h" |
||||
|
||||
// |
||||
// System calls for linux/riscv64. |
||||
// |
||||
// Where available, just jump to package syscall's implementation of |
||||
// these functions. |
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·Syscall(SB) |
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·Syscall6(SB) |
||||
|
||||
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 |
||||
CALL runtime·entersyscall(SB) |
||||
MOV a1+8(FP), A0 |
||||
MOV a2+16(FP), A1 |
||||
MOV a3+24(FP), A2 |
||||
MOV trap+0(FP), A7 // syscall entry |
||||
ECALL |
||||
MOV A0, r1+32(FP) // r1 |
||||
MOV A1, r2+40(FP) // r2 |
||||
CALL runtime·exitsyscall(SB) |
||||
RET |
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56 |
||||
JMP syscall·RawSyscall(SB) |
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 |
||||
JMP syscall·RawSyscall6(SB) |
||||
|
||||
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 |
||||
MOV a1+8(FP), A0 |
||||
MOV a2+16(FP), A1 |
||||
MOV a3+24(FP), A2 |
||||
MOV trap+0(FP), A7 // syscall entry |
||||
ECALL |
||||
MOV A0, r1+32(FP) |
||||
MOV A1, r2+40(FP) |
||||
RET |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue