aboutsummaryrefslogtreecommitdiff
path: root/lib/email/contenttype.go
AgeCommit message (Collapse)Author
2025-01-23all: use for-range with numericShulhan
Go 1.22 now support for-range on numeric value.
2024-03-02all: move the repository to "git.sr.ht/~shulhan/pakakeh.go"Shulhan
There are several reasons that why we move from github.com. First, related to the name of package. We accidentally name the package with "share" a common word in English that does not reflect the content of repository. By moving to other repository, we can rename it to better and unique name, in this "pakakeh.go". Pakakeh is Minang word for tools, and ".go" suffix indicate that the repository related to Go programming language. Second, supporting open source. The new repository is hosted under sourcehut.org, the founder is known to support open source, and all their services are licensed under AGPL, unlike GitHub that are closed sources. Third, regarding GitHub CoPilot. The GitHub Terms of Service [1], allow any public content that are hosted there granted them to parse the content. On one side, GitHub helps and flourish the open source, but on another side have an issues regarding scraping the copyleft license [2]. [1]: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service#4-license-grant-to-us [2]: https://githubcopilotinvestigation.com
2023-12-13all: fix linter warnings reported by reviveShulhan
There are some reports that I disagree with revive, in example, code should not declare the type after variables. In my opinion, on some cases, declaring the type make the code more readable and explicit. Since I did not want to add new configuration file, we changes it and follow revive for now.
2023-07-14lib/email: refactoring, replace field with type []byte to stringShulhan
Using string provide safety, guaranteed that if we pass it as parameter the receiver will not be able to modify its content.
2023-05-30lib/email: make the ContentType match case insensitiveShulhan
The GetParamValue and SetBoundary should match any parameter key in case insensitive matter. While at it, add examples for ParseContentType and SetBoundary, and move test for GetParamValue to Example.
2023-05-30lib/email: fix parsing multiple parameters in ContentTypeShulhan
While at it, also fix the ContentType String method to prefix ';' before appending parameter key and value.
2023-04-09lib/bytes: return the number of skipped chars on Skip(Horizontal)SpacesShulhan
2023-04-08lib/io: refactoring ParseContentType using lib/bytes#ParserShulhan
The libio.Reader will be deprecated and replaced with libbytes.Parser in the future.
2022-05-09all: reformat all codes using gofmt 1.19 (the Go tip)Shulhan
2022-02-27lib/email: make Message Pack works with single text or HTML partShulhan
Previouly, the Pack method generate multipart/alternative message only. Since the Message now can set the body text and HTML, without using NewMultipart, the Pack method need to be able to accomodate this.
2022-02-27lib/email: add methods to modify MessageShulhan
Previously, a Message can be created only using NewMultipart, which generate message with text and HTML. This changes add methods to compose a Message: AddCC, AddTo, SetBodyHtml, SetBodyText, SetCC, SetFrom, SetSubject, and SetTo.
2020-05-14email: add function to create multipart text and HTML messageShulhan
The NewMultipart() function create new email message using primary fields "from", "to", "subject" with content-type is set to "multipart/alternative".
2019-02-05lib/io: rename Reader SkipSpace to SkipSpacesShulhan
2019-02-05lib/email: update affecting by refactoring on lib/io.ReaderShulhan
2019-02-05lib/email: fix linter warnings on global var and inefficient assignmentsShulhan
2019-02-05lib/email: implement MIME header fields as defined in RFC 2045Shulhan
The implementation include parsing value of header Content-Type field.