Skip to content

Commit

Permalink
Add interface comments
Browse files Browse the repository at this point in the history
Signed-off-by: khanhtc1202 <[email protected]>
  • Loading branch information
khanhtc1202 committed Nov 15, 2024
1 parent 606eb2f commit cb668cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/plugin/logpersister/persister.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ type apiClient interface {
ReportStageLogsFromLastCheckpoint(ctx context.Context, in *service.ReportStageLogsFromLastCheckpointRequest, opts ...grpc.CallOption) (*service.ReportStageLogsFromLastCheckpointResponse, error)
}

// Persister is responsible for saving the stage logs into server's storage.
// It sends the logs to the piped plugin-api grpc server through the apiClient.
type Persister interface {
Run(ctx context.Context) error
StageLogPersister(deploymentID, stageID string) StageLogPersister
}

// StageLogPersister is a child persister instance for a specific stage.
// Use this to persist the stage logs and make it viewable on the UI.
type StageLogPersister interface {
Write(log []byte) (int, error)
Info(log string)
Expand Down
3 changes: 2 additions & 1 deletion pkg/plugin/logpersister/persister_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ import (
"context"
"testing"

"github.com/pipe-cd/pipecd/pkg/app/pipedv1/cmd/piped/service"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.uber.org/atomic"
"go.uber.org/zap"
"google.golang.org/grpc"

"github.com/pipe-cd/pipecd/pkg/app/pipedv1/cmd/piped/service"
)

type fakeAPIClient struct {
Expand Down

0 comments on commit cb668cf

Please sign in to comment.