Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-go
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-go
Commits
bf13f986
Commit
bf13f986
authored
1 year ago
by
Danis Kirasirov
Browse files
Options
Downloads
Patches
Plain Diff
implement ExprMapper for File
parent
e09493c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/files/file.go
+11
-0
11 additions, 0 deletions
pkg/files/file.go
with
11 additions
and
0 deletions
pkg/files/file.go
+
11
−
0
View file @
bf13f986
...
...
@@ -47,6 +47,17 @@ func (f *File) SetURLWithTemplate(t *template.Template) error {
return
nil
}
func
(
f
File
)
ToExprMap
()
map
[
string
]
interface
{}
{
return
map
[
string
]
interface
{}{
"id"
:
f
.
ID
,
"name"
:
f
.
Name
,
"size"
:
f
.
Size
,
"mime_type"
:
f
.
MimeType
,
"url"
:
f
.
URL
,
"key"
:
f
.
Key
,
}
}
func
NewFile
(
name
,
mimeType
string
,
size
int
,
temp
bool
)
*
File
{
i
:=
id
.
GenerateNewID
()
if
temp
{
...
...
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