diff --git a/go.mod b/go.mod index 33e4752..5b20c51 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.17 require ( github.com/robfig/cron/v3 v3.0.1 gopkg.in/yaml.v2 v2.4.0 - local/sandbox/contact/contact v0.0.0-00010101000000-000000000000 ) require ( @@ -15,4 +14,3 @@ require ( golang.org/x/text v0.3.7 // indirect ) -replace local/sandbox/contact/contact => ../sandbox/contact/contact diff --git a/pttodo/action.go b/pttodo/action.go deleted file mode 100644 index b1e5573..0000000 --- a/pttodo/action.go +++ /dev/null @@ -1,40 +0,0 @@ -package pttodo - -/* - action is something like 'send an email on trigger' but is not impl or use -*/ - -import ( - "errors" - "local/sandbox/contact/contact" - "net/url" - "regexp" -) - -type Action string - -var ( - actionEmailPattern = regexp.MustCompile(`[^@]+@.*[^\.]+\.[a-z]+`) -) - -func (action Action) String() string { - return string(action) -} - -func (action Action) CB() (func() error, error) { - u, _ := url.Parse(action.String()) - switch u.Scheme { - case "email": - return action.email, nil - } - if actionEmailPattern.MatchString(action.String()) { - return action.email, nil - } - return nil, errors.New("unrecognized action") -} - -func (action Action) email() error { - em := contact.NewEmailer() - _ = em - return errors.New("not impl") -}