Miek Gieben
1f586fdcda
Fixup PrevLabel and add a test
2013-09-12 09:58:42 +01:00
Miek Gieben
4ba292d8b6
Add a PrevLabel function to count back from the right
2013-09-12 09:36:39 +01:00
Miek Gieben
c67fc3a2a1
Add more tests for the labels
2013-09-12 09:18:54 +01:00
Miek Gieben
9764818db3
Make CountLabel faster
...
We don't need an allocation here, it works ok for non-fqdns and fqdns
2013-09-12 09:11:19 +01:00
Miek Gieben
b663a82eb3
Move deprecated function to the bottom of the file
2013-09-12 09:07:27 +01:00
Miek Gieben
8eb72eea8a
Add .
2013-09-12 09:03:09 +01:00
Miek Gieben
08e7365dc2
Make SplitLabels faster
...
don't allocate a new string at all, it does not matter is the given
string is not fully qualified.
2013-09-12 08:57:37 +01:00
Miek Gieben
7ef3106262
Add panics to make older Go versions happy
2013-07-12 14:27:16 +00:00
Miek Gieben
55aa4480c7
Fix some typos
2013-06-27 19:46:26 +01:00
Ray Bejjani
9d2d8b36eb
SplitDomainName handles non-FQDN labels correctly, doesn't return '.' in parts.
...
SplitDomainName would always include the '.' after each label segment. This was
inconsistent with the "." case (were it returned nil) and didn't seem too useful
since it required more processing to remove the '.' (like when building a
compression dictionary in Msg.Len() or Msg.Pack()). It also had issues with the
last segment, not including it in the split. It now returns all segments,
including the last, irrespective of the label being fully qualified.
A test has also been added to ensure no regressions.
2013-06-25 10:53:30 -07:00
Miek Gieben
45640bc8bd
Slightly better documentation
2013-06-24 08:14:30 +00:00
Miek Gieben
38ea608d79
Rename the Label* functions
...
SplitLabels -> SplitDomainName
CompareLabels -> CompareDomainName
LenLabels -> CountLabel
-> NextLabel was added as a simple iterator-like function
2013-06-22 07:21:15 +00:00
Miek Gieben
74a0da119d
Uh uppercase it here too
2013-06-21 15:31:19 +00:00
Miek Gieben
ef73958b14
Make nextLabel public
2013-06-21 15:23:31 +00:00
Miek Gieben
9640d43c82
Make SplitLabels use Split
2013-06-21 15:17:12 +00:00
Miek Gieben
939abbfea7
Re-arrange some comments
2013-06-21 08:53:24 +00:00
Miek Gieben
a16b289765
Add todo
2013-06-20 20:36:13 +00:00
Miek Gieben
1d22bfdb4d
Add more efficient label test functions
...
Also add tests for it.
2013-06-20 14:24:14 +00:00
Miek Gieben
cb1a259368
Add the first of faster/mem eff. labsl functions
2013-06-20 07:49:18 +01:00
Miek Gieben
81941d4422
Update all copyright notices
2013-05-12 16:15:52 +02:00
Miek Gieben
a2d98be202
lowercase the names
2012-09-04 20:08:55 +02:00
Miek Gieben
af2f485c8e
Fix IsSubDomain
2012-07-16 19:16:36 +02:00
Miek Gieben
393719d659
Add LenLabels function - no allocations
2012-07-16 08:51:39 +02:00
Miek Gieben
89c05b4f74
gofmt
2012-02-23 19:37:08 +01:00
Miek Gieben
95ffaca79d
typo
2012-02-14 22:43:04 +01:00
Miek Gieben
827e4a476f
Force the root label to have 0 labels
2012-02-14 22:26:18 +01:00
Miek Gieben
2cb265697e
Documentation
...
Need to think about the non-existing root-label and the label
functions.
2012-02-12 11:34:28 +01:00
Miek Gieben
09ac6c8dc5
gofmt
2012-01-28 00:35:37 +01:00
Miek Gieben
a61018d628
Allow quotes backslashes in names
2012-01-27 23:37:57 +01:00
Miek Gieben
99d2040a29
Fix escpaping in labels
2012-01-27 17:37:30 +01:00
Miek Gieben
b7466bd85d
Remove this function again
2012-01-11 08:51:43 +01:00
Miek Gieben
79d092bd29
One more helper function for compression
2012-01-10 16:34:14 +01:00
Miek Gieben
8f8633d9a0
Better documentation
2012-01-10 16:04:32 +01:00
Miek Gieben
d2acd22822
Add label functions and tests
2012-01-10 15:55:52 +01:00