-
Notifications
You must be signed in to change notification settings - Fork 4
The net mail library
The mail library implements parsing of mail messages. For the most part, this package follows the syntax as specified by RFC 5322 and extended by RFC 6532. Notable divergences:
- Obsolete address formats are not parsed, including addresses with embedded route information.
- The full range of spacing (the CFWS syntax element) is not supported, such as breaking addresses across lines.
- No unicode normalization is performed.
- A leading
fromline is permitted, as in mbox format (RFC 4155). Thetimelibrary implements aTimetype, functions to handle it, and a getter to get the current time from the system clock.
An enum containing the days of the week.
The name and address of the addressee of an email.
The header and body of an email.
A data structure to pass to get ... from to get the current time.
Time = struct (year int, month int, day int, hour int, minute int, second int, nanosecond int, location string)
A data structure representing a time.
Populates the reference variable with a Time representing the current time.
Extracts a list of Addresses from a header.
Parses a map to a Time.
Parses a string to an Address.
Parses a string to a Time.
Converts a raw string to a Message value.
Represents an Address as a string.
add(t, duration) returns the time t + duration, with the duration given in nanoseconds.
addDate(t, years, months, days) returns the time corresponding to adding the given number of years, months, and days to t.
after(t, u) reports whether the time instant t is after u.
before(t, u) reports whether the time instant t is before u.
compare(t, u) compares two times. The result is:
-
-1iftis beforeu -
0iftis equal tou -
+1iftis afteru
equal(t, u) reports whether t and u represent the same time instant.
format(t, layout) returns a textual representation of t formatted according to layout.
isDst(t) reports whether t is in daylight saving time.
ISOWeek(t) returns the ISO 8601 year and week number in which t occurs.
isZero(t) reports whether t represents the zero time instant.
local(t) returns t with its location set to the local time zone.
parse(layout, value) parses a formatted time string and returns a Time value.
parseDuration(s) parses a duration string.
round(t, duration) returns the result of rounding t to the nearest multiple of duration since the zero time.
sub(t, u) returns the duration t - u.
timeIn(t, location) returns t represented in the given IANA time zone location.
timeToUnix(t) returns the Unix time, the number of seconds elapsed since January 1, 1970 UTC.
timeToUnixMicro(t) returns the Unix time in microseconds.
timeToUnixMilli(t) returns the Unix time in milliseconds.
timeToUnixNano(t) returns the Unix time in nanoseconds.
truncate(t, duration) returns the result of rounding t down to a multiple of duration since the zero time.
unixToTime(sec, usec) returns the local Time corresponding to the given Unix time.
unixMicroToTime(usec) returns the local Time corresponding to the given Unix time expressed in microseconds.
unixMilliToTime(msec) returns the local Time corresponding to the given Unix time expressed in milliseconds.
UTC(t) returns t with its location set to UTC.
weekday(t) returns the day of the week specified by t.
goWeekday(t) is an internal helper returning the weekday as an integer.
yearDay(t) returns the day of the year specified by t, in the range 1 through 365 or 366 inclusive.
This page is automatically generated from the Pipefish standard library. Any edits made directly to this wiki page will be overwritten the next time the documentation is regenerated.
🧿 Pipefish is distributed under the MIT license. Please steal my code and ideas.
- Getting started
- Language basics
- The type system and built-in functions
- Functional Pipefish
- Encapsulation
- Imperative Pipefish
-
Imports and libraries
- The crypto/aes library
- The crypto/bcrypt library
- The crypto/rand library
- The crypto/rsa library
- The crypto/sha_256 library
- The crypto/sha_512 library
- The database/sql library
- The encoding/base_32 library
- The encoding/base_64 library
- The encoding/csv library
- The encoding/json library
- The files library
- The fmt library
- The html library
- The image library
- The image/bmp library
- The image/color library
- The image/jpeg library
- The image/png library
- The lists library
- The markdown library
- The math library
- The math/big library
- The math/cmplx library
- The math/rand library
- The net/http library
- The net/mail library
- The net/smtp library
- The net/url library
- The os/exec library
- The path library
- The path/filepath library
- The reflect library
- The regexp library
- The strconv library
- The strings library
- The terminal library
- The time library
- The unicode library
- Advanced Pipefish
- Developing in Pipefish
- Deployment
- Appendices