wip: flow task start
This commit is contained in:
17
internal/interfaces/enum.go
Normal file
17
internal/interfaces/enum.go
Normal file
@ -0,0 +1,17 @@
|
||||
package interfaces
|
||||
|
||||
type Enum interface {
|
||||
Value() int64
|
||||
Code() string
|
||||
Label() string
|
||||
|
||||
MarshalJSON() ([]byte, error)
|
||||
|
||||
All() []Enum
|
||||
}
|
||||
|
||||
type OpLogger interface {
|
||||
Enum
|
||||
Render(content map[string]any) (string, error)
|
||||
Template() string
|
||||
}
|
23
internal/interfaces/task.go
Normal file
23
internal/interfaces/task.go
Normal file
@ -0,0 +1,23 @@
|
||||
package interfaces
|
||||
|
||||
import "context"
|
||||
|
||||
type Input interface {
|
||||
Start(context.Context, chan<- Row, chan<- error) error
|
||||
Close()
|
||||
}
|
||||
|
||||
type Pipe interface {
|
||||
Start(Row) (Row, error)
|
||||
Next() []Pipe
|
||||
Close()
|
||||
}
|
||||
|
||||
type Output interface {
|
||||
Start(context.Context, <-chan Row, chan<- error) error
|
||||
Close()
|
||||
}
|
||||
|
||||
type Row interface {
|
||||
Bytes() ([]byte, error)
|
||||
}
|
12
internal/interfaces/user.go
Normal file
12
internal/interfaces/user.go
Normal file
@ -0,0 +1,12 @@
|
||||
package interfaces
|
||||
|
||||
import "github.com/loveuer/nfflow/internal/model"
|
||||
|
||||
type UserController interface {
|
||||
GetUser(id uint64) (*model.User, error)
|
||||
GetUserByToken(token string) (*model.User, error)
|
||||
CacheUser(user *model.User) error
|
||||
CacheToken(token string, user *model.User) error
|
||||
RmUserCache(id uint64) error
|
||||
DeleteUser(id uint64) error
|
||||
}
|
Reference in New Issue
Block a user