This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
145 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package auth | ||
|
||
import ( | ||
"github.com/pksunkara/hub/utils" | ||
) | ||
|
||
type DestroyCommand struct{} | ||
|
||
func (a *DestroyCommand) Execute(args []string) error { | ||
Config("user", "") | ||
Config("token", "") | ||
|
||
utils.HandleInfo("You are now in `public` mode") | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package auth | ||
|
||
type Command struct { | ||
User UserCommand `command:"user" alias:"u" description:"Set an username to use their public data"` | ||
Private PrivateCommand `command:"private" alias:"p" description:"Give access to your private data"` | ||
Destroy DestroyCommand `command:"destroy" alias:"d" description:"Destroy authorization and delete username"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package auth | ||
|
||
// import ( | ||
// "fmt" | ||
// "github.com/howeyc/gopass" | ||
// ) | ||
|
||
type PrivateCommand struct{} | ||
|
||
func (a *PrivateCommand) Execute(args []string) error { | ||
return nil | ||
} | ||
|
||
func (a *PrivateCommand) Usage() string { | ||
return "<user>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package auth | ||
|
||
import ( | ||
"github.com/pksunkara/hub/utils" | ||
) | ||
|
||
type UserCommand struct{} | ||
|
||
func (a *UserCommand) Execute(args []string) error { | ||
if Config("token") != "" { | ||
return &utils.ErrModes{} | ||
} | ||
|
||
if len(args) == 1 { | ||
Config("user", args[0]) | ||
utils.HandleInfo("You are now in `user` mode") | ||
} else { | ||
return &utils.ErrArgument{} | ||
} | ||
|
||
return nil | ||
} | ||
|
||
func (a *UserCommand) Usage() string { | ||
return "<user>" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/pksunkara/hub/utils" | ||
) | ||
|
||
type RemoteCommand struct { | ||
RemoteAdd RemoteAddCommand `command:"add" description:"Add a github remote easily"` | ||
} | ||
|
||
func (r *RemoteCommand) Execute(args []string) error { | ||
return &ErrProxy{} | ||
return &utils.ErrProxy{} | ||
} |
Oops, something went wrong.