Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: - Parse Host, Port, Image and Tag with regular expressions #64

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bougar
Copy link
Contributor

@bougar bougar commented Oct 25, 2017

No description provided.

@hashmap
Copy link
Contributor

hashmap commented Oct 25, 2017

the first version used regexs, we switched to custom parsing later on 876ecd8

@bougar
Copy link
Contributor Author

bougar commented Oct 26, 2017

What's the point in using custom implementation instead regex? :D
Sorry by the inconveniencies, I did not see that commit. Anyway, I mind regex like:
ImageRegexp = match((?:[/])(?P<name>[a-zA-Z0-9/]*)[:@]?(?P<tag>.*)?)

@hashmap
Copy link
Contributor

hashmap commented Oct 27, 2017

One pass instead of multiple matches as it was before, you approach looks interesting

state = stateTag
}
nameParts = append(nameParts, part)
if !utils.ImageOnlyRegexp.MatchString(string(qname)) || strings.HasPrefix(qname, "localhost/") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type of qname already is string, why still need to convert it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ups, I thought it was a byte. There is no point in convert string into string XD

Copy link
Contributor

@supereagle supereagle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach is good, which makes it much clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants