diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3771de6..7f8a7c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,8 @@ jobs: - name: Lint uses: golangci/golangci-lint-action@v2 with: - version: v1.39.0 + args: --timeout=10m + version: v1.54.1 skip-go-installation: true docs: @@ -84,37 +85,6 @@ jobs: - name: Run container run: docker run --rm pinger:dev - proto: - name: Protobuf - runs-on: ubuntu-latest - steps: - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: ^1.16 - id: go - - - name: Install Protoc - uses: arduino/setup-protoc@v1 - with: - version: '3.14.0' - repo-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Install proto-gen-go and proto-gen-go-grpc - run: | - export GO111MODULE=on - go get google.golang.org/protobuf/cmd/protoc-gen-go@v1.25.0 - go get google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.0.1 - - - name: Check out code into the repository root - uses: actions/checkout@v2 - - - name: Generate proto - run: PATH="$(go env GOPATH)/bin:$PATH" make proto - - - name: Check diff - run: ./build/diff.sh - vendor: name: Vendor runs-on: ubuntu-latest diff --git a/go.sum b/go.sum index c136bb0..a40cec4 100644 --- a/go.sum +++ b/go.sum @@ -43,7 +43,6 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -92,8 +91,6 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W 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 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= -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 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= @@ -103,8 +100,8 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a 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 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/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-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= @@ -238,16 +235,19 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= @@ -376,8 +376,6 @@ golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -410,8 +408,6 @@ golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7w 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-20201231184435-2d18734c6014 h1:joucsQqXmyBVxViHCPFjG3hx8JzIFSaym3l3MM/Jsdg= -golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= @@ -420,8 +416,6 @@ golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9sn 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.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -444,7 +438,6 @@ golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -471,7 +464,6 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 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.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= -google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= 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 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= @@ -493,13 +485,13 @@ gopkg.in/ini.v1 v1.52.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mail.v2 v2.3.1 h1:WYFn/oANrAGP2C0dcV6/pbkPzv8yGzqTjPmTeO7qoXk= gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= diff --git a/main.go b/main.go new file mode 100644 index 0000000..c0fb37c --- /dev/null +++ b/main.go @@ -0,0 +1,54 @@ +package main + +import ( + "context" + "net" + + "google.golang.org/grpc" + + "github.com/sdslabs/pinger/pkg/protobuf/pb" +) + +type server struct { + pb.AlterServicesServer +} + +func (s *server) CreateCheckService(ctx context.Context, req *pb.CreateCheckRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func (s *server) DeleteCheckService(ctx context.Context, req *pb.DeleteCheckRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func (s *server) UpdateCheckService(ctx context.Context, req *pb.UpdateCheckRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func (s *server) CreatePageService(ctx context.Context, req *pb.CreatePageRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func (s *server) DeletePageService(ctx context.Context, req *pb.DeletePageRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func (s *server) UpdatePageService(ctx context.Context, req *pb.UpdatePageRequest) (*pb.Response, error) { + return &pb.Response{Response: "gRPC Code 0 : OK "}, nil +} + +func main() { + lis, err := net.Listen("tcp", "127.0.0.1:5000") + if err != nil { + panic(err) + } + + grpcServer := grpc.NewServer() + pb.RegisterAlterServicesServer(grpcServer, &server{}) + if err := grpcServer.Serve(lis); err != nil { + panic(err) + } + if err := grpcServer.Serve(lis); err != nil { + panic(err) + } +} diff --git a/pkg/checker/dns/doc.go b/pkg/checker/dns/doc.go index 6c8fea6..0348c72 100644 --- a/pkg/checker/dns/doc.go +++ b/pkg/checker/dns/doc.go @@ -10,23 +10,22 @@ // // Input: // -// Type Value Description -// ------- -------------------- ------------------------ -// "DNS" "", "PING", "ECHO" Resolves the DNS names +// Type Value Description +// ------- -------------------- ------------------------ +// "DNS" "", "PING", "ECHO" Resolves the DNS names // // Output: // -// Type Value Description -// ----------------- -------------------- ---------------------------------------- -// "TIMEOUT" Success is not-timeout -// "ADDRESS", "IP" One of the resolved IP should be this +// Type Value Description +// ----------------- -------------------- ---------------------------------------- +// "TIMEOUT" Success is not-timeout +// "ADDRESS", "IP" One of the resolved IP should be this // // Target: // -// Type Value Description -// ------------------------------- ---------------------- --------------------- -// "HOST", "HOSTNAME", "DNSNAME" DNS name to resolve +// Type Value Description +// ------------------------------- ---------------------- --------------------- +// "HOST", "HOSTNAME", "DNSNAME" DNS name to resolve // // Payload is not required and hence not validated. -// package dns diff --git a/pkg/checker/doc.go b/pkg/checker/doc.go index dceb8b3..8df4329 100644 --- a/pkg/checker/doc.go +++ b/pkg/checker/doc.go @@ -7,9 +7,9 @@ // Further, a checker can be used to either just validate the check input // using the validate method: // -// if err := checker.Validate(checkConfig); err != nil { -// // handle error -// } +// if err := checker.Validate(checkConfig); err != nil { +// // handle error +// } // // NewControllerOpts can be used to create a controller options from the // check config which can be paired with a controller which executes checker diff --git a/pkg/checker/http/doc.go b/pkg/checker/http/doc.go index bea7d26..9ec20ee 100644 --- a/pkg/checker/http/doc.go +++ b/pkg/checker/http/doc.go @@ -9,33 +9,32 @@ // // Input: // -// Type Value Description -// -------- --------------------------- ---------------- -// "HTTP" "", "GET", "POST", "PUT", Request method -// "PATCH", "DELETE" +// Type Value Description +// -------- --------------------------- ---------------- +// "HTTP" "", "GET", "POST", "PUT", Request method +// "PATCH", "DELETE" // // Output: // -// Type Value Description -// -------------- -------------------------------- ------------------------------------------- -// "TIMEOUT" Success is not-timeout -// "STATUSCODE" Response status code -// "BODY" Response body should match this -// "HEADER" Header with key 'K' should have value 'V' +// Type Value Description +// -------------- -------------------------------- ------------------------------------------- +// "TIMEOUT" Success is not-timeout +// "STATUSCODE" Response status code +// "BODY" Response body should match this +// "HEADER" Header with key 'K' should have value 'V' // // Target: // -// Type Value Description -// ------- --------------------- ---------------------------- -// "URL" URL to send the request to +// Type Value Description +// ------- --------------------- ---------------------------- +// "URL" URL to send the request to // // Payloads: // -// Type Value Description -// ------------- ---------------------------------- ------------------------------------------ -// "HEADER" <"K=V" formatted header> Header with key='K' and value='V' -// "PARAMETER" <"K=V" formatted string where This is passed on either as query (GET), -// 'V' is a valid JSON object, i.e, or form-data/json body (depending on -// string, bool, number or null> value of "Content-Type" header) -// +// Type Value Description +// ------------- ---------------------------------- ------------------------------------------ +// "HEADER" <"K=V" formatted header> Header with key='K' and value='V' +// "PARAMETER" <"K=V" formatted string where This is passed on either as query (GET), +// 'V' is a valid JSON object, i.e, or form-data/json body (depending on +// string, bool, number or null> value of "Content-Type" header) package http diff --git a/pkg/checker/icmp/doc.go b/pkg/checker/icmp/doc.go index db47994..60a3c45 100644 --- a/pkg/checker/icmp/doc.go +++ b/pkg/checker/icmp/doc.go @@ -9,22 +9,21 @@ // // Input: // -// Type Value Description -// -------- -------------------- ------------------------------ -// "ICMP" "", "PING", "ECHO" Sends and receives ICMP ECHO +// Type Value Description +// -------- -------------------- ------------------------------ +// "ICMP" "", "PING", "ECHO" Sends and receives ICMP ECHO // // Output: // -// Type Value Description -// ----------- ----------------- ------------------------ -// "TIMEOUT" Success is not-timeout +// Type Value Description +// ----------- ----------------- ------------------------ +// "TIMEOUT" Success is not-timeout // // Target: // -// Type Value Description -// ----------- ----------------------------------- -------------------------------- -// "ADDRESS" Address to send the request to +// Type Value Description +// ----------- ----------------------------------- -------------------------------- +// "ADDRESS" Address to send the request to // // Payload is not required and hence not validated. -// package icmp diff --git a/pkg/checker/tcp/doc.go b/pkg/checker/tcp/doc.go index 7248059..4f30f9b 100644 --- a/pkg/checker/tcp/doc.go +++ b/pkg/checker/tcp/doc.go @@ -9,9 +9,9 @@ // // Input: // -// Type Value Description -// -------- -------------------- ------------------------------ -// "TCP" "", "PING", "ECHO" Sends and receives TCP ECHO +// Type Value Description +// -------- -------------------- ------------------------------ +// "TCP" "", "PING", "ECHO" Sends and receives TCP ECHO // // Output: // @@ -37,5 +37,4 @@ // Type Value Description // ----------- -------------------- --------------------------- // "MESSAGE" Sent in order as in array -// package tcp diff --git a/pkg/checker/udp/doc.go b/pkg/checker/udp/doc.go index 7181166..3c50e26 100644 --- a/pkg/checker/udp/doc.go +++ b/pkg/checker/udp/doc.go @@ -9,9 +9,9 @@ // // Input: // -// Type Value Description -// -------- -------------------- ------------------------------ -// "UDP" "", "PING", "ECHO" Sends and receives UDP ECHO +// Type Value Description +// -------- -------------------- ------------------------------ +// "UDP" "", "PING", "ECHO" Sends and receives UDP ECHO // // Output: // @@ -28,14 +28,13 @@ // // Target: // -// Type Value Description -// ----------- -------------------------- -------------------------------- -// "ADDRESS" Address to send the request to +// Type Value Description +// ----------- -------------------------- -------------------------------- +// "ADDRESS" Address to send the request to // // Payload: // // Type Value Description // ----------- -------------------- --------------------------- // "MESSAGE" Sent in order as in array -// package udp diff --git a/pkg/checker/ws/doc.go b/pkg/checker/ws/doc.go index fefd464..cb053b5 100644 --- a/pkg/checker/ws/doc.go +++ b/pkg/checker/ws/doc.go @@ -9,37 +9,36 @@ // // Input: // -// Type Value Description -// -------- -------------------- ---------------------------- -// "WS" "", "PING", "ECHO" Sends and receives WS ECHO +// Type Value Description +// -------- -------------------- ---------------------------- +// "WS" "", "PING", "ECHO" Sends and receives WS ECHO // // Output: // -// Type Value Description -// -------------- -------------------------------- ------------------------------------------ -// "TIMEOUT" Success is not-timeout -// "STATUSCODE" Response status code -// "BODY" Response body should match this -// "HEADER" Header with key 'K' should have value 'V' -// "MESSAGE" For "hello" and "world" as two messages, -// the output value should be -// hello -// --- -// world -// All messages should be equal in order +// Type Value Description +// -------------- -------------------------------- ------------------------------------------ +// "TIMEOUT" Success is not-timeout +// "STATUSCODE" Response status code +// "BODY" Response body should match this +// "HEADER" Header with key 'K' should have value 'V' +// "MESSAGE" For "hello" and "world" as two messages, +// the output value should be +// hello +// --- +// world +// All messages should be equal in order // // Target: // -// Type Value Description -// -------- ------------------- ---------------------------- -// "URL" URL to send the request to +// Type Value Description +// -------- ------------------- ---------------------------- +// "URL" URL to send the request to // // Payload: // -// Type Value Description -// ----------- -------------------------- ----------------------------------- -// "MESSAGE" Sent in order as in array -// "HEADER" <"K=V" formatted header> Header with key='K' and value='V' -// +// Type Value Description +// ----------- -------------------------- ----------------------------------- +// "MESSAGE" Sent in order as in array +// "HEADER" <"K=V" formatted header> Header with key='K' and value='V' package ws diff --git a/pkg/components/agent/proto/agent.pb.go b/pkg/components/agent/proto/agent.pb.go index 6f1a119..e52a920 100644 --- a/pkg/components/agent/proto/agent.pb.go +++ b/pkg/components/agent/proto/agent.pb.go @@ -7,10 +7,11 @@ package proto import ( + reflect "reflect" + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" ) const ( diff --git a/pkg/components/agent/proto/agent_grpc.pb.go b/pkg/components/agent/proto/agent_grpc.pb.go index 2c7a9a7..bdc9484 100644 --- a/pkg/components/agent/proto/agent_grpc.pb.go +++ b/pkg/components/agent/proto/agent_grpc.pb.go @@ -4,6 +4,7 @@ package proto import ( context "context" + grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/pkg/components/agent/proto/doc.go b/pkg/components/agent/proto/doc.go index a2a7060..0d8253f 100644 --- a/pkg/components/agent/proto/doc.go +++ b/pkg/components/agent/proto/doc.go @@ -5,6 +5,5 @@ // please generate it again using the following command and // only then commit your changes: // -// $ make proto -// +// $ make proto package proto diff --git a/pkg/components/agent/proto/messages.pb.go b/pkg/components/agent/proto/messages.pb.go index a31e4bf..af5e4ca 100644 --- a/pkg/components/agent/proto/messages.pb.go +++ b/pkg/components/agent/proto/messages.pb.go @@ -7,11 +7,12 @@ package proto import ( + reflect "reflect" + sync "sync" + proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) const ( diff --git a/pkg/components/agent/ui/embeds.go b/pkg/components/agent/ui/embeds.go index 5dac14e..308634d 100644 --- a/pkg/components/agent/ui/embeds.go +++ b/pkg/components/agent/ui/embeds.go @@ -7,5 +7,6 @@ package ui import _ "embed" // TemplateContent is contains the HTML template for standalone agent page. +// //go:embed page.gohtml var TemplateContent string diff --git a/pkg/components/central/central.go b/pkg/components/central/central.go index 38c4c4c..66813f1 100644 --- a/pkg/components/central/central.go +++ b/pkg/components/central/central.go @@ -6,9 +6,8 @@ import ( "fmt" "time" - "google.golang.org/grpc" - "github.com/go-redis/redis/v8" + "google.golang.org/grpc" "github.com/sdslabs/pinger/pkg/config" "github.com/sdslabs/pinger/pkg/config/configfile" diff --git a/pkg/protobuf/alter.proto b/pkg/protobuf/alter.proto new file mode 100644 index 0000000..f93e89f --- /dev/null +++ b/pkg/protobuf/alter.proto @@ -0,0 +1,40 @@ +syntax = "proto3"; + +package alter; + +option go_package = "/pb"; + +message CreateCheckRequest { + string Check = 1; + string PageId = 2; +} + +message DeleteCheckRequest { + string UserId = 1; + string CheckId = 2; + string Role = 3; +} + +message UpdateCheckRequest { + string CheckId = 1; + string UpdateCheckString = 2; + string UserId = 3; + string Role = 4; +} + +message CreatePageRequest { string NewPageString = 1; } + +message DeletePageRequest { string PageId = 1; } + +message UpdatePageRequest { string PageId = 1; } + +message Response { string Response = 1; } + +service AlterServices { + rpc CreateCheckService(CreateCheckRequest) returns (Response) {} + rpc DeleteCheckService(DeleteCheckRequest) returns (Response) {} + rpc UpdateCheckService(UpdateCheckRequest) returns (Response) {} + rpc CreatePageService(CreatePageRequest) returns (Response) {} + rpc DeletePageService(DeletePageRequest) returns (Response) {} + rpc UpdatePageService(UpdatePageRequest) returns (Response) {} +} diff --git a/pkg/protobuf/pb/checks.pb.go b/pkg/protobuf/pb/checks.pb.go new file mode 100644 index 0000000..3b84726 --- /dev/null +++ b/pkg/protobuf/pb/checks.pb.go @@ -0,0 +1,616 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v4.23.4 +// source: checks.proto + +package pb + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type CreateCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Check string `protobuf:"bytes,1,opt,name=Check,proto3" json:"Check,omitempty"` + PageId string `protobuf:"bytes,2,opt,name=PageId,proto3" json:"PageId,omitempty"` +} + +func (x *CreateCheckRequest) Reset() { + *x = CreateCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateCheckRequest) ProtoMessage() {} + +func (x *CreateCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateCheckRequest.ProtoReflect.Descriptor instead. +func (*CreateCheckRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateCheckRequest) GetCheck() string { + if x != nil { + return x.Check + } + return "" +} + +func (x *CreateCheckRequest) GetPageId() string { + if x != nil { + return x.PageId + } + return "" +} + +type DeleteCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId string `protobuf:"bytes,1,opt,name=UserId,proto3" json:"UserId,omitempty"` + CheckId string `protobuf:"bytes,2,opt,name=CheckId,proto3" json:"CheckId,omitempty"` + Role string `protobuf:"bytes,3,opt,name=Role,proto3" json:"Role,omitempty"` +} + +func (x *DeleteCheckRequest) Reset() { + *x = DeleteCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteCheckRequest) ProtoMessage() {} + +func (x *DeleteCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteCheckRequest.ProtoReflect.Descriptor instead. +func (*DeleteCheckRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{1} +} + +func (x *DeleteCheckRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *DeleteCheckRequest) GetCheckId() string { + if x != nil { + return x.CheckId + } + return "" +} + +func (x *DeleteCheckRequest) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type UpdateCheckRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + CheckId string `protobuf:"bytes,1,opt,name=CheckId,proto3" json:"CheckId,omitempty"` + UpdateCheckString string `protobuf:"bytes,2,opt,name=UpdateCheckString,proto3" json:"UpdateCheckString,omitempty"` + UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId,omitempty"` + Role string `protobuf:"bytes,4,opt,name=Role,proto3" json:"Role,omitempty"` +} + +func (x *UpdateCheckRequest) Reset() { + *x = UpdateCheckRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateCheckRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateCheckRequest) ProtoMessage() {} + +func (x *UpdateCheckRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateCheckRequest.ProtoReflect.Descriptor instead. +func (*UpdateCheckRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateCheckRequest) GetCheckId() string { + if x != nil { + return x.CheckId + } + return "" +} + +func (x *UpdateCheckRequest) GetUpdateCheckString() string { + if x != nil { + return x.UpdateCheckString + } + return "" +} + +func (x *UpdateCheckRequest) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *UpdateCheckRequest) GetRole() string { + if x != nil { + return x.Role + } + return "" +} + +type CreatePageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NewPageString string `protobuf:"bytes,1,opt,name=NewPageString,proto3" json:"NewPageString,omitempty"` +} + +func (x *CreatePageRequest) Reset() { + *x = CreatePageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePageRequest) ProtoMessage() {} + +func (x *CreatePageRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreatePageRequest.ProtoReflect.Descriptor instead. +func (*CreatePageRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{3} +} + +func (x *CreatePageRequest) GetNewPageString() string { + if x != nil { + return x.NewPageString + } + return "" +} + +type DeletePageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId string `protobuf:"bytes,1,opt,name=PageId,proto3" json:"PageId,omitempty"` +} + +func (x *DeletePageRequest) Reset() { + *x = DeletePageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePageRequest) ProtoMessage() {} + +func (x *DeletePageRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeletePageRequest.ProtoReflect.Descriptor instead. +func (*DeletePageRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{4} +} + +func (x *DeletePageRequest) GetPageId() string { + if x != nil { + return x.PageId + } + return "" +} + +type UpdatePageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PageId string `protobuf:"bytes,1,opt,name=PageId,proto3" json:"PageId,omitempty"` +} + +func (x *UpdatePageRequest) Reset() { + *x = UpdatePageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePageRequest) ProtoMessage() {} + +func (x *UpdatePageRequest) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdatePageRequest.ProtoReflect.Descriptor instead. +func (*UpdatePageRequest) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{5} +} + +func (x *UpdatePageRequest) GetPageId() string { + if x != nil { + return x.PageId + } + return "" +} + +type Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Response string `protobuf:"bytes,1,opt,name=Response,proto3" json:"Response,omitempty"` +} + +func (x *Response) Reset() { + *x = Response{} + if protoimpl.UnsafeEnabled { + mi := &file_checks_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Response) ProtoMessage() {} + +func (x *Response) ProtoReflect() protoreflect.Message { + mi := &file_checks_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Response.ProtoReflect.Descriptor instead. +func (*Response) Descriptor() ([]byte, []int) { + return file_checks_proto_rawDescGZIP(), []int{6} +} + +func (x *Response) GetResponse() string { + if x != nil { + return x.Response + } + return "" +} + +var File_checks_proto protoreflect.FileDescriptor + +var file_checks_proto_rawDesc = []byte{ + 0x0a, 0x0c, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, + 0x61, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x42, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x50, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x5a, 0x0a, 0x12, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x52, 0x6f, 0x6c, 0x65, + 0x22, 0x39, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x0d, 0x4e, 0x65, 0x77, 0x50, 0x61, 0x67, 0x65, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x4e, 0x65, + 0x77, 0x50, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x2b, 0x0a, 0x11, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x50, 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, + 0x06, 0x50, 0x61, 0x67, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x50, + 0x61, 0x67, 0x65, 0x49, 0x64, 0x22, 0x26, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xa1, 0x03, + 0x0a, 0x0d, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, + 0x42, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x0f, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, 0x61, 0x6c, 0x74, 0x65, + 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x19, 0x2e, + 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, + 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x18, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x61, 0x6c, 0x74, + 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, + 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x61, + 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x40, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x18, 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x50, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, + 0x2e, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x05, 0x5a, 0x03, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_checks_proto_rawDescOnce sync.Once + file_checks_proto_rawDescData = file_checks_proto_rawDesc +) + +func file_checks_proto_rawDescGZIP() []byte { + file_checks_proto_rawDescOnce.Do(func() { + file_checks_proto_rawDescData = protoimpl.X.CompressGZIP(file_checks_proto_rawDescData) + }) + return file_checks_proto_rawDescData +} + +var file_checks_proto_msgTypes = make([]protoimpl.MessageInfo, 7) +var file_checks_proto_goTypes = []interface{}{ + (*CreateCheckRequest)(nil), // 0: alter.CreateCheckRequest + (*DeleteCheckRequest)(nil), // 1: alter.DeleteCheckRequest + (*UpdateCheckRequest)(nil), // 2: alter.UpdateCheckRequest + (*CreatePageRequest)(nil), // 3: alter.CreatePageRequest + (*DeletePageRequest)(nil), // 4: alter.DeletePageRequest + (*UpdatePageRequest)(nil), // 5: alter.UpdatePageRequest + (*Response)(nil), // 6: alter.Response +} +var file_checks_proto_depIdxs = []int32{ + 0, // 0: alter.AlterServices.CreateCheckService:input_type -> alter.CreateCheckRequest + 1, // 1: alter.AlterServices.DeleteCheckService:input_type -> alter.DeleteCheckRequest + 2, // 2: alter.AlterServices.UpdateCheckService:input_type -> alter.UpdateCheckRequest + 3, // 3: alter.AlterServices.CreatePageService:input_type -> alter.CreatePageRequest + 4, // 4: alter.AlterServices.DeletePageService:input_type -> alter.DeletePageRequest + 5, // 5: alter.AlterServices.UpdatePageService:input_type -> alter.UpdatePageRequest + 6, // 6: alter.AlterServices.CreateCheckService:output_type -> alter.Response + 6, // 7: alter.AlterServices.DeleteCheckService:output_type -> alter.Response + 6, // 8: alter.AlterServices.UpdateCheckService:output_type -> alter.Response + 6, // 9: alter.AlterServices.CreatePageService:output_type -> alter.Response + 6, // 10: alter.AlterServices.DeletePageService:output_type -> alter.Response + 6, // 11: alter.AlterServices.UpdatePageService:output_type -> alter.Response + 6, // [6:12] is the sub-list for method output_type + 0, // [0:6] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_checks_proto_init() } +func file_checks_proto_init() { + if File_checks_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_checks_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateCheckRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_checks_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_checks_proto_rawDesc, + NumEnums: 0, + NumMessages: 7, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_checks_proto_goTypes, + DependencyIndexes: file_checks_proto_depIdxs, + MessageInfos: file_checks_proto_msgTypes, + }.Build() + File_checks_proto = out.File + file_checks_proto_rawDesc = nil + file_checks_proto_goTypes = nil + file_checks_proto_depIdxs = nil +} diff --git a/pkg/protobuf/pb/checks_grpc.pb.go b/pkg/protobuf/pb/checks_grpc.pb.go new file mode 100644 index 0000000..98eaa1d --- /dev/null +++ b/pkg/protobuf/pb/checks_grpc.pb.go @@ -0,0 +1,286 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v4.23.4 +// source: checks.proto + +package pb + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AlterServicesClient is the client API for AlterServices service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type AlterServicesClient interface { + CreateCheckService(ctx context.Context, in *CreateCheckRequest, opts ...grpc.CallOption) (*Response, error) + DeleteCheckService(ctx context.Context, in *DeleteCheckRequest, opts ...grpc.CallOption) (*Response, error) + UpdateCheckService(ctx context.Context, in *UpdateCheckRequest, opts ...grpc.CallOption) (*Response, error) + CreatePageService(ctx context.Context, in *CreatePageRequest, opts ...grpc.CallOption) (*Response, error) + DeletePageService(ctx context.Context, in *DeletePageRequest, opts ...grpc.CallOption) (*Response, error) + UpdatePageService(ctx context.Context, in *UpdatePageRequest, opts ...grpc.CallOption) (*Response, error) +} + +type alterServicesClient struct { + cc grpc.ClientConnInterface +} + +func NewAlterServicesClient(cc grpc.ClientConnInterface) AlterServicesClient { + return &alterServicesClient{cc} +} + +func (c *alterServicesClient) CreateCheckService(ctx context.Context, in *CreateCheckRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/CreateCheckService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alterServicesClient) DeleteCheckService(ctx context.Context, in *DeleteCheckRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/DeleteCheckService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alterServicesClient) UpdateCheckService(ctx context.Context, in *UpdateCheckRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/UpdateCheckService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alterServicesClient) CreatePageService(ctx context.Context, in *CreatePageRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/CreatePageService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alterServicesClient) DeletePageService(ctx context.Context, in *DeletePageRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/DeletePageService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *alterServicesClient) UpdatePageService(ctx context.Context, in *UpdatePageRequest, opts ...grpc.CallOption) (*Response, error) { + out := new(Response) + err := c.cc.Invoke(ctx, "/alter.AlterServices/UpdatePageService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AlterServicesServer is the server API for AlterServices service. +// All implementations must embed UnimplementedAlterServicesServer +// for forward compatibility +type AlterServicesServer interface { + CreateCheckService(context.Context, *CreateCheckRequest) (*Response, error) + DeleteCheckService(context.Context, *DeleteCheckRequest) (*Response, error) + UpdateCheckService(context.Context, *UpdateCheckRequest) (*Response, error) + CreatePageService(context.Context, *CreatePageRequest) (*Response, error) + DeletePageService(context.Context, *DeletePageRequest) (*Response, error) + UpdatePageService(context.Context, *UpdatePageRequest) (*Response, error) + mustEmbedUnimplementedAlterServicesServer() +} + +// UnimplementedAlterServicesServer must be embedded to have forward compatible implementations. +type UnimplementedAlterServicesServer struct { +} + +func (UnimplementedAlterServicesServer) CreateCheckService(context.Context, *CreateCheckRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateCheckService not implemented") +} +func (UnimplementedAlterServicesServer) DeleteCheckService(context.Context, *DeleteCheckRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteCheckService not implemented") +} +func (UnimplementedAlterServicesServer) UpdateCheckService(context.Context, *UpdateCheckRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateCheckService not implemented") +} +func (UnimplementedAlterServicesServer) CreatePageService(context.Context, *CreatePageRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePageService not implemented") +} +func (UnimplementedAlterServicesServer) DeletePageService(context.Context, *DeletePageRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePageService not implemented") +} +func (UnimplementedAlterServicesServer) UpdatePageService(context.Context, *UpdatePageRequest) (*Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePageService not implemented") +} +func (UnimplementedAlterServicesServer) mustEmbedUnimplementedAlterServicesServer() {} + +// UnsafeAlterServicesServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AlterServicesServer will +// result in compilation errors. +type UnsafeAlterServicesServer interface { + mustEmbedUnimplementedAlterServicesServer() +} + +func RegisterAlterServicesServer(s grpc.ServiceRegistrar, srv AlterServicesServer) { + s.RegisterService(&AlterServices_ServiceDesc, srv) +} + +func _AlterServices_CreateCheckService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).CreateCheckService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/CreateCheckService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).CreateCheckService(ctx, req.(*CreateCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlterServices_DeleteCheckService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).DeleteCheckService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/DeleteCheckService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).DeleteCheckService(ctx, req.(*DeleteCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlterServices_UpdateCheckService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateCheckRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).UpdateCheckService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/UpdateCheckService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).UpdateCheckService(ctx, req.(*UpdateCheckRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlterServices_CreatePageService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).CreatePageService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/CreatePageService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).CreatePageService(ctx, req.(*CreatePageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlterServices_DeletePageService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).DeletePageService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/DeletePageService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).DeletePageService(ctx, req.(*DeletePageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _AlterServices_UpdatePageService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AlterServicesServer).UpdatePageService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/alter.AlterServices/UpdatePageService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AlterServicesServer).UpdatePageService(ctx, req.(*UpdatePageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AlterServices_ServiceDesc is the grpc.ServiceDesc for AlterServices service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AlterServices_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "alter.AlterServices", + HandlerType: (*AlterServicesServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateCheckService", + Handler: _AlterServices_CreateCheckService_Handler, + }, + { + MethodName: "DeleteCheckService", + Handler: _AlterServices_DeleteCheckService_Handler, + }, + { + MethodName: "UpdateCheckService", + Handler: _AlterServices_UpdateCheckService_Handler, + }, + { + MethodName: "CreatePageService", + Handler: _AlterServices_CreatePageService_Handler, + }, + { + MethodName: "DeletePageService", + Handler: _AlterServices_DeletePageService_Handler, + }, + { + MethodName: "UpdatePageService", + Handler: _AlterServices_UpdatePageService_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "checks.proto", +} diff --git a/pkg/util/httpserver/server.go b/pkg/util/httpserver/server.go index 70e12af..313fe4b 100644 --- a/pkg/util/httpserver/server.go +++ b/pkg/util/httpserver/server.go @@ -16,8 +16,9 @@ import ( func ListenAndServe(ctx *appcontext.Context, port uint16, h http.Handler) error { addr := net.JoinHostPort("0.0.0.0", fmt.Sprint(port)) server := http.Server{ - Addr: addr, - Handler: h, + Addr: addr, + Handler: h, + ReadHeaderTimeout: 10 * time.Second, } errChan := make(chan error) diff --git a/pkg/util/metrics/serialize.go b/pkg/util/metrics/serialize.go index 94a1170..077d33f 100644 --- a/pkg/util/metrics/serialize.go +++ b/pkg/util/metrics/serialize.go @@ -11,12 +11,12 @@ import ( // metric from each batch. // // The following rules are applied to each batch: -// - Failed metric is prioritized over successful. -// - Metric with highest latency is considered. -// - If number of batches are more than number of metrics, this is probably -// recent addition of check. In this case, The first metric should be -// appended at the front of list. -// - The first (latest) metric is remains the same. +// - Failed metric is prioritized over successful. +// - Metric with highest latency is considered. +// - If number of batches are more than number of metrics, this is probably +// recent addition of check. In this case, The first metric should be +// appended at the front of list. +// - The first (latest) metric is remains the same. // // Minimum number of batches accepted is 2 since only 1 would mean just // getting the latest metric which doesn't reflect any history.