From 23f980bb369d235f1198b04ca122c1fbc53ba73f Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Wed, 24 May 2023 21:05:34 -0700 Subject: [PATCH] Initial import. --- go.mod | 3 +++ proto/Makefile | 21 +++++++++++++++++++++ proto/alert.proto | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 go.mod create mode 100644 proto/Makefile create mode 100644 proto/alert.proto diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..63542b4 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module git.wntrmute.dev/kyle/overpush + +go 1.20 diff --git a/proto/Makefile b/proto/Makefile new file mode 100644 index 0000000..fbfc57e --- /dev/null +++ b/proto/Makefile @@ -0,0 +1,21 @@ +PROTOFILES = $(wildcard *.proto) +GO_TARGETS = $(patsubst %.proto,%.pb.go,$(PROTOFILES)) +DEBIAN_DEPS = protobuf-compiler protoc-gen-go + +.PHONY: all +all: $(GO_TARGETS) + +%.pb.go: %.proto + protoc -I=$(PWD) --go_out=$(PWD) $< + +.PHONY: install-debian-deps +install-debian-deps: + sudo apt-get install $(DEBIAN_DEPS) + +.PHONY: uninstall-debian-deps +uninstall-debian-deps: + sudo apt-get remove $(DEBIAN_DEPS) + +.PHONY: clean +clean: + rm -f *.pb.go diff --git a/proto/alert.proto b/proto/alert.proto new file mode 100644 index 0000000..34907a8 --- /dev/null +++ b/proto/alert.proto @@ -0,0 +1,17 @@ +syntax = 'proto3'; +package overpush; + +option go_package = '.;pb'; + +enum AlertType { + AlertTypeInvalid = 0; + AlertTypeMessage = 1; + AlertTypeMessageWithTitle = 2; + AlertTypeMessageWithAttachment = 3; +} + +message Alert { + string title = 3; + string text = 4; + bytes attachment = 5; +}