stubbing
parent
8ae8f47753
commit
f38c183fe8
|
|
@ -28,6 +28,10 @@ func NewEvent(ID, URL string, TS uint64, Name, Asset, Datacenter, Team string, R
|
|||
}
|
||||
}
|
||||
|
||||
func (e Event) Empty() bool {
|
||||
return e == (Event{})
|
||||
}
|
||||
|
||||
func updated() uint64 {
|
||||
return uint64(time.Now().UnixNano() / int64(time.Millisecond))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,3 +22,7 @@ func NewMessage(ID, URL string, TS uint64, Author, Plaintext string, ThreadID st
|
|||
ThreadID: ThreadID,
|
||||
}
|
||||
}
|
||||
|
||||
func (m Message) Empty() bool {
|
||||
return m == (Message{})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,3 +20,7 @@ func NewThread(ID, URL string, TS uint64, Channel string, EventID string) Thread
|
|||
EventID: EventID,
|
||||
}
|
||||
}
|
||||
|
||||
func (t Thread) Empty() bool {
|
||||
return t == (Thread{})
|
||||
}
|
||||
|
|
|
|||
8
slack.go
8
slack.go
|
|
@ -4,12 +4,20 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/breel-render/spoc-bot-vr/model"
|
||||
)
|
||||
|
||||
type SlackToModel struct {
|
||||
pipeline Pipeline
|
||||
}
|
||||
|
||||
type Models struct {
|
||||
Event model.Event
|
||||
Message model.Message
|
||||
Thread model.Thread
|
||||
}
|
||||
|
||||
func NewSlackToModelPipeline(ctx context.Context, cfg Config) (Pipeline, error) {
|
||||
reader, err := NewQueue(ctx, "slack_event", cfg.driver)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue