feat: implemented generic algorithm
All checks were successful
Gitea Build Check / Build (push) Successful in 57s
Gitea Build Check / Build (pull_request) Successful in 55s

This commit is contained in:
SoXX 2024-10-26 21:15:02 +02:00
parent 36d6ecd873
commit 376d7ba75d
5 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@ Anthrove Plug SDK is a Golang-based Software Development Kit (SDK) that provides
To install the Anthrove Plug SDK, you will need to have Go installed on your system. You can then use the go get command to fetch the SDK: To install the Anthrove Plug SDK, you will need to have Go installed on your system. You can then use the go get command to fetch the SDK:
```bash ```bash
go get git.anthrove.art/Anthrove/plug-sdk/v4 go get git.anthrove.art/Anthrove/plug-sdk/v5
``` ```
## Usage ## Usage
@ -141,7 +141,7 @@ func main() {
log.Fatal(err) log.Fatal(err)
} }
plug.SetTaskExecutionFunction(service.YourTaskFunction) plug.SetTaskExecutionFunction(service.plugInterface)
plug.SetGetMessageExecutionFunction(service.YourMessageFunction) plug.SetGetMessageExecutionFunction(service.YourMessageFunction)
err = plug.Listen(ctx, ":8080", source) err = plug.Listen(ctx, ":8080", source)
if err != nil { if err != nil {

2
go.mod
View File

@ -1,4 +1,4 @@
module git.anthrove.art/Anthrove/plug-sdk/v4 module git.anthrove.art/Anthrove/plug-sdk/v5
go 1.23.0 go 1.23.0

View File

@ -8,7 +8,7 @@ import (
"git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/database" "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/database"
"git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/models" "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/models"
gRPC "git.anthrove.art/Anthrove/plug-sdk/v4/pkg/grpc" gRPC "git.anthrove.art/Anthrove/plug-sdk/v5/pkg/grpc"
gonanoid "github.com/matoous/go-nanoid/v2" gonanoid "github.com/matoous/go-nanoid/v2"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/attribute"

View File

@ -3,7 +3,7 @@ package plug
import ( import (
"context" "context"
"git.anthrove.art/Anthrove/plug-sdk/v4/pkg/telemetry" "git.anthrove.art/Anthrove/plug-sdk/v5/pkg/telemetry"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/codes"
) )

View File

@ -5,7 +5,7 @@ import (
"net" "net"
"git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/models" "git.anthrove.art/Anthrove/otter-space-sdk/v4/pkg/models"
pb "git.anthrove.art/Anthrove/plug-sdk/v4/pkg/grpc" pb "git.anthrove.art/Anthrove/plug-sdk/v5/pkg/grpc"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"go.opentelemetry.io/otel" "go.opentelemetry.io/otel"
@ -15,7 +15,7 @@ import (
"google.golang.org/protobuf/types/known/timestamppb" "google.golang.org/protobuf/types/known/timestamppb"
) )
var tracer = otel.Tracer("git.anthrove.art/Anthrove/plug-sdk/v4/pkg/plug") var tracer = otel.Tracer("git.anthrove.art/Anthrove/plug-sdk/v5/pkg/plug")
type Message struct { type Message struct {
Title string Title string