feat: gitea client
This commit is contained in:
29
internal/pierre/resource.go
Normal file
29
internal/pierre/resource.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package pierre
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
|
||||
"git.schreifuchs.ch/schreifuchs/pierre-bot/internal/chatter"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
git GitAdapter
|
||||
chat ChatAdapter
|
||||
}
|
||||
|
||||
func New(chat ChatAdapter, git GitAdapter) *Service {
|
||||
return &Service{
|
||||
git: git,
|
||||
chat: chat,
|
||||
}
|
||||
}
|
||||
|
||||
type GitAdapter interface {
|
||||
GetDiff(owner, repo string, prID int) (io.Reader, error)
|
||||
AddComment(owner, repo string, prID int, comment Comment) error
|
||||
}
|
||||
|
||||
type ChatAdapter interface {
|
||||
GenerateStructured(ctx context.Context, messages []chatter.Message, target interface{}) error
|
||||
}
|
||||
Reference in New Issue
Block a user