diff --git a/src/main.go b/cmd/main.go similarity index 60% rename from src/main.go rename to cmd/main.go index 3673f3f..79bcc44 100644 --- a/src/main.go +++ b/cmd/main.go @@ -3,12 +3,14 @@ package main import ( "log" "time" + + nostrbot "github.com/araujo88/bitcoin-price-bot-nostr/pkg" ) func main() { for { - err := doPost() + err := nostrbot.DoPost() if err != nil { log.Fatal(err) diff --git a/src/config.json b/config.json similarity index 100% rename from src/config.json rename to config.json diff --git a/src/config.go b/pkg/config.go similarity index 100% rename from src/config.go rename to pkg/config.go diff --git a/src/get_rate.go b/pkg/get_rate.go similarity index 100% rename from src/get_rate.go rename to pkg/get_rate.go diff --git a/src/load_env.go b/pkg/load_env.go similarity index 100% rename from src/load_env.go rename to pkg/load_env.go diff --git a/src/message.go b/pkg/message.go similarity index 100% rename from src/message.go rename to pkg/message.go diff --git a/src/post.go b/pkg/post.go similarity index 97% rename from src/post.go rename to pkg/post.go index bcd7579..35bcb65 100644 --- a/src/post.go +++ b/pkg/post.go @@ -1,4 +1,4 @@ -package main +package nostrbot import ( "context" @@ -12,7 +12,7 @@ import ( "github.com/nbd-wtf/go-nostr/nip19" ) -func doPost() error { +func DoPost() error { profile := "" cfg, err := loadConfig(profile) diff --git a/src/profile.go b/pkg/profile.go similarity index 100% rename from src/profile.go rename to pkg/profile.go diff --git a/src/relay.go b/pkg/relay.go similarity index 86% rename from src/relay.go rename to pkg/relay.go index 8978799..ae00685 100644 --- a/src/relay.go +++ b/pkg/relay.go @@ -1,4 +1,4 @@ -package main +package nostrbot type Relay struct { Read bool `json:"read"`