new structure #184

Closed
opened 2020-09-16 18:43:53 +00:00 by 6543 · 5 comments
Owner

internal structure

  • cmd <- only contain comand/flag options for urafen
    • subcomands are in a subpackage named after its parent comand
  • modules/task <- contain func for doing something with gitea
    (e.g. create token by user/passwd)
  • modules/print <- contain all functions that print to stdout
  • modules/config <- config tea & login things
  • modules/interact <- contain functions who interact with user by prompts (use survey?)
  • modules/git <- do git related stuff (get info/push/pull/checout/...)
  • modules/utils <- helper functions used by other functions

generell concepts

subcomands without args list objects (list issues/pulls/releases)
subsubcomand ls list obects with lots of filter options
subsubcomand create/edit without arguments ask user interactively
subsubcomand create/edit with arguments is controled fully by flags
subsubcomand delete show info what is deleted and ask user again, if force flag-y is not set

if subsubcomand refer to objects again, just follow subsubsub comand style as abouve ...

# internal structure - cmd <- only contain comand/flag options for urafen - subcomands are in a subpackage named after its parent comand - modules/task <- contain func for doing something with gitea (e.g. create token by user/passwd) - modules/print <- contain all functions that print to stdout - modules/config <- config tea & login things - modules/interact <- contain functions who interact with user by prompts (use survey?) - modules/git <- do git related stuff (get info/push/pull/checout/...) - modules/utils <- helper functions used by other functions # generell concepts subcomands without args list objects (list issues/pulls/releases) subsubcomand `ls` list obects with lots of filter options subsubcomand `create/edit` without arguments ask user interactively subsubcomand `create/edit` with arguments is controled fully by flags subsubcomand `delete` show info what is deleted and ask user again, if force flag`-y` is not set if subsubcomand refer to objects again, just follow subsubsub comand style as abouve ...
6543 added the
kind/docs
kind
refactor
status/needs-feedback
labels 2020-09-16 18:43:53 +00:00
6543 added this to the v0.6.0 milestone 2020-09-16 18:56:03 +00:00
6543 closed this issue 2020-09-18 00:34:50 +00:00
6543 reopened this issue 2020-09-18 00:34:54 +00:00
Member

I agree with the general concepts.

I don't have an opinion on package structure, but agree that we need more separation of concerns

I agree with the general concepts. I don't have an opinion on package structure, but agree that we need more separation of concerns
6543 removed the
status/needs-feedback
label 2020-09-28 00:56:06 +00:00
Member

See also #37

See also #37
Author
Owner

good point, we have some work to do to get tea compliant to thos proposals :D

-> we should unify and write them into CONTRIBUTING.md, after work is done

good point, we have some work to do to get tea compliant to thos proposals :D -> we should unify and write them into CONTRIBUTING.md, after work is done
Member

Remaining things to refactor:

  • modules/git/auth.go Lines 95 to 106 in c1d725ed34
    func promptUser(domain string) (string, error) {
    reader := bufio.NewReader(os.Stdin)
    fmt.Printf("%s username: ", domain)
    username, err := reader.ReadString('\n')
    return strings.TrimSpace(username), err
    }
    func promptPass(domain string) (string, error) {
    fmt.Printf("%s password: ", domain)
    pass, err := terminal.ReadPassword(0)
    return string(pass), err
    }
    -> modules/interact

  • ...?

Remaining things to refactor: - [ ] https://gitea.com/gitea/tea/src/commit/c1d725ed34a95159d6bea0815bcd3357f4505e65/modules/git/auth.go#L95-L106 -> modules/interact - [ ] ...?
Author
Owner

created issues: #226 to #246

so we can close this for now :)

created issues: #226 to #246 so we can close this for now :)
6543 closed this issue 2020-10-22 18:26:25 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/tea#184
No description provided.