working commit

This commit is contained in:
2026-02-20 15:33:15 +02:00
parent 09f2125a4e
commit f973293315
18 changed files with 169 additions and 147 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ import (
"mstore/pkg/auxhttp"
"mstore/pkg/descr"
"mstore/pkg/terms"
"mstore/pkg/term"
)
func (cli *Client) FileInfo(ctx context.Context, fileuri string) (bool, *descr.File, error) {
@@ -209,7 +209,7 @@ func (cli *Client) DeleteFile(ctx context.Context, fileuri string) error {
return err
}
func (cli *Client) ListFiles(ctx context.Context, catalogURI string, usePathAs terms.PathUsage) ([]descr.File, error) {
func (cli *Client) ListFiles(ctx context.Context, catalogURI string, usePathAs term.PathUsage) ([]descr.File, error) {
var err error
res := make([]descr.File, 0)
@@ -277,7 +277,7 @@ func (cli *Client) ListFiles(ctx context.Context, catalogURI string, usePathAs t
return res, err
}
func (cli *Client) ListCollections(ctx context.Context, catalogURI string, usePathAs terms.PathUsage) ([]string, error) {
func (cli *Client) ListCollections(ctx context.Context, catalogURI string, usePathAs term.PathUsage) ([]string, error) {
var err error
res := make([]string, 0)
@@ -346,7 +346,7 @@ func (cli *Client) ListCollections(ctx context.Context, catalogURI string, usePa
return res, err
}
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, usePathAs terms.PathUsage, dryRun bool) ([]descr.File, error) {
func (cli *Client) DeleteCollection(ctx context.Context, catalogURI string, usePathAs term.PathUsage, dryRun bool) ([]descr.File, error) {
var err error
res := make([]descr.File, 0)
+3 -3
View File
@@ -17,11 +17,11 @@ import (
"mstore/app/handler"
"mstore/app/operator"
"mstore/pkg/descr"
"mstore/pkg/terms"
"mstore/pkg/term"
"mstore/pkg/uuid"
)
func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, accountID uuid.UUID, right terms.Right, pattern string) (uuid.UUID, error) {
func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, accountID uuid.UUID, right term.Right, pattern string) (uuid.UUID, error) {
var err error
var res uuid.UUID
@@ -56,7 +56,7 @@ func (cli *Client) CreateGrantByAccountID(ctx context.Context, hosturi string, a
return res, err
}
func (cli *Client) CreateGrantByUsername(ctx context.Context, hosturi, username string, right terms.Right, pattern string) (uuid.UUID, error) {
func (cli *Client) CreateGrantByUsername(ctx context.Context, hosturi, username string, right term.Right, pattern string) (uuid.UUID, error) {
var err error
var res uuid.UUID
+9 -9
View File
@@ -11,17 +11,17 @@
package descr
import (
"mstore/pkg/terms"
"mstore/pkg/term"
"mstore/pkg/uuid"
)
type Grant struct {
ID uuid.UUID `json:"id" db:"id"`
AccountID uuid.UUID `json:"accountID" db:"account_id"`
Right terms.Right `json:"right" db:"right"`
Pattern string `json:"pattern" db:"pattern"`
CreatedAt string `json:"createdAt" db:"created_at"`
UpdatedAt string `json:"updatedAt" db:"updated_at"`
CreatedBy uuid.UUID `json:"createdBy" db:"created_by"`
UpdatedBy uuid.UUID `json:"updatedBy" db:"updated_by"`
ID uuid.UUID `json:"id" db:"id"`
AccountID uuid.UUID `json:"accountID" db:"account_id"`
Right term.Right `json:"right" db:"right"`
Pattern string `json:"pattern" db:"pattern"`
CreatedAt string `json:"createdAt" db:"created_at"`
UpdatedAt string `json:"updatedAt" db:"updated_at"`
CreatedBy uuid.UUID `json:"createdBy" db:"created_by"`
UpdatedBy uuid.UUID `json:"updatedBy" db:"updated_by"`
}
+1 -1
View File
@@ -8,7 +8,7 @@
* modifications are strictly prohibited.
*/
package terms
package term
import (
"mstore/pkg/uuid"
+22
View File
@@ -0,0 +1,22 @@
/*
* Copyright 2026 Oleg Borodin <onborodin@gmail.com>
*
* This work is published and licensed under a Creative Commons
* Attribution-NonCommercial-NoDerivatives 4.0 International License.
*
* Distribution of this work is permitted, but commercial use and
* modifications are strictly prohibited.
*/
package uuid
import (
"github.com/google/uuid"
)
type UUID string
const ZeroUUID UUID = "00000000-0000-0000-0000-000000000000"
func NewUUID() UUID {
return UUID(uuid.New().String())
}