Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

adds globbing and some ls formatting flags #282

Draft
wants to merge 26 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
uses: actions/setup-go@v3
- name: Set up Go 1.23.1
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.23.1
id: go

- name: Check out code into the Go module directory
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.18
uses: actions/setup-go@v3
- name: Set up Go 1.23.1
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.23.1
id: go

- name: Check out code into the Go module directory
Expand Down
12 changes: 3 additions & 9 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"time"

"github.com/golang-jwt/jwt"
"github.com/juruen/rmapi/api/sync10"
"github.com/juruen/rmapi/api/sync15"
"github.com/juruen/rmapi/filetree"
"github.com/juruen/rmapi/model"
Expand All @@ -21,10 +20,10 @@ type ApiCtx interface {
CreateDir(parentId, name string, notify bool) (*model.Document, error)
UploadDocument(parentId string, sourceDocPath string, notify bool) (*model.Document, error)
MoveEntry(src, dstDir *model.Node, name string) (*model.Node, error)
DeleteEntry(node *model.Node) error
DeleteEntry(node *model.Node, recursive, notify bool) error
SyncComplete() error
Nuke() error
Refresh() error
Refresh() (string, int64, error)
}

type UserToken struct {
Expand All @@ -39,14 +38,11 @@ type UserToken struct {
type SyncVersion int

const (
Version10 SyncVersion = 10
Version15 SyncVersion = 15
)

func (s SyncVersion) String() string {
switch s {
case Version10:
return "1.0"
case Version15:
return "1.5"
default:
Expand All @@ -73,7 +69,7 @@ func ParseToken(userToken string) (token *UserInfo, err error) {

token = &UserInfo{
User: claims.Auth0.Email,
SyncVersion: Version10,
SyncVersion: Version15,
}

scopes := strings.Fields(claims.Scopes)
Expand All @@ -91,8 +87,6 @@ func ParseToken(userToken string) (token *UserInfo, err error) {
// CreateApiCtx initializes an instance of ApiCtx
func CreateApiCtx(httpCtx *transport.HttpClientCtx, syncVerison SyncVersion) (ctx ApiCtx, err error) {
switch syncVerison {
case Version10:
return sync10.CreateCtx(httpCtx)
case Version15:
return sync15.CreateCtx(httpCtx)
default:
Expand Down
Loading