Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acmeserver
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai3
tools
acmeserver
Commits
d8710d70
Commit
d8710d70
authored
1 year ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add missing file
parent
63efefed
No related branches found
No related tags found
1 merge request
!34
V3
Pipeline
#57375
passed with warnings
1 year ago
Stage: test
Stage: build
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
upload/fs.go
+34
-0
34 additions, 0 deletions
upload/fs.go
with
34 additions
and
0 deletions
upload/fs.go
0 → 100644
+
34
−
0
View file @
d8710d70
package
upload
import
(
"context"
"os"
"path/filepath"
"git.autistici.org/ai3/tools/acmeserver/common"
)
type
FSStorage
struct
{
path
string
}
func
newFS
(
config
*
FSConfig
)
(
*
FSStorage
,
error
)
{
return
&
FSStorage
{
path
:
config
.
Path
,
},
nil
}
func
(
s
*
FSStorage
)
Upload
(
_
context
.
Context
,
path
string
,
creds
*
common
.
Credentials
)
error
{
dir
:=
filepath
.
Join
(
s
.
path
,
path
)
if
err
:=
os
.
MkdirAll
(
dir
,
0700
);
err
!=
nil
{
return
err
}
for
_
,
b
:=
range
credsToBatch
(
dir
,
creds
)
{
if
err
:=
os
.
WriteFile
(
b
.
path
,
[]
byte
(
b
.
data
),
0600
);
err
!=
nil
{
return
err
}
}
return
nil
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment