Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support file operations for FUSE #134

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pkg/controlplane/http/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import (
"net/http"
"net/url"
"strconv"
"syscall"
"time"

"github.com/v3io/v3io-go/pkg/controlplane"
"github.com/v3io/v3io-go/pkg/errors"
v3ioc "github.com/v3io/v3io-go/pkg/controlplane"
v3ioerrors "github.com/v3io/v3io-go/pkg/errors"

"github.com/nuclio/errors"
"github.com/nuclio/logger"
Expand Down Expand Up @@ -839,7 +840,7 @@ func (s *session) sendRequest(ctx context.Context, request *request, timeout tim
return nil, v3ioerrors.NewErrorWithStatusCode(
fmt.Errorf("Failed to execute HTTP request %s/%s.\nResponse code: %d",
s.endpoints[0], request.path, responseInstance.statusCode),
responseInstance.statusCode)
responseInstance.statusCode, int(syscall.EINVAL))
}
}

Expand Down
7 changes: 7 additions & 0 deletions pkg/dataplane/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,11 @@ type Container interface {

// PutOOSObjectSync
PutOOSObjectSync(*PutOOSObjectInput) error

GetFileAttributesSync(*GetFileAttributesInput, *GetFileAttributesOutput) error
OpenFileSync(*OpenFileInput, *OpenFileOutput) error
CloseFileSync(*CloseFileInput) error
TruncateFileSync(*TruncateFileInput) error
SymlinkSync(*SymlinkInput) error
GetWorkerDedicatedPortsSync(*DataPlaneInput) ([]string, error)
}
31 changes: 30 additions & 1 deletion pkg/dataplane/http/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ such restriction.
package v3iohttp

import (
"github.com/v3io/v3io-go/pkg/dataplane"
v3io "github.com/v3io/v3io-go/pkg/dataplane"

"github.com/nuclio/logger"
)
Expand Down Expand Up @@ -314,3 +314,32 @@ func (c *container) PutOOSObjectSync(putOOSObjectInput *v3io.PutOOSObjectInput)
c.populateInputFields(&putOOSObjectInput.DataPlaneInput)
return c.session.context.PutOOSObjectSync(putOOSObjectInput)
}

func (c *container) GetFileAttributesSync(input *v3io.GetFileAttributesInput, out *v3io.GetFileAttributesOutput) error {
c.populateInputFields(&input.DataPlaneInput)
return c.session.context.GetFileAttributesSync(input, out)
}

func (c *container) OpenFileSync(input *v3io.OpenFileInput, out *v3io.OpenFileOutput) error {
c.populateInputFields(&input.DataPlaneInput)
return c.session.context.OpenFileSync(input, out)
}

func (c *container) CloseFileSync(input *v3io.CloseFileInput) error {
c.populateInputFields(&input.DataPlaneInput)
return c.session.context.CloseFileSync(input)
}

func (c *container) TruncateFileSync(input *v3io.TruncateFileInput) error {
c.populateInputFields(&input.DataPlaneInput)
return c.session.context.TruncateFileSync(input)
}

func (c *container) SymlinkSync(input *v3io.SymlinkInput) error {
c.populateInputFields(&input.DataPlaneInput)
return c.session.context.SymlinkSync(input)
}

func (c *container) GetWorkerDedicatedPortsSync(in *v3io.DataPlaneInput) ([]string, error) {
return c.session.context.GetWorkerDedicatedPortsSync(in)
}
Loading