id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens list | docstring stringlengths 6 2.61k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
13,700 | opsgenie/opsgenie-go-sdk | client/client.go | ScheduleRotationV2 | func (cli *OpsGenieClient) ScheduleRotationV2() (*OpsGenieScheduleRotationV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleRotationClient := new(OpsGenieScheduleRotationV2Client)
scheduleRotationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleRotationClient.SetOpsGenieAPIUrl(endpo... | go | func (cli *OpsGenieClient) ScheduleRotationV2() (*OpsGenieScheduleRotationV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleRotationClient := new(OpsGenieScheduleRotationV2Client)
scheduleRotationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleRotationClient.SetOpsGenieAPIUrl(endpo... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"ScheduleRotationV2",
"(",
")",
"(",
"*",
"OpsGenieScheduleRotationV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"scheduleRotationClient",
":=",
"new",
"(",
"OpsGenieSc... | // ScheduleRotationV2 instantiates a new OpsGenieScheduleRotationV2Client | [
"ScheduleRotationV2",
"instantiates",
"a",
"new",
"OpsGenieScheduleRotationV2Client"
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L361-L372 |
13,701 | opsgenie/opsgenie-go-sdk | client/client.go | buildCommonRequestProps | func (cli *OpsGenieClient) buildCommonRequestProps() goreq.Request {
if cli.httpTransportSettings == nil {
cli.makeHTTPTransportSettings()
}
goreq.SetConnectTimeout(cli.httpTransportSettings.ConnectionTimeout)
req := goreq.Request{}
if cli.proxy != nil {
req.Proxy = cli.proxy.toString()
}
req.UserAgent = use... | go | func (cli *OpsGenieClient) buildCommonRequestProps() goreq.Request {
if cli.httpTransportSettings == nil {
cli.makeHTTPTransportSettings()
}
goreq.SetConnectTimeout(cli.httpTransportSettings.ConnectionTimeout)
req := goreq.Request{}
if cli.proxy != nil {
req.Proxy = cli.proxy.toString()
}
req.UserAgent = use... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"buildCommonRequestProps",
"(",
")",
"goreq",
".",
"Request",
"{",
"if",
"cli",
".",
"httpTransportSettings",
"==",
"nil",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n",
"}",
"\n",
"goreq",
".",
... | // buildCommonRequestProps is an internal method to set common properties of requests that will send to OpsGenie. | [
"buildCommonRequestProps",
"is",
"an",
"internal",
"method",
"to",
"set",
"common",
"properties",
"of",
"requests",
"that",
"will",
"send",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L388-L402 |
13,702 | opsgenie/opsgenie-go-sdk | client/client.go | buildGetRequest | func (cli *OpsGenieClient) buildGetRequest(uri string, request interface{}) goreq.Request {
req := cli.buildCommonRequestProps()
req.Method = "GET"
req.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
uri = cli.OpsGenieAPIUrl() + uri
if request != nil {
v, _ := goquery.Values(request)
req.Uri =... | go | func (cli *OpsGenieClient) buildGetRequest(uri string, request interface{}) goreq.Request {
req := cli.buildCommonRequestProps()
req.Method = "GET"
req.ContentType = "application/x-www-form-urlencoded; charset=UTF-8"
uri = cli.OpsGenieAPIUrl() + uri
if request != nil {
v, _ := goquery.Values(request)
req.Uri =... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"buildGetRequest",
"(",
"uri",
"string",
",",
"request",
"interface",
"{",
"}",
")",
"goreq",
".",
"Request",
"{",
"req",
":=",
"cli",
".",
"buildCommonRequestProps",
"(",
")",
"\n",
"req",
".",
"Method",
"... | // buildGetRequest is an internal method to prepare a "GET" request that will send to OpsGenie. | [
"buildGetRequest",
"is",
"an",
"internal",
"method",
"to",
"prepare",
"a",
"GET",
"request",
"that",
"will",
"send",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L405-L419 |
13,703 | opsgenie/opsgenie-go-sdk | client/client.go | buildPostRequest | func (cli *OpsGenieClient) buildPostRequest(uri string, request interface{}) goreq.Request {
req := cli.buildCommonRequestProps()
req.Method = "POST"
req.ContentType = "application/json; charset=utf-8"
req.Uri = cli.OpsGenieAPIUrl() + uri
req.Body = request
j, _ := json.Marshal(request)
logging.Logger().Info("Ex... | go | func (cli *OpsGenieClient) buildPostRequest(uri string, request interface{}) goreq.Request {
req := cli.buildCommonRequestProps()
req.Method = "POST"
req.ContentType = "application/json; charset=utf-8"
req.Uri = cli.OpsGenieAPIUrl() + uri
req.Body = request
j, _ := json.Marshal(request)
logging.Logger().Info("Ex... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"buildPostRequest",
"(",
"uri",
"string",
",",
"request",
"interface",
"{",
"}",
")",
"goreq",
".",
"Request",
"{",
"req",
":=",
"cli",
".",
"buildCommonRequestProps",
"(",
")",
"\n",
"req",
".",
"Method",
... | // buildPostRequest is an internal method to prepare a "POST" request that will send to OpsGenie. | [
"buildPostRequest",
"is",
"an",
"internal",
"method",
"to",
"prepare",
"a",
"POST",
"request",
"that",
"will",
"send",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L422-L432 |
13,704 | opsgenie/opsgenie-go-sdk | client/client.go | buildDeleteRequest | func (cli *OpsGenieClient) buildDeleteRequest(uri string, request interface{}) goreq.Request {
req := cli.buildGetRequest(uri, request)
req.Method = "DELETE"
return req
} | go | func (cli *OpsGenieClient) buildDeleteRequest(uri string, request interface{}) goreq.Request {
req := cli.buildGetRequest(uri, request)
req.Method = "DELETE"
return req
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"buildDeleteRequest",
"(",
"uri",
"string",
",",
"request",
"interface",
"{",
"}",
")",
"goreq",
".",
"Request",
"{",
"req",
":=",
"cli",
".",
"buildGetRequest",
"(",
"uri",
",",
"request",
")",
"\n",
"req"... | // buildDeleteRequest is an internal method to prepare a "DELETE" request that will send to OpsGenie. | [
"buildDeleteRequest",
"is",
"an",
"internal",
"method",
"to",
"prepare",
"a",
"DELETE",
"request",
"that",
"will",
"send",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L534-L538 |
13,705 | opsgenie/opsgenie-go-sdk | client/client.go | buildPutRequest | func (cli *OpsGenieClient) buildPutRequest(uri string, request interface{}) goreq.Request {
req := cli.buildPostRequest(uri, request)
req.Method = "PUT"
return req
} | go | func (cli *OpsGenieClient) buildPutRequest(uri string, request interface{}) goreq.Request {
req := cli.buildPostRequest(uri, request)
req.Method = "PUT"
return req
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"buildPutRequest",
"(",
"uri",
"string",
",",
"request",
"interface",
"{",
"}",
")",
"goreq",
".",
"Request",
"{",
"req",
":=",
"cli",
".",
"buildPostRequest",
"(",
"uri",
",",
"request",
")",
"\n",
"req",
... | // buildPutRequest is an internal method to prepare a "DELETE" request that will send to OpsGenie. | [
"buildPutRequest",
"is",
"an",
"internal",
"method",
"to",
"prepare",
"a",
"DELETE",
"request",
"that",
"will",
"send",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L541-L545 |
13,706 | opsgenie/opsgenie-go-sdk | client/client.go | sendRequest | func (cli *OpsGenieClient) sendRequest(req goreq.Request) (*goreq.Response, error) {
// send the request
var resp *goreq.Response
var err error
for i := 0; i < cli.httpTransportSettings.MaxRetryAttempts; i++ {
resp, err = req.Do()
if err == nil && resp.StatusCode < 500 {
break
}
if resp != nil {
defer... | go | func (cli *OpsGenieClient) sendRequest(req goreq.Request) (*goreq.Response, error) {
// send the request
var resp *goreq.Response
var err error
for i := 0; i < cli.httpTransportSettings.MaxRetryAttempts; i++ {
resp, err = req.Do()
if err == nil && resp.StatusCode < 500 {
break
}
if resp != nil {
defer... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"sendRequest",
"(",
"req",
"goreq",
".",
"Request",
")",
"(",
"*",
"goreq",
".",
"Response",
",",
"error",
")",
"{",
"// send the request",
"var",
"resp",
"*",
"goreq",
".",
"Response",
"\n",
"var",
"err",
... | // sendRequest is an internal method to send the prepared requests to OpsGenie. | [
"sendRequest",
"is",
"an",
"internal",
"method",
"to",
"send",
"the",
"prepared",
"requests",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L548-L582 |
13,707 | opsgenie/opsgenie-go-sdk | client/client.go | errorMessage | func errorMessage(httpStatusCode int, responseBody string) error {
if httpStatusCode >= 400 && httpStatusCode < 500 {
message := fmt.Sprintf("Client error occurred; Response Code: %d, Response Body: %s", httpStatusCode, responseBody)
logging.Logger().Warn(message)
return errors.New(message)
}
if httpStatusCode... | go | func errorMessage(httpStatusCode int, responseBody string) error {
if httpStatusCode >= 400 && httpStatusCode < 500 {
message := fmt.Sprintf("Client error occurred; Response Code: %d, Response Body: %s", httpStatusCode, responseBody)
logging.Logger().Warn(message)
return errors.New(message)
}
if httpStatusCode... | [
"func",
"errorMessage",
"(",
"httpStatusCode",
"int",
",",
"responseBody",
"string",
")",
"error",
"{",
"if",
"httpStatusCode",
">=",
"400",
"&&",
"httpStatusCode",
"<",
"500",
"{",
"message",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"httpStatusCod... | // errorMessage is an internal method to return formatted error message according to HTTP status code of the response. | [
"errorMessage",
"is",
"an",
"internal",
"method",
"to",
"return",
"formatted",
"error",
"message",
"according",
"to",
"HTTP",
"status",
"code",
"of",
"the",
"response",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L585-L597 |
13,708 | opsgenie/opsgenie-go-sdk | userv2/list_user_schedules_request.go | GenerateUrl | func (r *ListUserSchedulesRequest) GenerateUrl() (string, url.Values, error) {
baseUrl, params, err := r.Identifier.GenerateUrl()
if err != nil {
return "", nil, err
}
return baseUrl + "/schedules", params, err;
} | go | func (r *ListUserSchedulesRequest) GenerateUrl() (string, url.Values, error) {
baseUrl, params, err := r.Identifier.GenerateUrl()
if err != nil {
return "", nil, err
}
return baseUrl + "/schedules", params, err;
} | [
"func",
"(",
"r",
"*",
"ListUserSchedulesRequest",
")",
"GenerateUrl",
"(",
")",
"(",
"string",
",",
"url",
".",
"Values",
",",
"error",
")",
"{",
"baseUrl",
",",
"params",
",",
"err",
":=",
"r",
".",
"Identifier",
".",
"GenerateUrl",
"(",
")",
"\n\n",... | // GenerateUrl generates API url using specified attributes of identifier. | [
"GenerateUrl",
"generates",
"API",
"url",
"using",
"specified",
"attributes",
"of",
"identifier",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/userv2/list_user_schedules_request.go#L17-L24 |
13,709 | safchain/ethtool | ethtool.go | DriverName | func (e *Ethtool) DriverName(intf string) (string, error) {
info, err := e.getDriverInfo(intf)
if err != nil {
return "", err
}
return string(bytes.Trim(info.driver[:], "\x00")), nil
} | go | func (e *Ethtool) DriverName(intf string) (string, error) {
info, err := e.getDriverInfo(intf)
if err != nil {
return "", err
}
return string(bytes.Trim(info.driver[:], "\x00")), nil
} | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"DriverName",
"(",
"intf",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"info",
",",
"err",
":=",
"e",
".",
"getDriverInfo",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\... | // DriverName returns the driver name of the given interface name. | [
"DriverName",
"returns",
"the",
"driver",
"name",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L177-L183 |
13,710 | safchain/ethtool | ethtool.go | BusInfo | func (e *Ethtool) BusInfo(intf string) (string, error) {
info, err := e.getDriverInfo(intf)
if err != nil {
return "", err
}
return string(bytes.Trim(info.bus_info[:], "\x00")), nil
} | go | func (e *Ethtool) BusInfo(intf string) (string, error) {
info, err := e.getDriverInfo(intf)
if err != nil {
return "", err
}
return string(bytes.Trim(info.bus_info[:], "\x00")), nil
} | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"BusInfo",
"(",
"intf",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"info",
",",
"err",
":=",
"e",
".",
"getDriverInfo",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",... | // BusInfo returns the bus information of the given interface name. | [
"BusInfo",
"returns",
"the",
"bus",
"information",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L186-L192 |
13,711 | safchain/ethtool | ethtool.go | DriverInfo | func (e *Ethtool) DriverInfo(intf string) (ethtoolDrvInfo, error) {
drvInfo, err := e.getDriverInfo(intf)
if err != nil {
return ethtoolDrvInfo{}, err
}
return drvInfo, nil
} | go | func (e *Ethtool) DriverInfo(intf string) (ethtoolDrvInfo, error) {
drvInfo, err := e.getDriverInfo(intf)
if err != nil {
return ethtoolDrvInfo{}, err
}
return drvInfo, nil
} | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"DriverInfo",
"(",
"intf",
"string",
")",
"(",
"ethtoolDrvInfo",
",",
"error",
")",
"{",
"drvInfo",
",",
"err",
":=",
"e",
".",
"getDriverInfo",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // DriverInfo returns driver information of the given interface name. | [
"DriverInfo",
"returns",
"driver",
"information",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L215-L222 |
13,712 | safchain/ethtool | ethtool.go | PermAddr | func (e *Ethtool) PermAddr(intf string) (string, error) {
permAddr, err := e.getPermAddr(intf)
if err != nil {
return "", err
}
if permAddr.data[0] == 0 && permAddr.data[1] == 0 &&
permAddr.data[2] == 0 && permAddr.data[3] == 0 &&
permAddr.data[4] == 0 && permAddr.data[5] == 0 {
return "", nil
}
return ... | go | func (e *Ethtool) PermAddr(intf string) (string, error) {
permAddr, err := e.getPermAddr(intf)
if err != nil {
return "", err
}
if permAddr.data[0] == 0 && permAddr.data[1] == 0 &&
permAddr.data[2] == 0 && permAddr.data[3] == 0 &&
permAddr.data[4] == 0 && permAddr.data[5] == 0 {
return "", nil
}
return ... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"PermAddr",
"(",
"intf",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"permAddr",
",",
"err",
":=",
"e",
".",
"getPermAddr",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\... | // PermAddr returns permanent address of the given interface name. | [
"PermAddr",
"returns",
"permanent",
"address",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L225-L245 |
13,713 | safchain/ethtool | ethtool.go | FeatureNames | func (e *Ethtool) FeatureNames(intf string) (map[string]uint, error) {
ssetInfo := ethtoolSsetInfo{
cmd: ETHTOOL_GSSET_INFO,
sset_mask: 1 << ETH_SS_FEATURES,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&ssetInfo))); err != nil {
return nil, err
}
length := uint32(ssetInfo.data)
if length == 0 {... | go | func (e *Ethtool) FeatureNames(intf string) (map[string]uint, error) {
ssetInfo := ethtoolSsetInfo{
cmd: ETHTOOL_GSSET_INFO,
sset_mask: 1 << ETH_SS_FEATURES,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&ssetInfo))); err != nil {
return nil, err
}
length := uint32(ssetInfo.data)
if length == 0 {... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"FeatureNames",
"(",
"intf",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"uint",
",",
"error",
")",
"{",
"ssetInfo",
":=",
"ethtoolSsetInfo",
"{",
"cmd",
":",
"ETHTOOL_GSSET_INFO",
",",
"sset_mask",
":",
"1",
"... | // FeatureNames shows supported features by their name. | [
"FeatureNames",
"shows",
"supported",
"features",
"by",
"their",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L332-L370 |
13,714 | safchain/ethtool | ethtool.go | Features | func (e *Ethtool) Features(intf string) (map[string]bool, error) {
names, err := e.FeatureNames(intf)
if err != nil {
return nil, err
}
length := uint32(len(names))
if length == 0 {
return map[string]bool{}, nil
}
features := ethtoolGfeatures{
cmd: ETHTOOL_GFEATURES,
size: (length + 32 - 1) / 32,
}
... | go | func (e *Ethtool) Features(intf string) (map[string]bool, error) {
names, err := e.FeatureNames(intf)
if err != nil {
return nil, err
}
length := uint32(len(names))
if length == 0 {
return map[string]bool{}, nil
}
features := ethtoolGfeatures{
cmd: ETHTOOL_GFEATURES,
size: (length + 32 - 1) / 32,
}
... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"Features",
"(",
"intf",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"bool",
",",
"error",
")",
"{",
"names",
",",
"err",
":=",
"e",
".",
"FeatureNames",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // Features retrieves features of the given interface name. | [
"Features",
"retrieves",
"features",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L373-L399 |
13,715 | safchain/ethtool | ethtool.go | Change | func (e *Ethtool) Change(intf string, config map[string]bool) error {
names, err := e.FeatureNames(intf)
if err != nil {
return err
}
length := uint32(len(names))
features := ethtoolSfeatures{
cmd: ETHTOOL_SFEATURES,
size: (length + 32 - 1) / 32,
}
for key, value := range config {
if index, ok := nam... | go | func (e *Ethtool) Change(intf string, config map[string]bool) error {
names, err := e.FeatureNames(intf)
if err != nil {
return err
}
length := uint32(len(names))
features := ethtoolSfeatures{
cmd: ETHTOOL_SFEATURES,
size: (length + 32 - 1) / 32,
}
for key, value := range config {
if index, ok := nam... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"Change",
"(",
"intf",
"string",
",",
"config",
"map",
"[",
"string",
"]",
"bool",
")",
"error",
"{",
"names",
",",
"err",
":=",
"e",
".",
"FeatureNames",
"(",
"intf",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{... | // Change requests a change in the given device's features. | [
"Change",
"requests",
"a",
"change",
"in",
"the",
"given",
"device",
"s",
"features",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L402-L424 |
13,716 | safchain/ethtool | ethtool.go | LinkState | func (e *Ethtool) LinkState(intf string) (uint32, error) {
x := ethtoolLink{
cmd: ETHTOOL_GLINK,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&x))); err != nil {
return 0, err
}
return x.data, nil
} | go | func (e *Ethtool) LinkState(intf string) (uint32, error) {
x := ethtoolLink{
cmd: ETHTOOL_GLINK,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&x))); err != nil {
return 0, err
}
return x.data, nil
} | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"LinkState",
"(",
"intf",
"string",
")",
"(",
"uint32",
",",
"error",
")",
"{",
"x",
":=",
"ethtoolLink",
"{",
"cmd",
":",
"ETHTOOL_GLINK",
",",
"}",
"\n\n",
"if",
"err",
":=",
"e",
".",
"ioctl",
"(",
"intf",
... | // Get state of a link. | [
"Get",
"state",
"of",
"a",
"link",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L427-L437 |
13,717 | safchain/ethtool | ethtool.go | Stats | func (e *Ethtool) Stats(intf string) (map[string]uint64, error) {
drvinfo := ethtoolDrvInfo{
cmd: ETHTOOL_GDRVINFO,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&drvinfo))); err != nil {
return nil, err
}
if drvinfo.n_stats*ETH_GSTRING_LEN > MAX_GSTRINGS*ETH_GSTRING_LEN {
return nil, fmt.Errorf("ethtoo... | go | func (e *Ethtool) Stats(intf string) (map[string]uint64, error) {
drvinfo := ethtoolDrvInfo{
cmd: ETHTOOL_GDRVINFO,
}
if err := e.ioctl(intf, uintptr(unsafe.Pointer(&drvinfo))); err != nil {
return nil, err
}
if drvinfo.n_stats*ETH_GSTRING_LEN > MAX_GSTRINGS*ETH_GSTRING_LEN {
return nil, fmt.Errorf("ethtoo... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"Stats",
"(",
"intf",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"uint64",
",",
"error",
")",
"{",
"drvinfo",
":=",
"ethtoolDrvInfo",
"{",
"cmd",
":",
"ETHTOOL_GDRVINFO",
",",
"}",
"\n\n",
"if",
"err",
":=",... | // Stats retrieves stats of the given interface name. | [
"Stats",
"retrieves",
"stats",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L440-L484 |
13,718 | safchain/ethtool | ethtool.go | NewEthtool | func NewEthtool() (*Ethtool, error) {
fd, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_IP)
if err != nil {
return nil, err
}
return &Ethtool{
fd: int(fd),
}, nil
} | go | func NewEthtool() (*Ethtool, error) {
fd, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_IP)
if err != nil {
return nil, err
}
return &Ethtool{
fd: int(fd),
}, nil
} | [
"func",
"NewEthtool",
"(",
")",
"(",
"*",
"Ethtool",
",",
"error",
")",
"{",
"fd",
",",
"err",
":=",
"syscall",
".",
"Socket",
"(",
"syscall",
".",
"AF_INET",
",",
"syscall",
".",
"SOCK_DGRAM",
",",
"syscall",
".",
"IPPROTO_IP",
")",
"\n",
"if",
"err... | // NewEthtool returns a new ethtool handler | [
"NewEthtool",
"returns",
"a",
"new",
"ethtool",
"handler"
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L492-L501 |
13,719 | safchain/ethtool | ethtool.go | BusInfo | func BusInfo(intf string) (string, error) {
e, err := NewEthtool()
if err != nil {
return "", err
}
defer e.Close()
return e.BusInfo(intf)
} | go | func BusInfo(intf string) (string, error) {
e, err := NewEthtool()
if err != nil {
return "", err
}
defer e.Close()
return e.BusInfo(intf)
} | [
"func",
"BusInfo",
"(",
"intf",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"e",
",",
"err",
":=",
"NewEthtool",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"defer",
"e",
".",
"Clo... | // BusInfo returns bus information of the given interface name. | [
"BusInfo",
"returns",
"bus",
"information",
"of",
"the",
"given",
"interface",
"name",
"."
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool.go#L504-L511 |
13,720 | safchain/ethtool | ethtool_cmd.go | CmdSet | func (ecmd *EthtoolCmd) CmdSet(intf string) (uint32, error) {
e, err := NewEthtool()
if err != nil {
return 0, err
}
defer e.Close()
return e.CmdSet(ecmd, intf)
} | go | func (ecmd *EthtoolCmd) CmdSet(intf string) (uint32, error) {
e, err := NewEthtool()
if err != nil {
return 0, err
}
defer e.Close()
return e.CmdSet(ecmd, intf)
} | [
"func",
"(",
"ecmd",
"*",
"EthtoolCmd",
")",
"CmdSet",
"(",
"intf",
"string",
")",
"(",
"uint32",
",",
"error",
")",
"{",
"e",
",",
"err",
":=",
"NewEthtool",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"0",
",",
"err",
"\n",
"}",
... | // CmdSet sets and returns the settings in the receiver struct
// and returns speed | [
"CmdSet",
"sets",
"and",
"returns",
"the",
"settings",
"in",
"the",
"receiver",
"struct",
"and",
"returns",
"speed"
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool_cmd.go#L68-L75 |
13,721 | safchain/ethtool | ethtool_cmd.go | CmdGet | func (e *Ethtool) CmdGet(ecmd *EthtoolCmd, intf string) (uint32, error) {
ecmd.Cmd = ETHTOOL_GSET
var name [IFNAMSIZ]byte
copy(name[:], []byte(intf))
ifr := ifreq{
ifr_name: name,
ifr_data: uintptr(unsafe.Pointer(ecmd)),
}
_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
SIOCETHTOOL, uintptr... | go | func (e *Ethtool) CmdGet(ecmd *EthtoolCmd, intf string) (uint32, error) {
ecmd.Cmd = ETHTOOL_GSET
var name [IFNAMSIZ]byte
copy(name[:], []byte(intf))
ifr := ifreq{
ifr_name: name,
ifr_data: uintptr(unsafe.Pointer(ecmd)),
}
_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
SIOCETHTOOL, uintptr... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"CmdGet",
"(",
"ecmd",
"*",
"EthtoolCmd",
",",
"intf",
"string",
")",
"(",
"uint32",
",",
"error",
")",
"{",
"ecmd",
".",
"Cmd",
"=",
"ETHTOOL_GSET",
"\n\n",
"var",
"name",
"[",
"IFNAMSIZ",
"]",
"byte",
"\n",
... | // CmdGet returns the interface settings in the receiver struct
// and returns speed | [
"CmdGet",
"returns",
"the",
"interface",
"settings",
"in",
"the",
"receiver",
"struct",
"and",
"returns",
"speed"
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool_cmd.go#L113-L137 |
13,722 | safchain/ethtool | ethtool_cmd.go | CmdGetMapped | func (e *Ethtool) CmdGetMapped(intf string) (map[string]uint64, error) {
ecmd := EthtoolCmd{
Cmd: ETHTOOL_GSET,
}
var name [IFNAMSIZ]byte
copy(name[:], []byte(intf))
ifr := ifreq{
ifr_name: name,
ifr_data: uintptr(unsafe.Pointer(&ecmd)),
}
_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
... | go | func (e *Ethtool) CmdGetMapped(intf string) (map[string]uint64, error) {
ecmd := EthtoolCmd{
Cmd: ETHTOOL_GSET,
}
var name [IFNAMSIZ]byte
copy(name[:], []byte(intf))
ifr := ifreq{
ifr_name: name,
ifr_data: uintptr(unsafe.Pointer(&ecmd)),
}
_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
... | [
"func",
"(",
"e",
"*",
"Ethtool",
")",
"CmdGetMapped",
"(",
"intf",
"string",
")",
"(",
"map",
"[",
"string",
"]",
"uint64",
",",
"error",
")",
"{",
"ecmd",
":=",
"EthtoolCmd",
"{",
"Cmd",
":",
"ETHTOOL_GSET",
",",
"}",
"\n\n",
"var",
"name",
"[",
... | // CmdGetMapped returns the interface settings in a map | [
"CmdGetMapped",
"returns",
"the",
"interface",
"settings",
"in",
"a",
"map"
] | 42ed695e3de80b9d695f280295fd7994639f209d | https://github.com/safchain/ethtool/blob/42ed695e3de80b9d695f280295fd7994639f209d/ethtool_cmd.go#L168-L198 |
13,723 | mikeflynn/go-alexa | skillserver/skillserver.go | Run | func Run(apps map[string]interface{}, port string) {
router := mux.NewRouter()
initialize(apps, router)
n := negroni.Classic()
n.UseHandler(router)
n.Run(":" + port)
} | go | func Run(apps map[string]interface{}, port string) {
router := mux.NewRouter()
initialize(apps, router)
n := negroni.Classic()
n.UseHandler(router)
n.Run(":" + port)
} | [
"func",
"Run",
"(",
"apps",
"map",
"[",
"string",
"]",
"interface",
"{",
"}",
",",
"port",
"string",
")",
"{",
"router",
":=",
"mux",
".",
"NewRouter",
"(",
")",
"\n",
"initialize",
"(",
"apps",
",",
"router",
")",
"\n\n",
"n",
":=",
"negroni",
"."... | // Run will initialize the apps provided and start an HTTP server listening on the specified port. | [
"Run",
"will",
"initialize",
"the",
"apps",
"provided",
"and",
"start",
"an",
"HTTP",
"server",
"listening",
"on",
"the",
"specified",
"port",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/skillserver.go#L72-L79 |
13,724 | mikeflynn/go-alexa | skillserver/skillserver.go | GetEchoRequest | func GetEchoRequest(r *http.Request) *EchoRequest {
return r.Context().Value(requestContextKey("echoRequest")).(*EchoRequest)
} | go | func GetEchoRequest(r *http.Request) *EchoRequest {
return r.Context().Value(requestContextKey("echoRequest")).(*EchoRequest)
} | [
"func",
"GetEchoRequest",
"(",
"r",
"*",
"http",
".",
"Request",
")",
"*",
"EchoRequest",
"{",
"return",
"r",
".",
"Context",
"(",
")",
".",
"Value",
"(",
"requestContextKey",
"(",
"\"",
"\"",
")",
")",
".",
"(",
"*",
"EchoRequest",
")",
"\n",
"}"
] | // GetEchoRequest is a convenience method for retrieving and casting an `EchoRequest` out of a
// standard `http.Request`. | [
"GetEchoRequest",
"is",
"a",
"convenience",
"method",
"for",
"retrieving",
"and",
"casting",
"an",
"EchoRequest",
"out",
"of",
"a",
"standard",
"http",
".",
"Request",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/skillserver.go#L188-L190 |
13,725 | mikeflynn/go-alexa | skillserver/skillserver.go | HTTPError | func HTTPError(w http.ResponseWriter, logMsg string, err string, errCode int) {
if logMsg != "" {
log.Println(logMsg)
}
http.Error(w, err, errCode)
} | go | func HTTPError(w http.ResponseWriter, logMsg string, err string, errCode int) {
if logMsg != "" {
log.Println(logMsg)
}
http.Error(w, err, errCode)
} | [
"func",
"HTTPError",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"logMsg",
"string",
",",
"err",
"string",
",",
"errCode",
"int",
")",
"{",
"if",
"logMsg",
"!=",
"\"",
"\"",
"{",
"log",
".",
"Println",
"(",
"logMsg",
")",
"\n",
"}",
"\n\n",
"http",... | // HTTPError is a convenience method for logging a message and writing the provided error message
// and error code to the HTTP response. | [
"HTTPError",
"is",
"a",
"convenience",
"method",
"for",
"logging",
"a",
"message",
"and",
"writing",
"the",
"provided",
"error",
"message",
"and",
"error",
"code",
"to",
"the",
"HTTP",
"response",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/skillserver.go#L194-L200 |
13,726 | mikeflynn/go-alexa | skillserver/skillserver.go | verifyJSON | func verifyJSON(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
var echoReq *EchoRequest
err := json.NewDecoder(r.Body).Decode(&echoReq)
if err != nil {
HTTPError(w, err.Error(), "Bad Request", 400)
return
}
// Check the timestamp
if !echoReq.VerifyTimestamp() && r.URL.Query().Get("_dev") ==... | go | func verifyJSON(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
var echoReq *EchoRequest
err := json.NewDecoder(r.Body).Decode(&echoReq)
if err != nil {
HTTPError(w, err.Error(), "Bad Request", 400)
return
}
// Check the timestamp
if !echoReq.VerifyTimestamp() && r.URL.Query().Get("_dev") ==... | [
"func",
"verifyJSON",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"next",
"http",
".",
"HandlerFunc",
")",
"{",
"var",
"echoReq",
"*",
"EchoRequest",
"\n",
"err",
":=",
"json",
".",
"NewDecoder",
"(",
"r",
".",
... | // Decode the JSON request and verify it. | [
"Decode",
"the",
"JSON",
"request",
"and",
"verify",
"it",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/skillserver.go#L203-L226 |
13,727 | mikeflynn/go-alexa | skillserver/skillserver.go | validateRequest | func validateRequest(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
devFlag := r.URL.Query().Get("_dev")
isDev := devFlag != ""
if !isDev && !IsValidAlexaRequest(w, r) {
log.Println("Request invalid")
return
}
next(w, r)
} | go | func validateRequest(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
devFlag := r.URL.Query().Get("_dev")
isDev := devFlag != ""
if !isDev && !IsValidAlexaRequest(w, r) {
log.Println("Request invalid")
return
}
next(w, r)
} | [
"func",
"validateRequest",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
",",
"next",
"http",
".",
"HandlerFunc",
")",
"{",
"devFlag",
":=",
"r",
".",
"URL",
".",
"Query",
"(",
")",
".",
"Get",
"(",
"\"",
"\"",
")"... | // Run all mandatory Amazon security checks on the request. | [
"Run",
"all",
"mandatory",
"Amazon",
"security",
"checks",
"on",
"the",
"request",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/skillserver.go#L229-L237 |
13,728 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendPlainSpeech | func (builder *SSMLTextBuilder) AppendPlainSpeech(text string) *SSMLTextBuilder {
builder.buffer.WriteString(text)
return builder
} | go | func (builder *SSMLTextBuilder) AppendPlainSpeech(text string) *SSMLTextBuilder {
builder.buffer.WriteString(text)
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendPlainSpeech",
"(",
"text",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"text",
")",
"\n\n",
"return",
"builder",
"\n",
"}"
] | // AppendPlainSpeech will append the supplied text as regular speech to be spoken by the Alexa device. | [
"AppendPlainSpeech",
"will",
"append",
"the",
"supplied",
"text",
"as",
"regular",
"speech",
"to",
"be",
"spoken",
"by",
"the",
"Alexa",
"device",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L59-L64 |
13,729 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendAmazonEffect | func (builder *SSMLTextBuilder) AppendAmazonEffect(text, name string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<amazon:effect name=\"%s\">%s</amazon:effect>", name, text))
return builder
} | go | func (builder *SSMLTextBuilder) AppendAmazonEffect(text, name string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<amazon:effect name=\"%s\">%s</amazon:effect>", name, text))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendAmazonEffect",
"(",
"text",
",",
"name",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",... | // AppendAmazonEffect will add a new speech string with the provided effect name.
// Check the SSML reference page for a list of available effects. | [
"AppendAmazonEffect",
"will",
"add",
"a",
"new",
"speech",
"string",
"with",
"the",
"provided",
"effect",
"name",
".",
"Check",
"the",
"SSML",
"reference",
"page",
"for",
"a",
"list",
"of",
"available",
"effects",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L68-L73 |
13,730 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendAudio | func (builder *SSMLTextBuilder) AppendAudio(src string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<audio src=\"%s\"/>", src))
return builder
} | go | func (builder *SSMLTextBuilder) AppendAudio(src string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<audio src=\"%s\"/>", src))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendAudio",
"(",
"src",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",
"src",
")",
")",
... | // AppendAudio will append the playback of an MP3 file to the response. The audio playback
// will take place at the specific point in the text to speech response. | [
"AppendAudio",
"will",
"append",
"the",
"playback",
"of",
"an",
"MP3",
"file",
"to",
"the",
"response",
".",
"The",
"audio",
"playback",
"will",
"take",
"place",
"at",
"the",
"specific",
"point",
"in",
"the",
"text",
"to",
"speech",
"response",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L77-L82 |
13,731 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendBreak | func (builder *SSMLTextBuilder) AppendBreak(strength, time string) *SSMLTextBuilder {
if strength == "" {
// The default strength is medium
strength = "medium"
}
builder.buffer.WriteString(fmt.Sprintf("<break strength=\"%s\" time=\"%s\"/>", strength, time))
return builder
} | go | func (builder *SSMLTextBuilder) AppendBreak(strength, time string) *SSMLTextBuilder {
if strength == "" {
// The default strength is medium
strength = "medium"
}
builder.buffer.WriteString(fmt.Sprintf("<break strength=\"%s\" time=\"%s\"/>", strength, time))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendBreak",
"(",
"strength",
",",
"time",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"if",
"strength",
"==",
"\"",
"\"",
"{",
"// The default strength is medium",
"strength",
"=",
"\"",
"\"",
"\n",
"}",
... | // AppendBreak will add a pause to the text to speech output. The default is a medium pause.
// Refer to the SSML reference for the available strength values. | [
"AppendBreak",
"will",
"add",
"a",
"pause",
"to",
"the",
"text",
"to",
"speech",
"output",
".",
"The",
"default",
"is",
"a",
"medium",
"pause",
".",
"Refer",
"to",
"the",
"SSML",
"reference",
"for",
"the",
"available",
"strength",
"values",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L86-L96 |
13,732 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendEmphasis | func (builder *SSMLTextBuilder) AppendEmphasis(text, level string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<emphasis level=\"%s\">%s</emphasis>", level, text))
return builder
} | go | func (builder *SSMLTextBuilder) AppendEmphasis(text, level string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<emphasis level=\"%s\">%s</emphasis>", level, text))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendEmphasis",
"(",
"text",
",",
"level",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
",",
... | // AppendEmphasis will include a set of text to be spoken with the specific level of emphasis.
// Refer to the SSML reference for available emphasis level values. | [
"AppendEmphasis",
"will",
"include",
"a",
"set",
"of",
"text",
"to",
"be",
"spoken",
"with",
"the",
"specific",
"level",
"of",
"emphasis",
".",
"Refer",
"to",
"the",
"SSML",
"reference",
"for",
"available",
"emphasis",
"level",
"values",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L100-L105 |
13,733 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendParagraph | func (builder *SSMLTextBuilder) AppendParagraph(text string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<p>%s</p>", text))
return builder
} | go | func (builder *SSMLTextBuilder) AppendParagraph(text string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<p>%s</p>", text))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendParagraph",
"(",
"text",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"text",
")",
")",
"\n\n",
"re... | // AppendParagraph will append the specific text as a new paragraph. Extra strong breaks will
// be used before and after this text. | [
"AppendParagraph",
"will",
"append",
"the",
"specific",
"text",
"as",
"a",
"new",
"paragraph",
".",
"Extra",
"strong",
"breaks",
"will",
"be",
"used",
"before",
"and",
"after",
"this",
"text",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L109-L114 |
13,734 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendProsody | func (builder *SSMLTextBuilder) AppendProsody(text, rate, pitch, volume string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<prosody rate=\"%s\" pitch=\"%s\" volume=\"%s\">%s</prosody>", rate, pitch, volume, text))
return builder
} | go | func (builder *SSMLTextBuilder) AppendProsody(text, rate, pitch, volume string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<prosody rate=\"%s\" pitch=\"%s\" volume=\"%s\">%s</prosody>", rate, pitch, volume, text))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendProsody",
"(",
"text",
",",
"rate",
",",
"pitch",
",",
"volume",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
... | // AppendProsody provides a way to modify the rate, pitch, and volume of a piece of spoken text. | [
"AppendProsody",
"provides",
"a",
"way",
"to",
"modify",
"the",
"rate",
"pitch",
"and",
"volume",
"of",
"a",
"piece",
"of",
"spoken",
"text",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L117-L122 |
13,735 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendPartOfSpeech | func (builder *SSMLTextBuilder) AppendPartOfSpeech(role WordRole, text string) *SSMLTextBuilder {
if role != "" {
builder.buffer.WriteString(fmt.Sprintf("<w role=\"%s\">%s</w>", role, text))
}
return builder
} | go | func (builder *SSMLTextBuilder) AppendPartOfSpeech(role WordRole, text string) *SSMLTextBuilder {
if role != "" {
builder.buffer.WriteString(fmt.Sprintf("<w role=\"%s\">%s</w>", role, text))
}
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendPartOfSpeech",
"(",
"role",
"WordRole",
",",
"text",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"if",
"role",
"!=",
"\"",
"\"",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",... | // AppendPartOfSpeech is used to explictily define the part of speech for a word that is being
// appended to the text to speech output sent in a skill server response. | [
"AppendPartOfSpeech",
"is",
"used",
"to",
"explictily",
"define",
"the",
"part",
"of",
"speech",
"for",
"a",
"word",
"that",
"is",
"being",
"appended",
"to",
"the",
"text",
"to",
"speech",
"output",
"sent",
"in",
"a",
"skill",
"server",
"response",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L135-L142 |
13,736 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendSubstitution | func (builder *SSMLTextBuilder) AppendSubstitution(text, alias string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<sub alias=\"%s\">%s</sub>", alias, text))
return builder
} | go | func (builder *SSMLTextBuilder) AppendSubstitution(text, alias string) *SSMLTextBuilder {
builder.buffer.WriteString(fmt.Sprintf("<sub alias=\"%s\">%s</sub>", alias, text))
return builder
} | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendSubstitution",
"(",
"text",
",",
"alias",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\\"",
"\\\"",
"\"",
","... | // AppendSubstitution provides a way to indicate an alternate pronunciation for a piece of text. | [
"AppendSubstitution",
"provides",
"a",
"way",
"to",
"indicate",
"an",
"alternate",
"pronunciation",
"for",
"a",
"piece",
"of",
"text",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L145-L150 |
13,737 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendSayAs | func (builder *SSMLTextBuilder) AppendSayAs(interpretAs, format, text string) *SSMLTextBuilder {
if interpretAs == "date" {
builder.buffer.WriteString(fmt.Sprintf("<say-as interpret-as=\"%s\" format=\"%s\">%s</say-as>",
interpretAs, format, text))
} else if interpretAs != "" {
builder.buffer.WriteString(fmt.S... | go | func (builder *SSMLTextBuilder) AppendSayAs(interpretAs, format, text string) *SSMLTextBuilder {
if interpretAs == "date" {
builder.buffer.WriteString(fmt.Sprintf("<say-as interpret-as=\"%s\" format=\"%s\">%s</say-as>",
interpretAs, format, text))
} else if interpretAs != "" {
builder.buffer.WriteString(fmt.S... | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendSayAs",
"(",
"interpretAs",
",",
"format",
",",
"text",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"if",
"interpretAs",
"==",
"\"",
"\"",
"{",
"builder",
".",
"buffer",
".",
"WriteString",
"(",
"... | // AppendSayAs is used to provide additional information about how the text string being appended
// should be interpreted. For example this can be used to interpret the string as a list
// of individual characters or to read out digits one at a time. The format string is
// ignored unless the interpret-as argument is ... | [
"AppendSayAs",
"is",
"used",
"to",
"provide",
"additional",
"information",
"about",
"how",
"the",
"text",
"string",
"being",
"appended",
"should",
"be",
"interpreted",
".",
"For",
"example",
"this",
"can",
"be",
"used",
"to",
"interpret",
"the",
"string",
"as"... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L157-L167 |
13,738 | mikeflynn/go-alexa | skillserver/ssml-builder.go | AppendPhoneme | func (builder *SSMLTextBuilder) AppendPhoneme(alphabet PhoneticAlphabet, phoneme, text string) *SSMLTextBuilder {
if phoneme != "" && text != "" && alphabet != PhoneticAlphabet("") {
builder.buffer.WriteString(fmt.Sprintf("<phoneme alphabet=\"%s\" ph=\"%s\">%s</phoneme>", alphabet, phoneme, text))
}
return build... | go | func (builder *SSMLTextBuilder) AppendPhoneme(alphabet PhoneticAlphabet, phoneme, text string) *SSMLTextBuilder {
if phoneme != "" && text != "" && alphabet != PhoneticAlphabet("") {
builder.buffer.WriteString(fmt.Sprintf("<phoneme alphabet=\"%s\" ph=\"%s\">%s</phoneme>", alphabet, phoneme, text))
}
return build... | [
"func",
"(",
"builder",
"*",
"SSMLTextBuilder",
")",
"AppendPhoneme",
"(",
"alphabet",
"PhoneticAlphabet",
",",
"phoneme",
",",
"text",
"string",
")",
"*",
"SSMLTextBuilder",
"{",
"if",
"phoneme",
"!=",
"\"",
"\"",
"&&",
"text",
"!=",
"\"",
"\"",
"&&",
"al... | // AppendPhoneme is used to specify a phonetic pronunciation for a piece of text to be appended
// to the response. | [
"AppendPhoneme",
"is",
"used",
"to",
"specify",
"a",
"phonetic",
"pronunciation",
"for",
"a",
"piece",
"of",
"text",
"to",
"be",
"appended",
"to",
"the",
"response",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/ssml-builder.go#L171-L178 |
13,739 | mikeflynn/go-alexa | skillserver/echo.go | VerifyTimestamp | func (r *EchoRequest) VerifyTimestamp() bool {
reqTimestamp, _ := time.Parse("2006-01-02T15:04:05Z", r.Request.Timestamp)
if time.Since(reqTimestamp) < time.Duration(150)*time.Second {
return true
}
return false
} | go | func (r *EchoRequest) VerifyTimestamp() bool {
reqTimestamp, _ := time.Parse("2006-01-02T15:04:05Z", r.Request.Timestamp)
if time.Since(reqTimestamp) < time.Duration(150)*time.Second {
return true
}
return false
} | [
"func",
"(",
"r",
"*",
"EchoRequest",
")",
"VerifyTimestamp",
"(",
")",
"bool",
"{",
"reqTimestamp",
",",
"_",
":=",
"time",
".",
"Parse",
"(",
"\"",
"\"",
",",
"r",
".",
"Request",
".",
"Timestamp",
")",
"\n",
"if",
"time",
".",
"Since",
"(",
"req... | // Request Functions
// VerifyTimestamp will parse the timestamp in the EchoRequest and verify that it is in the correct
// format and is not too old. True will be returned if the timestamp is valid; false otherwise. | [
"Request",
"Functions",
"VerifyTimestamp",
"will",
"parse",
"the",
"timestamp",
"in",
"the",
"EchoRequest",
"and",
"verify",
"that",
"it",
"is",
"in",
"the",
"correct",
"format",
"and",
"is",
"not",
"too",
"old",
".",
"True",
"will",
"be",
"returned",
"if",
... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L29-L36 |
13,740 | mikeflynn/go-alexa | skillserver/echo.go | VerifyAppID | func (r *EchoRequest) VerifyAppID(myAppID string) bool {
if r.Session.Application.ApplicationID == myAppID ||
r.Context.System.Application.ApplicationID == myAppID {
return true
}
return false
} | go | func (r *EchoRequest) VerifyAppID(myAppID string) bool {
if r.Session.Application.ApplicationID == myAppID ||
r.Context.System.Application.ApplicationID == myAppID {
return true
}
return false
} | [
"func",
"(",
"r",
"*",
"EchoRequest",
")",
"VerifyAppID",
"(",
"myAppID",
"string",
")",
"bool",
"{",
"if",
"r",
".",
"Session",
".",
"Application",
".",
"ApplicationID",
"==",
"myAppID",
"||",
"r",
".",
"Context",
".",
"System",
".",
"Application",
".",... | // VerifyAppID check that the incoming application ID matches the application ID provided
// when running the server. This is a step required for skill certification. | [
"VerifyAppID",
"check",
"that",
"the",
"incoming",
"application",
"ID",
"matches",
"the",
"application",
"ID",
"provided",
"when",
"running",
"the",
"server",
".",
"This",
"is",
"a",
"step",
"required",
"for",
"skill",
"certification",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L40-L47 |
13,741 | mikeflynn/go-alexa | skillserver/echo.go | GetIntentName | func (r *EchoRequest) GetIntentName() string {
if r.GetRequestType() == "IntentRequest" {
return r.Request.Intent.Name
}
return r.GetRequestType()
} | go | func (r *EchoRequest) GetIntentName() string {
if r.GetRequestType() == "IntentRequest" {
return r.Request.Intent.Name
}
return r.GetRequestType()
} | [
"func",
"(",
"r",
"*",
"EchoRequest",
")",
"GetIntentName",
"(",
")",
"string",
"{",
"if",
"r",
".",
"GetRequestType",
"(",
")",
"==",
"\"",
"\"",
"{",
"return",
"r",
".",
"Request",
".",
"Intent",
".",
"Name",
"\n",
"}",
"\n\n",
"return",
"r",
"."... | // GetIntentName is a convenience method for getting the intent name out of an EchoRequest. | [
"GetIntentName",
"is",
"a",
"convenience",
"method",
"for",
"getting",
"the",
"intent",
"name",
"out",
"of",
"an",
"EchoRequest",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L65-L71 |
13,742 | mikeflynn/go-alexa | skillserver/echo.go | GetSlotValue | func (r *EchoRequest) GetSlotValue(slotName string) (string, error) {
slot, err := r.GetSlot(slotName)
if err != nil {
return "", err
}
return slot.Value, nil
} | go | func (r *EchoRequest) GetSlotValue(slotName string) (string, error) {
slot, err := r.GetSlot(slotName)
if err != nil {
return "", err
}
return slot.Value, nil
} | [
"func",
"(",
"r",
"*",
"EchoRequest",
")",
"GetSlotValue",
"(",
"slotName",
"string",
")",
"(",
"string",
",",
"error",
")",
"{",
"slot",
",",
"err",
":=",
"r",
".",
"GetSlot",
"(",
"slotName",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
... | // GetSlotValue is a convenience method for getting the value of the specified slot out of an EchoRequest
// as a string. An error is returned if a slot with that value is not found in the request. | [
"GetSlotValue",
"is",
"a",
"convenience",
"method",
"for",
"getting",
"the",
"value",
"of",
"the",
"specified",
"slot",
"out",
"of",
"an",
"EchoRequest",
"as",
"a",
"string",
".",
"An",
"error",
"is",
"returned",
"if",
"a",
"slot",
"with",
"that",
"value",... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L75-L83 |
13,743 | mikeflynn/go-alexa | skillserver/echo.go | GetSlot | func (r *EchoRequest) GetSlot(slotName string) (EchoSlot, error) {
if _, ok := r.Request.Intent.Slots[slotName]; ok {
return r.Request.Intent.Slots[slotName], nil
}
return EchoSlot{}, errors.New("slot name not found")
} | go | func (r *EchoRequest) GetSlot(slotName string) (EchoSlot, error) {
if _, ok := r.Request.Intent.Slots[slotName]; ok {
return r.Request.Intent.Slots[slotName], nil
}
return EchoSlot{}, errors.New("slot name not found")
} | [
"func",
"(",
"r",
"*",
"EchoRequest",
")",
"GetSlot",
"(",
"slotName",
"string",
")",
"(",
"EchoSlot",
",",
"error",
")",
"{",
"if",
"_",
",",
"ok",
":=",
"r",
".",
"Request",
".",
"Intent",
".",
"Slots",
"[",
"slotName",
"]",
";",
"ok",
"{",
"re... | // GetSlot will return an EchoSlot from the EchoRequest with the given name. | [
"GetSlot",
"will",
"return",
"an",
"EchoSlot",
"from",
"the",
"EchoRequest",
"with",
"the",
"given",
"name",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L86-L92 |
13,744 | mikeflynn/go-alexa | skillserver/echo.go | Card | func (r *EchoResponse) Card(title string, content string) *EchoResponse {
return r.SimpleCard(title, content)
} | go | func (r *EchoResponse) Card(title string, content string) *EchoResponse {
return r.SimpleCard(title, content)
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"Card",
"(",
"title",
"string",
",",
"content",
"string",
")",
"*",
"EchoResponse",
"{",
"return",
"r",
".",
"SimpleCard",
"(",
"title",
",",
"content",
")",
"\n",
"}"
] | // Card will add a card to the Alexa app's response with the provided title and content strings. | [
"Card",
"will",
"add",
"a",
"card",
"to",
"the",
"Alexa",
"app",
"s",
"response",
"with",
"the",
"provided",
"title",
"and",
"content",
"strings",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L133-L135 |
13,745 | mikeflynn/go-alexa | skillserver/echo.go | OutputSpeechSSML | func (r *EchoResponse) OutputSpeechSSML(text string) *EchoResponse {
r.Response.OutputSpeech = &EchoRespPayload{
Type: "SSML",
SSML: text,
}
return r
} | go | func (r *EchoResponse) OutputSpeechSSML(text string) *EchoResponse {
r.Response.OutputSpeech = &EchoRespPayload{
Type: "SSML",
SSML: text,
}
return r
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"OutputSpeechSSML",
"(",
"text",
"string",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"OutputSpeech",
"=",
"&",
"EchoRespPayload",
"{",
"Type",
":",
"\"",
"\"",
",",
"SSML",
":",
"text",
",",
"... | // OutputSpeechSSML will add the text string provided and indicate the speech type is SSML in the response.
// This should only be used if the text to speech string includes special SSML tags. | [
"OutputSpeechSSML",
"will",
"add",
"the",
"text",
"string",
"provided",
"and",
"indicate",
"the",
"speech",
"type",
"is",
"SSML",
"in",
"the",
"response",
".",
"This",
"should",
"only",
"be",
"used",
"if",
"the",
"text",
"to",
"speech",
"string",
"includes",... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L139-L146 |
13,746 | mikeflynn/go-alexa | skillserver/echo.go | SimpleCard | func (r *EchoResponse) SimpleCard(title string, content string) *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "Simple",
Title: title,
Content: content,
}
return r
} | go | func (r *EchoResponse) SimpleCard(title string, content string) *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "Simple",
Title: title,
Content: content,
}
return r
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"SimpleCard",
"(",
"title",
"string",
",",
"content",
"string",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"Card",
"=",
"&",
"EchoRespPayload",
"{",
"Type",
":",
"\"",
"\"",
",",
"Title",
":",
... | // SimpleCard will indicate that a card should be included in the Alexa companion app as part of the response.
// The card will be shown with the provided title and content. | [
"SimpleCard",
"will",
"indicate",
"that",
"a",
"card",
"should",
"be",
"included",
"in",
"the",
"Alexa",
"companion",
"app",
"as",
"part",
"of",
"the",
"response",
".",
"The",
"card",
"will",
"be",
"shown",
"with",
"the",
"provided",
"title",
"and",
"conte... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L150-L158 |
13,747 | mikeflynn/go-alexa | skillserver/echo.go | StandardCard | func (r *EchoResponse) StandardCard(title string, content string, smallImg string, largeImg string) *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "Standard",
Title: title,
Content: content,
}
if smallImg != "" {
r.Response.Card.Image.SmallImageURL = smallImg
}
if largeImg != "" {
r.Res... | go | func (r *EchoResponse) StandardCard(title string, content string, smallImg string, largeImg string) *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "Standard",
Title: title,
Content: content,
}
if smallImg != "" {
r.Response.Card.Image.SmallImageURL = smallImg
}
if largeImg != "" {
r.Res... | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"StandardCard",
"(",
"title",
"string",
",",
"content",
"string",
",",
"smallImg",
"string",
",",
"largeImg",
"string",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"Card",
"=",
"&",
"EchoRespPayload... | // StandardCard will indicate that a card should be shown in the Alexa companion app as part of the response.
// The card shown will include the provided title and content as well as images loaded from the locations provided
// as remote locations. | [
"StandardCard",
"will",
"indicate",
"that",
"a",
"card",
"should",
"be",
"shown",
"in",
"the",
"Alexa",
"companion",
"app",
"as",
"part",
"of",
"the",
"response",
".",
"The",
"card",
"shown",
"will",
"include",
"the",
"provided",
"title",
"and",
"content",
... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L163-L179 |
13,748 | mikeflynn/go-alexa | skillserver/echo.go | LinkAccountCard | func (r *EchoResponse) LinkAccountCard() *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "LinkAccount",
}
return r
} | go | func (r *EchoResponse) LinkAccountCard() *EchoResponse {
r.Response.Card = &EchoRespPayload{
Type: "LinkAccount",
}
return r
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"LinkAccountCard",
"(",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"Card",
"=",
"&",
"EchoRespPayload",
"{",
"Type",
":",
"\"",
"\"",
",",
"}",
"\n\n",
"return",
"r",
"\n",
"}"
] | // LinkAccountCard is used to indicate that account linking still needs to be completed to continue
// using the Alexa skill. This will force an account linking card to be shown in the user's companion app. | [
"LinkAccountCard",
"is",
"used",
"to",
"indicate",
"that",
"account",
"linking",
"still",
"needs",
"to",
"be",
"completed",
"to",
"continue",
"using",
"the",
"Alexa",
"skill",
".",
"This",
"will",
"force",
"an",
"account",
"linking",
"card",
"to",
"be",
"sho... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L183-L189 |
13,749 | mikeflynn/go-alexa | skillserver/echo.go | Reprompt | func (r *EchoResponse) Reprompt(text string) *EchoResponse {
r.Response.Reprompt = &EchoReprompt{
OutputSpeech: EchoRespPayload{
Type: "PlainText",
Text: text,
},
}
return r
} | go | func (r *EchoResponse) Reprompt(text string) *EchoResponse {
r.Response.Reprompt = &EchoReprompt{
OutputSpeech: EchoRespPayload{
Type: "PlainText",
Text: text,
},
}
return r
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"Reprompt",
"(",
"text",
"string",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"Reprompt",
"=",
"&",
"EchoReprompt",
"{",
"OutputSpeech",
":",
"EchoRespPayload",
"{",
"Type",
":",
"\"",
"\"",
",",... | // Reprompt will send a prompt back to the user, this could be used to request additional information from the user. | [
"Reprompt",
"will",
"send",
"a",
"prompt",
"back",
"to",
"the",
"user",
"this",
"could",
"be",
"used",
"to",
"request",
"additional",
"information",
"from",
"the",
"user",
"."
] | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L192-L201 |
13,750 | mikeflynn/go-alexa | skillserver/echo.go | EndSession | func (r *EchoResponse) EndSession(flag bool) *EchoResponse {
r.Response.ShouldEndSession = flag
return r
} | go | func (r *EchoResponse) EndSession(flag bool) *EchoResponse {
r.Response.ShouldEndSession = flag
return r
} | [
"func",
"(",
"r",
"*",
"EchoResponse",
")",
"EndSession",
"(",
"flag",
"bool",
")",
"*",
"EchoResponse",
"{",
"r",
".",
"Response",
".",
"ShouldEndSession",
"=",
"flag",
"\n\n",
"return",
"r",
"\n",
"}"
] | // EndSession is a convenience method for setting the flag in the response that will
// indicate if the session between the end user's device and the skillserver should be closed. | [
"EndSession",
"is",
"a",
"convenience",
"method",
"for",
"setting",
"the",
"flag",
"in",
"the",
"response",
"that",
"will",
"indicate",
"if",
"the",
"session",
"between",
"the",
"end",
"user",
"s",
"device",
"and",
"the",
"skillserver",
"should",
"be",
"clos... | a6af545a423613c641bf760600e729115d0eabd2 | https://github.com/mikeflynn/go-alexa/blob/a6af545a423613c641bf760600e729115d0eabd2/skillserver/echo.go#L218-L222 |
13,751 | twpayne/go-kml | icon/icon.go | PaletteHref | func PaletteHref(pal, icon int) string {
return "https://maps.google.com/mapfiles/kml/pal" + strconv.Itoa(pal) + "/icon" + strconv.Itoa(icon) + ".png"
} | go | func PaletteHref(pal, icon int) string {
return "https://maps.google.com/mapfiles/kml/pal" + strconv.Itoa(pal) + "/icon" + strconv.Itoa(icon) + ".png"
} | [
"func",
"PaletteHref",
"(",
"pal",
",",
"icon",
"int",
")",
"string",
"{",
"return",
"\"",
"\"",
"+",
"strconv",
".",
"Itoa",
"(",
"pal",
")",
"+",
"\"",
"\"",
"+",
"strconv",
".",
"Itoa",
"(",
"icon",
")",
"+",
"\"",
"\"",
"\n",
"}"
] | // PaletteHref returns the href of icon in pal. | [
"PaletteHref",
"returns",
"the",
"href",
"of",
"icon",
"in",
"pal",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/icon/icon.go#L63-L65 |
13,752 | twpayne/go-kml | sphere/sphere.go | Offset | func (t T) Offset(origin kml.Coordinate, distance, bearing float64) kml.Coordinate {
lat := math.Asin(math.Sin(origin.Lat*radians)*math.Cos(distance/t.R) + math.Cos(origin.Lat*radians)*math.Sin(distance/t.R)*math.Cos(bearing*radians))
lon := origin.Lon*radians + math.Atan2(math.Sin(bearing*radians)*math.Sin(distance/... | go | func (t T) Offset(origin kml.Coordinate, distance, bearing float64) kml.Coordinate {
lat := math.Asin(math.Sin(origin.Lat*radians)*math.Cos(distance/t.R) + math.Cos(origin.Lat*radians)*math.Sin(distance/t.R)*math.Cos(bearing*radians))
lon := origin.Lon*radians + math.Atan2(math.Sin(bearing*radians)*math.Sin(distance/... | [
"func",
"(",
"t",
"T",
")",
"Offset",
"(",
"origin",
"kml",
".",
"Coordinate",
",",
"distance",
",",
"bearing",
"float64",
")",
"kml",
".",
"Coordinate",
"{",
"lat",
":=",
"math",
".",
"Asin",
"(",
"math",
".",
"Sin",
"(",
"origin",
".",
"Lat",
"*"... | // Offset returns the coordinate at distance from origin in direction bearing. | [
"Offset",
"returns",
"the",
"coordinate",
"at",
"distance",
"from",
"origin",
"in",
"direction",
"bearing",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/sphere/sphere.go#L34-L42 |
13,753 | twpayne/go-kml | sphere/sphere.go | Circle | func (t T) Circle(center kml.Coordinate, radius, maxErr float64) []kml.Coordinate {
numVertices := int(math.Ceil(math.Pi / math.Acos((radius-maxErr)/(radius+maxErr))))
cs := make([]kml.Coordinate, numVertices+1)
for i := 0; i < numVertices; i++ {
cs[i] = t.Offset(center, radius, 360*float64(i)/float64(numVertices)... | go | func (t T) Circle(center kml.Coordinate, radius, maxErr float64) []kml.Coordinate {
numVertices := int(math.Ceil(math.Pi / math.Acos((radius-maxErr)/(radius+maxErr))))
cs := make([]kml.Coordinate, numVertices+1)
for i := 0; i < numVertices; i++ {
cs[i] = t.Offset(center, radius, 360*float64(i)/float64(numVertices)... | [
"func",
"(",
"t",
"T",
")",
"Circle",
"(",
"center",
"kml",
".",
"Coordinate",
",",
"radius",
",",
"maxErr",
"float64",
")",
"[",
"]",
"kml",
".",
"Coordinate",
"{",
"numVertices",
":=",
"int",
"(",
"math",
".",
"Ceil",
"(",
"math",
".",
"Pi",
"/",... | // Circle returns an array of kml.Coordinates that approximate a circle of
// radius radius centered on center with a maximum error of maxErr. | [
"Circle",
"returns",
"an",
"array",
"of",
"kml",
".",
"Coordinates",
"that",
"approximate",
"a",
"circle",
"of",
"radius",
"radius",
"centered",
"on",
"center",
"with",
"a",
"maximum",
"error",
"of",
"maxErr",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/sphere/sphere.go#L46-L54 |
13,754 | twpayne/go-kml | sphere/sphere.go | HaversineDistance | func (t T) HaversineDistance(c1, c2 kml.Coordinate) float64 {
lat1 := c1.Lat * radians
lat2 := c2.Lat * radians
deltaLat := lat2 - lat1
deltaLon := (c1.Lon - c2.Lon) * radians
a := math.Sin(deltaLat/2)*math.Sin(deltaLat/2) + math.Cos(lat1)*math.Cos(lat2)*math.Sin(deltaLon/2)*math.Sin(deltaLon/2)
c := 2 * math.Ata... | go | func (t T) HaversineDistance(c1, c2 kml.Coordinate) float64 {
lat1 := c1.Lat * radians
lat2 := c2.Lat * radians
deltaLat := lat2 - lat1
deltaLon := (c1.Lon - c2.Lon) * radians
a := math.Sin(deltaLat/2)*math.Sin(deltaLat/2) + math.Cos(lat1)*math.Cos(lat2)*math.Sin(deltaLon/2)*math.Sin(deltaLon/2)
c := 2 * math.Ata... | [
"func",
"(",
"t",
"T",
")",
"HaversineDistance",
"(",
"c1",
",",
"c2",
"kml",
".",
"Coordinate",
")",
"float64",
"{",
"lat1",
":=",
"c1",
".",
"Lat",
"*",
"radians",
"\n",
"lat2",
":=",
"c2",
".",
"Lat",
"*",
"radians",
"\n",
"deltaLat",
":=",
"lat... | // HaversineDistance returns the great circle distance beween c1 and c2 using
// the Haversine formula. Altitude is ignored. | [
"HaversineDistance",
"returns",
"the",
"great",
"circle",
"distance",
"beween",
"c1",
"and",
"c2",
"using",
"the",
"Haversine",
"formula",
".",
"Altitude",
"is",
"ignored",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/sphere/sphere.go#L58-L66 |
13,755 | twpayne/go-kml | kml.go | MarshalXML | func (se *SimpleElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.EncodeElement(xml.CharData(se.value), se.StartElement)
} | go | func (se *SimpleElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
return e.EncodeElement(xml.CharData(se.value), se.StartElement)
} | [
"func",
"(",
"se",
"*",
"SimpleElement",
")",
"MarshalXML",
"(",
"e",
"*",
"xml",
".",
"Encoder",
",",
"start",
"xml",
".",
"StartElement",
")",
"error",
"{",
"return",
"e",
".",
"EncodeElement",
"(",
"xml",
".",
"CharData",
"(",
"se",
".",
"value",
... | // MarshalXML marshals se to e. start is ignored. | [
"MarshalXML",
"marshals",
"se",
"to",
"e",
".",
"start",
"is",
"ignored",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L101-L103 |
13,756 | twpayne/go-kml | kml.go | Write | func (se *SimpleElement) Write(w io.Writer) error {
return write(w, "", "", se)
} | go | func (se *SimpleElement) Write(w io.Writer) error {
return write(w, "", "", se)
} | [
"func",
"(",
"se",
"*",
"SimpleElement",
")",
"Write",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"se",
")",
"\n",
"}"
] | // Write writes an XML header and se to w. | [
"Write",
"writes",
"an",
"XML",
"header",
"and",
"se",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L106-L108 |
13,757 | twpayne/go-kml | kml.go | WriteIndent | func (se *SimpleElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, se)
} | go | func (se *SimpleElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, se)
} | [
"func",
"(",
"se",
"*",
"SimpleElement",
")",
"WriteIndent",
"(",
"w",
"io",
".",
"Writer",
",",
"prefix",
",",
"indent",
"string",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"prefix",
",",
"indent",
",",
"se",
")",
"\n",
"}"
] | // WriteIndent writes an XML header and se to w. | [
"WriteIndent",
"writes",
"an",
"XML",
"header",
"and",
"se",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L111-L113 |
13,758 | twpayne/go-kml | kml.go | Add | func (ce *CompoundElement) Add(children ...Element) *CompoundElement {
ce.children = append(ce.children, children...)
return ce
} | go | func (ce *CompoundElement) Add(children ...Element) *CompoundElement {
ce.children = append(ce.children, children...)
return ce
} | [
"func",
"(",
"ce",
"*",
"CompoundElement",
")",
"Add",
"(",
"children",
"...",
"Element",
")",
"*",
"CompoundElement",
"{",
"ce",
".",
"children",
"=",
"append",
"(",
"ce",
".",
"children",
",",
"children",
"...",
")",
"\n",
"return",
"ce",
"\n",
"}"
] | // Add adds children to ce. | [
"Add",
"adds",
"children",
"to",
"ce",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L116-L119 |
13,759 | twpayne/go-kml | kml.go | WriteIndent | func (ce *CoordinatesElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, ce)
} | go | func (ce *CoordinatesElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, ce)
} | [
"func",
"(",
"ce",
"*",
"CoordinatesElement",
")",
"WriteIndent",
"(",
"w",
"io",
".",
"Writer",
",",
"prefix",
",",
"indent",
"string",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"prefix",
",",
"indent",
",",
"ce",
")",
"\n",
"}"
] | // WriteIndent writes an XML header and ce to w. | [
"WriteIndent",
"writes",
"an",
"XML",
"header",
"and",
"ce",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L181-L183 |
13,760 | twpayne/go-kml | kml.go | MarshalXML | func (cae *CoordinatesArrayElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if err := e.EncodeToken(coordinatesStartElement); err != nil {
return err
}
for i, c := range cae.coordinates {
s := ""
if i != 0 {
s = " "
}
s += strconv.FormatFloat(c[0], 'f', -1, 64) + "," + strconv.FormatF... | go | func (cae *CoordinatesArrayElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if err := e.EncodeToken(coordinatesStartElement); err != nil {
return err
}
for i, c := range cae.coordinates {
s := ""
if i != 0 {
s = " "
}
s += strconv.FormatFloat(c[0], 'f', -1, 64) + "," + strconv.FormatF... | [
"func",
"(",
"cae",
"*",
"CoordinatesArrayElement",
")",
"MarshalXML",
"(",
"e",
"*",
"xml",
".",
"Encoder",
",",
"start",
"xml",
".",
"StartElement",
")",
"error",
"{",
"if",
"err",
":=",
"e",
".",
"EncodeToken",
"(",
"coordinatesStartElement",
")",
";",
... | // MarshalXML marshals cae to e. start is ignored. | [
"MarshalXML",
"marshals",
"cae",
"to",
"e",
".",
"start",
"is",
"ignored",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L186-L204 |
13,761 | twpayne/go-kml | kml.go | Write | func (cae *CoordinatesArrayElement) Write(w io.Writer) error {
return write(w, "", " ", cae)
} | go | func (cae *CoordinatesArrayElement) Write(w io.Writer) error {
return write(w, "", " ", cae)
} | [
"func",
"(",
"cae",
"*",
"CoordinatesArrayElement",
")",
"Write",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"cae",
")",
"\n",
"}"
] | // Write writes an XML header and cae to w. | [
"Write",
"writes",
"an",
"XML",
"header",
"and",
"cae",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L207-L209 |
13,762 | twpayne/go-kml | kml.go | WriteIndent | func (cae *CoordinatesArrayElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, cae)
} | go | func (cae *CoordinatesArrayElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, cae)
} | [
"func",
"(",
"cae",
"*",
"CoordinatesArrayElement",
")",
"WriteIndent",
"(",
"w",
"io",
".",
"Writer",
",",
"prefix",
",",
"indent",
"string",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"prefix",
",",
"indent",
",",
"cae",
")",
"\n",
"}"
] | // WriteIndent writes an XML header and cae to w. | [
"WriteIndent",
"writes",
"an",
"XML",
"header",
"and",
"cae",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L212-L214 |
13,763 | twpayne/go-kml | kml.go | MarshalXML | func (cfe *CoordinatesFlatElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if err := e.EncodeToken(coordinatesStartElement); err != nil {
return err
}
for i := cfe.offset; i < cfe.end; i += cfe.stride {
s := ""
if i != cfe.offset {
s = " "
}
s += strconv.FormatFloat(cfe.flatCoords[i],... | go | func (cfe *CoordinatesFlatElement) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
if err := e.EncodeToken(coordinatesStartElement); err != nil {
return err
}
for i := cfe.offset; i < cfe.end; i += cfe.stride {
s := ""
if i != cfe.offset {
s = " "
}
s += strconv.FormatFloat(cfe.flatCoords[i],... | [
"func",
"(",
"cfe",
"*",
"CoordinatesFlatElement",
")",
"MarshalXML",
"(",
"e",
"*",
"xml",
".",
"Encoder",
",",
"start",
"xml",
".",
"StartElement",
")",
"error",
"{",
"if",
"err",
":=",
"e",
".",
"EncodeToken",
"(",
"coordinatesStartElement",
")",
";",
... | // MarshalXML marshals cfe to e. start is ignored. | [
"MarshalXML",
"marshals",
"cfe",
"to",
"e",
".",
"start",
"is",
"ignored",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L217-L235 |
13,764 | twpayne/go-kml | kml.go | Write | func (cfe *CoordinatesFlatElement) Write(w io.Writer) error {
return write(w, "", " ", cfe)
} | go | func (cfe *CoordinatesFlatElement) Write(w io.Writer) error {
return write(w, "", " ", cfe)
} | [
"func",
"(",
"cfe",
"*",
"CoordinatesFlatElement",
")",
"Write",
"(",
"w",
"io",
".",
"Writer",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"\"",
"\"",
",",
"\"",
"\"",
",",
"cfe",
")",
"\n",
"}"
] | // Write writes an XML header and cfe to w. | [
"Write",
"writes",
"an",
"XML",
"header",
"and",
"cfe",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L238-L240 |
13,765 | twpayne/go-kml | kml.go | WriteIndent | func (cfe *CoordinatesFlatElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, cfe)
} | go | func (cfe *CoordinatesFlatElement) WriteIndent(w io.Writer, prefix, indent string) error {
return write(w, prefix, indent, cfe)
} | [
"func",
"(",
"cfe",
"*",
"CoordinatesFlatElement",
")",
"WriteIndent",
"(",
"w",
"io",
".",
"Writer",
",",
"prefix",
",",
"indent",
"string",
")",
"error",
"{",
"return",
"write",
"(",
"w",
",",
"prefix",
",",
"indent",
",",
"cfe",
")",
"\n",
"}"
] | // WriteIndent writes an XML header and cfe to w. | [
"WriteIndent",
"writes",
"an",
"XML",
"header",
"and",
"cfe",
"to",
"w",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L243-L245 |
13,766 | twpayne/go-kml | kml.go | CoordinatesFlat | func CoordinatesFlat(flatCoords []float64, offset, end, stride, dim int) *CoordinatesFlatElement {
return &CoordinatesFlatElement{
flatCoords: flatCoords,
offset: offset,
end: end,
stride: stride,
dim: dim,
}
} | go | func CoordinatesFlat(flatCoords []float64, offset, end, stride, dim int) *CoordinatesFlatElement {
return &CoordinatesFlatElement{
flatCoords: flatCoords,
offset: offset,
end: end,
stride: stride,
dim: dim,
}
} | [
"func",
"CoordinatesFlat",
"(",
"flatCoords",
"[",
"]",
"float64",
",",
"offset",
",",
"end",
",",
"stride",
",",
"dim",
"int",
")",
"*",
"CoordinatesFlatElement",
"{",
"return",
"&",
"CoordinatesFlatElement",
"{",
"flatCoords",
":",
"flatCoords",
",",
"offset... | // CoordinatesFlat returns a new Coordinates element from flat coordinates. | [
"CoordinatesFlat",
"returns",
"a",
"new",
"Coordinates",
"element",
"from",
"flat",
"coordinates",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L624-L632 |
13,767 | twpayne/go-kml | kml.go | LinkSnippet | func LinkSnippet(maxLines int, value string) *SimpleElement {
return &SimpleElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "linkSnippet"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "maxLines"}, Value: strconv.Itoa(maxLines)},
},
},
value: value,
}
} | go | func LinkSnippet(maxLines int, value string) *SimpleElement {
return &SimpleElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "linkSnippet"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "maxLines"}, Value: strconv.Itoa(maxLines)},
},
},
value: value,
}
} | [
"func",
"LinkSnippet",
"(",
"maxLines",
"int",
",",
"value",
"string",
")",
"*",
"SimpleElement",
"{",
"return",
"&",
"SimpleElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
"Name",
":",
"xml",
".",
"Name",
"{",
"Local",
":",
"\"",
"\... | // LinkSnippet returns a new LinkSnippet element. | [
"LinkSnippet",
"returns",
"a",
"new",
"LinkSnippet",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L677-L687 |
13,768 | twpayne/go-kml | kml.go | Schema | func Schema(id, name string, children ...Element) *SharedElement {
return &SharedElement{
CompoundElement: CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "Schema"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "id"}, Value: id},
{Name: xml.Name{Local: "name"}, Value: name},
... | go | func Schema(id, name string, children ...Element) *SharedElement {
return &SharedElement{
CompoundElement: CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "Schema"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "id"}, Value: id},
{Name: xml.Name{Local: "name"}, Value: name},
... | [
"func",
"Schema",
"(",
"id",
",",
"name",
"string",
",",
"children",
"...",
"Element",
")",
"*",
"SharedElement",
"{",
"return",
"&",
"SharedElement",
"{",
"CompoundElement",
":",
"CompoundElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
... | // Schema returns a new Schema element. | [
"Schema",
"returns",
"a",
"new",
"Schema",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L695-L709 |
13,769 | twpayne/go-kml | kml.go | SchemaData | func SchemaData(schemaURL string, children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SchemaData"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "schemaUrl"}, Value: schemaURL},
},
},
children: children,
}
} | go | func SchemaData(schemaURL string, children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SchemaData"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "schemaUrl"}, Value: schemaURL},
},
},
children: children,
}
} | [
"func",
"SchemaData",
"(",
"schemaURL",
"string",
",",
"children",
"...",
"Element",
")",
"*",
"CompoundElement",
"{",
"return",
"&",
"CompoundElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
"Name",
":",
"xml",
".",
"Name",
"{",
"Local",... | // SchemaData returns a new SchemaData element. | [
"SchemaData",
"returns",
"a",
"new",
"SchemaData",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L712-L722 |
13,770 | twpayne/go-kml | kml.go | SimpleData | func SimpleData(name, value string) *SimpleElement {
return &SimpleElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SimpleData"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "name"}, Value: name},
},
},
value: value,
}
} | go | func SimpleData(name, value string) *SimpleElement {
return &SimpleElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SimpleData"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "name"}, Value: name},
},
},
value: value,
}
} | [
"func",
"SimpleData",
"(",
"name",
",",
"value",
"string",
")",
"*",
"SimpleElement",
"{",
"return",
"&",
"SimpleElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
"Name",
":",
"xml",
".",
"Name",
"{",
"Local",
":",
"\"",
"\"",
"}",
"... | // SimpleData returns a new SimpleData element. | [
"SimpleData",
"returns",
"a",
"new",
"SimpleData",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L735-L745 |
13,771 | twpayne/go-kml | kml.go | SimpleField | func SimpleField(name, _type string, children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SimpleField"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "name"}, Value: name},
{Name: xml.Name{Local: "type"}, Value: _type},
},
},
childre... | go | func SimpleField(name, _type string, children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Local: "SimpleField"},
Attr: []xml.Attr{
{Name: xml.Name{Local: "name"}, Value: name},
{Name: xml.Name{Local: "type"}, Value: _type},
},
},
childre... | [
"func",
"SimpleField",
"(",
"name",
",",
"_type",
"string",
",",
"children",
"...",
"Element",
")",
"*",
"CompoundElement",
"{",
"return",
"&",
"CompoundElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
"Name",
":",
"xml",
".",
"Name",
"... | // SimpleField returns a new SimpleField element. | [
"SimpleField",
"returns",
"a",
"new",
"SimpleField",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L748-L759 |
13,772 | twpayne/go-kml | kml.go | KML | func KML(children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Space: Namespace, Local: "kml"},
},
children: children,
}
} | go | func KML(children ...Element) *CompoundElement {
return &CompoundElement{
StartElement: xml.StartElement{
Name: xml.Name{Space: Namespace, Local: "kml"},
},
children: children,
}
} | [
"func",
"KML",
"(",
"children",
"...",
"Element",
")",
"*",
"CompoundElement",
"{",
"return",
"&",
"CompoundElement",
"{",
"StartElement",
":",
"xml",
".",
"StartElement",
"{",
"Name",
":",
"xml",
".",
"Name",
"{",
"Space",
":",
"Namespace",
",",
"Local",
... | // KML returns a new kml element. | [
"KML",
"returns",
"a",
"new",
"kml",
"element",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L762-L769 |
13,773 | twpayne/go-kml | kml.go | GxKML | func GxKML(children ...Element) *CompoundElement {
kml := KML(children...)
// FIXME find a more correct way to do this
kml.Attr = append(kml.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:gx"}, Value: GxNamespace})
return kml
} | go | func GxKML(children ...Element) *CompoundElement {
kml := KML(children...)
// FIXME find a more correct way to do this
kml.Attr = append(kml.Attr, xml.Attr{Name: xml.Name{Local: "xmlns:gx"}, Value: GxNamespace})
return kml
} | [
"func",
"GxKML",
"(",
"children",
"...",
"Element",
")",
"*",
"CompoundElement",
"{",
"kml",
":=",
"KML",
"(",
"children",
"...",
")",
"\n",
"// FIXME find a more correct way to do this",
"kml",
".",
"Attr",
"=",
"append",
"(",
"kml",
".",
"Attr",
",",
"xml"... | // GxKML returns a new kml element with Google Earth extensions. | [
"GxKML",
"returns",
"a",
"new",
"kml",
"element",
"with",
"Google",
"Earth",
"extensions",
"."
] | 6c6eeaa06f794edd7647cc6bc00c208fa92c1a48 | https://github.com/twpayne/go-kml/blob/6c6eeaa06f794edd7647cc6bc00c208fa92c1a48/kml.go#L772-L777 |
13,774 | coyim/otr3 | message_events.go | String | func (s MessageEvent) String() string {
switch s {
case MessageEventEncryptionRequired:
return "MessageEventEncryptionRequired"
case MessageEventEncryptionError:
return "MessageEventEncryptionError"
case MessageEventConnectionEnded:
return "MessageEventConnectionEnded"
case MessageEventSetupError:
return "... | go | func (s MessageEvent) String() string {
switch s {
case MessageEventEncryptionRequired:
return "MessageEventEncryptionRequired"
case MessageEventEncryptionError:
return "MessageEventEncryptionError"
case MessageEventConnectionEnded:
return "MessageEventConnectionEnded"
case MessageEventSetupError:
return "... | [
"func",
"(",
"s",
"MessageEvent",
")",
"String",
"(",
")",
"string",
"{",
"switch",
"s",
"{",
"case",
"MessageEventEncryptionRequired",
":",
"return",
"\"",
"\"",
"\n",
"case",
"MessageEventEncryptionError",
":",
"return",
"\"",
"\"",
"\n",
"case",
"MessageEve... | // String returns the string representation of the MessageEvent | [
"String",
"returns",
"the",
"string",
"representation",
"of",
"the",
"MessageEvent"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/message_events.go#L94-L131 |
13,775 | coyim/otr3 | message_events.go | HandleMessageEvent | func (DebugMessageEventHandler) HandleMessageEvent(event MessageEvent, message []byte, err error, trace ...interface{}) {
fmt.Fprintf(standardErrorOutput, "%sHandleMessageEvent(%s, message: %#v, error: %v, trace: %v)\n", debugPrefix, event, string(message), err, trace)
} | go | func (DebugMessageEventHandler) HandleMessageEvent(event MessageEvent, message []byte, err error, trace ...interface{}) {
fmt.Fprintf(standardErrorOutput, "%sHandleMessageEvent(%s, message: %#v, error: %v, trace: %v)\n", debugPrefix, event, string(message), err, trace)
} | [
"func",
"(",
"DebugMessageEventHandler",
")",
"HandleMessageEvent",
"(",
"event",
"MessageEvent",
",",
"message",
"[",
"]",
"byte",
",",
"err",
"error",
",",
"trace",
"...",
"interface",
"{",
"}",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"standardErrorOutput",
... | // HandleMessageEvent dumps all message events | [
"HandleMessageEvent",
"dumps",
"all",
"message",
"events"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/message_events.go#L155-L157 |
13,776 | coyim/otr3 | debug.go | dumpAKE | func (c *Conversation) dumpAKE(w *bufio.Writer) {
w.WriteString(" Auth info:\n")
if c.ake != nil {
w.WriteString(fmt.Sprintf(" State: %d (%s)\n", c.ake.state.identity(), c.ake.state.identityString()))
}
w.WriteString(fmt.Sprintf(" Our keyid: %d\n", c.keys.ourKeyID))
w.WriteString(fmt.Sprintf(" Thei... | go | func (c *Conversation) dumpAKE(w *bufio.Writer) {
w.WriteString(" Auth info:\n")
if c.ake != nil {
w.WriteString(fmt.Sprintf(" State: %d (%s)\n", c.ake.state.identity(), c.ake.state.identityString()))
}
w.WriteString(fmt.Sprintf(" Our keyid: %d\n", c.keys.ourKeyID))
w.WriteString(fmt.Sprintf(" Thei... | [
"func",
"(",
"c",
"*",
"Conversation",
")",
"dumpAKE",
"(",
"w",
"*",
"bufio",
".",
"Writer",
")",
"{",
"w",
".",
"WriteString",
"(",
"\"",
"\\n",
"\"",
")",
"\n\n",
"if",
"c",
".",
"ake",
"!=",
"nil",
"{",
"w",
".",
"WriteString",
"(",
"fmt",
... | // Will only be called if AKE is valid | [
"Will",
"only",
"be",
"called",
"if",
"AKE",
"is",
"valid"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/debug.go#L58-L70 |
13,777 | coyim/otr3 | bn_utils.go | divMod | func divMod(l, r, m *big.Int) *big.Int {
return mulMod(l, modInverse(r, m), m)
} | go | func divMod(l, r, m *big.Int) *big.Int {
return mulMod(l, modInverse(r, m), m)
} | [
"func",
"divMod",
"(",
"l",
",",
"r",
",",
"m",
"*",
"big",
".",
"Int",
")",
"*",
"big",
".",
"Int",
"{",
"return",
"mulMod",
"(",
"l",
",",
"modInverse",
"(",
"r",
",",
"m",
")",
",",
"m",
")",
"\n",
"}"
] | // Fast division over a modular field, without using division | [
"Fast",
"division",
"over",
"a",
"modular",
"field",
"without",
"using",
"division"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/bn_utils.go#L28-L30 |
13,778 | coyim/otr3 | whitespace.go | extractWhitespaceTag | func extractWhitespaceTag(message ValidMessage) (plain MessagePlaintext, versions int) {
wsPos := bytes.Index(message, whitespaceTagHeader)
currentData := message[wsPos+len(whitespaceTagHeader):]
for {
aw, r, has := nextAllWhite(currentData)
if !has {
break
}
currentData = r
if bytes.Equal(aw, otrV3{}.... | go | func extractWhitespaceTag(message ValidMessage) (plain MessagePlaintext, versions int) {
wsPos := bytes.Index(message, whitespaceTagHeader)
currentData := message[wsPos+len(whitespaceTagHeader):]
for {
aw, r, has := nextAllWhite(currentData)
if !has {
break
}
currentData = r
if bytes.Equal(aw, otrV3{}.... | [
"func",
"extractWhitespaceTag",
"(",
"message",
"ValidMessage",
")",
"(",
"plain",
"MessagePlaintext",
",",
"versions",
"int",
")",
"{",
"wsPos",
":=",
"bytes",
".",
"Index",
"(",
"message",
",",
"whitespaceTagHeader",
")",
"\n",
"currentData",
":=",
"message",
... | // By the spec "this tag may occur anywhere in the message" | [
"By",
"the",
"spec",
"this",
"tag",
"may",
"occur",
"anywhere",
"in",
"the",
"message"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/whitespace.go#L57-L76 |
13,779 | coyim/otr3 | inject_message.go | injectMessage | func (c *Conversation) injectMessage(vm ValidMessage) {
c.injections.messages = append(c.injections.messages, vm)
} | go | func (c *Conversation) injectMessage(vm ValidMessage) {
c.injections.messages = append(c.injections.messages, vm)
} | [
"func",
"(",
"c",
"*",
"Conversation",
")",
"injectMessage",
"(",
"vm",
"ValidMessage",
")",
"{",
"c",
".",
"injections",
".",
"messages",
"=",
"append",
"(",
"c",
".",
"injections",
".",
"messages",
",",
"vm",
")",
"\n",
"}"
] | // injectMessage will promise to send the messages now or later
// The Injected Messages are promised to be well formed valid messages
// including fragmentation and encoding | [
"injectMessage",
"will",
"promise",
"to",
"send",
"the",
"messages",
"now",
"or",
"later",
"The",
"Injected",
"Messages",
"are",
"promised",
"to",
"be",
"well",
"formed",
"valid",
"messages",
"including",
"fragmentation",
"and",
"encoding"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/inject_message.go#L10-L12 |
13,780 | coyim/otr3 | sexp/symbol.go | ReadSymbol | func ReadSymbol(r *bufio.Reader) Value {
ReadWhitespace(r)
result := ReadDataUntil(r, isNotSymbolCharacter)
return Symbol(result)
} | go | func ReadSymbol(r *bufio.Reader) Value {
ReadWhitespace(r)
result := ReadDataUntil(r, isNotSymbolCharacter)
return Symbol(result)
} | [
"func",
"ReadSymbol",
"(",
"r",
"*",
"bufio",
".",
"Reader",
")",
"Value",
"{",
"ReadWhitespace",
"(",
"r",
")",
"\n",
"result",
":=",
"ReadDataUntil",
"(",
"r",
",",
"isNotSymbolCharacter",
")",
"\n",
"return",
"Symbol",
"(",
"result",
")",
"\n",
"}"
] | // ReadSymbol will read a symbol from the reader | [
"ReadSymbol",
"will",
"read",
"a",
"symbol",
"from",
"the",
"reader"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/sexp/symbol.go#L29-L33 |
13,781 | coyim/otr3 | query.go | QueryMessage | func (c Conversation) QueryMessage() ValidMessage {
queryMessage := []byte("?OTRv")
if c.Policies.has(allowV2) {
queryMessage = append(queryMessage, '2')
}
if c.Policies.has(allowV3) {
queryMessage = append(queryMessage, '3')
}
suffix := "?"
if c.friendlyQueryMessage != "" {
suffix = "? " + c.friendlyQu... | go | func (c Conversation) QueryMessage() ValidMessage {
queryMessage := []byte("?OTRv")
if c.Policies.has(allowV2) {
queryMessage = append(queryMessage, '2')
}
if c.Policies.has(allowV3) {
queryMessage = append(queryMessage, '3')
}
suffix := "?"
if c.friendlyQueryMessage != "" {
suffix = "? " + c.friendlyQu... | [
"func",
"(",
"c",
"Conversation",
")",
"QueryMessage",
"(",
")",
"ValidMessage",
"{",
"queryMessage",
":=",
"[",
"]",
"byte",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"c",
".",
"Policies",
".",
"has",
"(",
"allowV2",
")",
"{",
"queryMessage",
"=",
"append",... | //QueryMessage will return a QueryMessage determined by Conversation Policies | [
"QueryMessage",
"will",
"return",
"a",
"QueryMessage",
"determined",
"by",
"Conversation",
"Policies"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/query.go#L74-L91 |
13,782 | coyim/otr3 | keys.go | GenerateMissingKeys | func GenerateMissingKeys(existing [][]byte) ([]PrivateKey, error) {
var result []PrivateKey
hasDSA := false
for _, x := range existing {
_, typeTag, ok := gotrax.ExtractShort(x)
if ok && typeTag == dsaKeyTypeValue {
hasDSA = true
}
}
if !hasDSA {
var priv DSAPrivateKey
if err := priv.Generate(rand.R... | go | func GenerateMissingKeys(existing [][]byte) ([]PrivateKey, error) {
var result []PrivateKey
hasDSA := false
for _, x := range existing {
_, typeTag, ok := gotrax.ExtractShort(x)
if ok && typeTag == dsaKeyTypeValue {
hasDSA = true
}
}
if !hasDSA {
var priv DSAPrivateKey
if err := priv.Generate(rand.R... | [
"func",
"GenerateMissingKeys",
"(",
"existing",
"[",
"]",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"PrivateKey",
",",
"error",
")",
"{",
"var",
"result",
"[",
"]",
"PrivateKey",
"\n",
"hasDSA",
":=",
"false",
"\n\n",
"for",
"_",
",",
"x",
":=",
"range",... | // GenerateMissingKeys will look through the existing serialized keys and generate new keys to ensure that the functioning of this version of OTR will work correctly. It will only return the newly generated keys, not the old ones | [
"GenerateMissingKeys",
"will",
"look",
"through",
"the",
"existing",
"serialized",
"keys",
"and",
"generate",
"new",
"keys",
"to",
"ensure",
"that",
"the",
"functioning",
"of",
"this",
"version",
"of",
"OTR",
"will",
"work",
"correctly",
".",
"It",
"will",
"on... | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L42-L62 |
13,783 | coyim/otr3 | keys.go | ImportKeysFromFile | func ImportKeysFromFile(fname string) ([]*Account, error) {
f, err := os.Open(fname)
if err != nil {
return nil, err
}
defer f.Close()
return ImportKeys(f)
} | go | func ImportKeysFromFile(fname string) ([]*Account, error) {
f, err := os.Open(fname)
if err != nil {
return nil, err
}
defer f.Close()
return ImportKeys(f)
} | [
"func",
"ImportKeysFromFile",
"(",
"fname",
"string",
")",
"(",
"[",
"]",
"*",
"Account",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"fname",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",... | // ImportKeysFromFile will read the libotr formatted file given and return all accounts defined in it | [
"ImportKeysFromFile",
"will",
"read",
"the",
"libotr",
"formatted",
"file",
"given",
"and",
"return",
"all",
"accounts",
"defined",
"in",
"it"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L132-L139 |
13,784 | coyim/otr3 | keys.go | ImportKeys | func ImportKeys(r io.Reader) ([]*Account, error) {
res, ok := readAccounts(bufio.NewReader(r))
if !ok {
return nil, newOtrError("couldn't import data into private key")
}
return res, nil
} | go | func ImportKeys(r io.Reader) ([]*Account, error) {
res, ok := readAccounts(bufio.NewReader(r))
if !ok {
return nil, newOtrError("couldn't import data into private key")
}
return res, nil
} | [
"func",
"ImportKeys",
"(",
"r",
"io",
".",
"Reader",
")",
"(",
"[",
"]",
"*",
"Account",
",",
"error",
")",
"{",
"res",
",",
"ok",
":=",
"readAccounts",
"(",
"bufio",
".",
"NewReader",
"(",
"r",
")",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"... | // ImportKeys will read the libotr formatted data given and return all accounts defined in it | [
"ImportKeys",
"will",
"read",
"the",
"libotr",
"formatted",
"data",
"given",
"and",
"return",
"all",
"accounts",
"defined",
"in",
"it"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L153-L159 |
13,785 | coyim/otr3 | keys.go | IsSame | func (pub *DSAPublicKey) IsSame(other PublicKey) bool {
oth, ok := other.(*DSAPublicKey)
return ok && pub == oth
} | go | func (pub *DSAPublicKey) IsSame(other PublicKey) bool {
oth, ok := other.(*DSAPublicKey)
return ok && pub == oth
} | [
"func",
"(",
"pub",
"*",
"DSAPublicKey",
")",
"IsSame",
"(",
"other",
"PublicKey",
")",
"bool",
"{",
"oth",
",",
"ok",
":=",
"other",
".",
"(",
"*",
"DSAPublicKey",
")",
"\n",
"return",
"ok",
"&&",
"pub",
"==",
"oth",
"\n",
"}"
] | // IsSame returns true if the given public key is a DSA public key that is equal to this key | [
"IsSame",
"returns",
"true",
"if",
"the",
"given",
"public",
"key",
"is",
"a",
"DSA",
"public",
"key",
"that",
"is",
"equal",
"to",
"this",
"key"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L279-L282 |
13,786 | coyim/otr3 | keys.go | ParsePrivateKey | func ParsePrivateKey(in []byte) (index []byte, ok bool, key PrivateKey) {
var typeTag uint16
index, typeTag, ok = gotrax.ExtractShort(in)
if !ok {
return in, false, nil
}
switch typeTag {
case dsaKeyTypeValue:
key = &DSAPrivateKey{}
index, ok = key.Parse(in)
return
}
return in, false, nil
} | go | func ParsePrivateKey(in []byte) (index []byte, ok bool, key PrivateKey) {
var typeTag uint16
index, typeTag, ok = gotrax.ExtractShort(in)
if !ok {
return in, false, nil
}
switch typeTag {
case dsaKeyTypeValue:
key = &DSAPrivateKey{}
index, ok = key.Parse(in)
return
}
return in, false, nil
} | [
"func",
"ParsePrivateKey",
"(",
"in",
"[",
"]",
"byte",
")",
"(",
"index",
"[",
"]",
"byte",
",",
"ok",
"bool",
",",
"key",
"PrivateKey",
")",
"{",
"var",
"typeTag",
"uint16",
"\n",
"index",
",",
"typeTag",
",",
"ok",
"=",
"gotrax",
".",
"ExtractShor... | // ParsePrivateKey is an algorithm indepedent way of parsing private keys | [
"ParsePrivateKey",
"is",
"an",
"algorithm",
"indepedent",
"way",
"of",
"parsing",
"private",
"keys"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L285-L300 |
13,787 | coyim/otr3 | keys.go | ParsePublicKey | func ParsePublicKey(in []byte) (index []byte, ok bool, key PublicKey) {
var typeTag uint16
index, typeTag, ok = gotrax.ExtractShort(in)
if !ok {
return in, false, nil
}
switch typeTag {
case dsaKeyTypeValue:
key = &DSAPublicKey{}
index, ok = key.Parse(in)
return
}
return in, false, nil
} | go | func ParsePublicKey(in []byte) (index []byte, ok bool, key PublicKey) {
var typeTag uint16
index, typeTag, ok = gotrax.ExtractShort(in)
if !ok {
return in, false, nil
}
switch typeTag {
case dsaKeyTypeValue:
key = &DSAPublicKey{}
index, ok = key.Parse(in)
return
}
return in, false, nil
} | [
"func",
"ParsePublicKey",
"(",
"in",
"[",
"]",
"byte",
")",
"(",
"index",
"[",
"]",
"byte",
",",
"ok",
"bool",
",",
"key",
"PublicKey",
")",
"{",
"var",
"typeTag",
"uint16",
"\n",
"index",
",",
"typeTag",
",",
"ok",
"=",
"gotrax",
".",
"ExtractShort"... | // ParsePublicKey is an algorithm independent way of parsing public keys | [
"ParsePublicKey",
"is",
"an",
"algorithm",
"independent",
"way",
"of",
"parsing",
"public",
"keys"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L303-L318 |
13,788 | coyim/otr3 | keys.go | Parse | func (pub *DSAPublicKey) Parse(in []byte) (index []byte, ok bool) {
var typeTag uint16
if index, typeTag, ok = gotrax.ExtractShort(in); !ok || typeTag != dsaKeyTypeValue {
return in, false
}
if index, pub.P, ok = gotrax.ExtractMPI(index); !ok {
return in, false
}
if index, pub.Q, ok = gotrax.ExtractMPI(index)... | go | func (pub *DSAPublicKey) Parse(in []byte) (index []byte, ok bool) {
var typeTag uint16
if index, typeTag, ok = gotrax.ExtractShort(in); !ok || typeTag != dsaKeyTypeValue {
return in, false
}
if index, pub.P, ok = gotrax.ExtractMPI(index); !ok {
return in, false
}
if index, pub.Q, ok = gotrax.ExtractMPI(index)... | [
"func",
"(",
"pub",
"*",
"DSAPublicKey",
")",
"Parse",
"(",
"in",
"[",
"]",
"byte",
")",
"(",
"index",
"[",
"]",
"byte",
",",
"ok",
"bool",
")",
"{",
"var",
"typeTag",
"uint16",
"\n",
"if",
"index",
",",
"typeTag",
",",
"ok",
"=",
"gotrax",
".",
... | // Parse takes the given data and tries to parse it into the PublicKey receiver. It will return not ok if the data is malformed or not for a DSA key | [
"Parse",
"takes",
"the",
"given",
"data",
"and",
"tries",
"to",
"parse",
"it",
"into",
"the",
"PublicKey",
"receiver",
".",
"It",
"will",
"return",
"not",
"ok",
"if",
"the",
"data",
"is",
"malformed",
"or",
"not",
"for",
"a",
"DSA",
"key"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L321-L339 |
13,789 | coyim/otr3 | keys.go | Parse | func (priv *DSAPrivateKey) Parse(in []byte) (index []byte, ok bool) {
if in, ok = priv.DSAPublicKey.Parse(in); !ok {
return nil, false
}
priv.PrivateKey.PublicKey = priv.DSAPublicKey.PublicKey
index, priv.X, ok = gotrax.ExtractMPI(in)
return index, ok
} | go | func (priv *DSAPrivateKey) Parse(in []byte) (index []byte, ok bool) {
if in, ok = priv.DSAPublicKey.Parse(in); !ok {
return nil, false
}
priv.PrivateKey.PublicKey = priv.DSAPublicKey.PublicKey
index, priv.X, ok = gotrax.ExtractMPI(in)
return index, ok
} | [
"func",
"(",
"priv",
"*",
"DSAPrivateKey",
")",
"Parse",
"(",
"in",
"[",
"]",
"byte",
")",
"(",
"index",
"[",
"]",
"byte",
",",
"ok",
"bool",
")",
"{",
"if",
"in",
",",
"ok",
"=",
"priv",
".",
"DSAPublicKey",
".",
"Parse",
"(",
"in",
")",
";",
... | // Parse will parse a Private Key from the given data, by first parsing the public key components and then the private key component. It returns not ok for the same reasons as PublicKey.Parse. | [
"Parse",
"will",
"parse",
"a",
"Private",
"Key",
"from",
"the",
"given",
"data",
"by",
"first",
"parsing",
"the",
"public",
"key",
"components",
"and",
"then",
"the",
"private",
"key",
"component",
".",
"It",
"returns",
"not",
"ok",
"for",
"the",
"same",
... | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L342-L351 |
13,790 | coyim/otr3 | keys.go | Fingerprint | func (pub *DSAPublicKey) Fingerprint() []byte {
b := pub.serialize()
if b == nil {
return nil
}
h := fingerprintHashInstanceForVersion(3)
h.Write(b[2:]) // if public key is DSA, ignore the leading 0x00 0x00 for the key type (according to spec)
return h.Sum(nil)
} | go | func (pub *DSAPublicKey) Fingerprint() []byte {
b := pub.serialize()
if b == nil {
return nil
}
h := fingerprintHashInstanceForVersion(3)
h.Write(b[2:]) // if public key is DSA, ignore the leading 0x00 0x00 for the key type (according to spec)
return h.Sum(nil)
} | [
"func",
"(",
"pub",
"*",
"DSAPublicKey",
")",
"Fingerprint",
"(",
")",
"[",
"]",
"byte",
"{",
"b",
":=",
"pub",
".",
"serialize",
"(",
")",
"\n",
"if",
"b",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"h",
":=",
"fingerprintHashInstanceForV... | // Fingerprint will generate a fingerprint of the serialized version of the key using the provided hash. | [
"Fingerprint",
"will",
"generate",
"a",
"fingerprint",
"of",
"the",
"serialized",
"version",
"of",
"the",
"key",
"using",
"the",
"provided",
"hash",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L380-L390 |
13,791 | coyim/otr3 | keys.go | Sign | func (priv *DSAPrivateKey) Sign(rand io.Reader, hashed []byte) ([]byte, error) {
r, s, err := dsa.Sign(rand, &priv.PrivateKey, hashed)
if err == nil {
rBytes := r.Bytes()
sBytes := s.Bytes()
out := make([]byte, 40)
copy(out[20-len(rBytes):], rBytes)
copy(out[len(out)-len(sBytes):], sBytes)
return out, ni... | go | func (priv *DSAPrivateKey) Sign(rand io.Reader, hashed []byte) ([]byte, error) {
r, s, err := dsa.Sign(rand, &priv.PrivateKey, hashed)
if err == nil {
rBytes := r.Bytes()
sBytes := s.Bytes()
out := make([]byte, 40)
copy(out[20-len(rBytes):], rBytes)
copy(out[len(out)-len(sBytes):], sBytes)
return out, ni... | [
"func",
"(",
"priv",
"*",
"DSAPrivateKey",
")",
"Sign",
"(",
"rand",
"io",
".",
"Reader",
",",
"hashed",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"r",
",",
"s",
",",
"err",
":=",
"dsa",
".",
"Sign",
"(",
"rand",
"... | // Sign will generate a signature of a hashed data using dsa Sign. | [
"Sign",
"will",
"generate",
"a",
"signature",
"of",
"a",
"hashed",
"data",
"using",
"dsa",
"Sign",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L393-L405 |
13,792 | coyim/otr3 | keys.go | Verify | func (pub *DSAPublicKey) Verify(hashed, sig []byte) (nextPoint []byte, sigOk bool) {
if len(sig) < 2*20 {
return nil, false
}
r := new(big.Int).SetBytes(sig[:20])
s := new(big.Int).SetBytes(sig[20:40])
ok := dsa.Verify(&pub.PublicKey, hashed, r, s)
return sig[20*2:], ok
} | go | func (pub *DSAPublicKey) Verify(hashed, sig []byte) (nextPoint []byte, sigOk bool) {
if len(sig) < 2*20 {
return nil, false
}
r := new(big.Int).SetBytes(sig[:20])
s := new(big.Int).SetBytes(sig[20:40])
ok := dsa.Verify(&pub.PublicKey, hashed, r, s)
return sig[20*2:], ok
} | [
"func",
"(",
"pub",
"*",
"DSAPublicKey",
")",
"Verify",
"(",
"hashed",
",",
"sig",
"[",
"]",
"byte",
")",
"(",
"nextPoint",
"[",
"]",
"byte",
",",
"sigOk",
"bool",
")",
"{",
"if",
"len",
"(",
"sig",
")",
"<",
"2",
"*",
"20",
"{",
"return",
"nil... | // Verify will verify a signature of a hashed data using dsa Verify. | [
"Verify",
"will",
"verify",
"a",
"signature",
"of",
"a",
"hashed",
"data",
"using",
"dsa",
"Verify",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L408-L416 |
13,793 | coyim/otr3 | keys.go | Import | func (priv *DSAPrivateKey) Import(in []byte) bool {
mpiStart := []byte(" #")
mpis := make([]*big.Int, 5)
for i := 0; i < len(mpis); i++ {
start := bytes.Index(in, mpiStart)
if start == -1 {
return false
}
in = in[start+len(mpiStart):]
end := bytes.IndexFunc(in, notHex)
if end == -1 {
return false... | go | func (priv *DSAPrivateKey) Import(in []byte) bool {
mpiStart := []byte(" #")
mpis := make([]*big.Int, 5)
for i := 0; i < len(mpis); i++ {
start := bytes.Index(in, mpiStart)
if start == -1 {
return false
}
in = in[start+len(mpiStart):]
end := bytes.IndexFunc(in, notHex)
if end == -1 {
return false... | [
"func",
"(",
"priv",
"*",
"DSAPrivateKey",
")",
"Import",
"(",
"in",
"[",
"]",
"byte",
")",
"bool",
"{",
"mpiStart",
":=",
"[",
"]",
"byte",
"(",
"\"",
"\"",
")",
"\n\n",
"mpis",
":=",
"make",
"(",
"[",
"]",
"*",
"big",
".",
"Int",
",",
"5",
... | // Import parses the contents of a libotr private key file. | [
"Import",
"parses",
"the",
"contents",
"of",
"a",
"libotr",
"private",
"key",
"file",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L442-L481 |
13,794 | coyim/otr3 | keys.go | Generate | func (priv *DSAPrivateKey) Generate(rand io.Reader) error {
if err := dsa.GenerateParameters(&priv.PrivateKey.PublicKey.Parameters, rand, dsa.L1024N160); err != nil {
return err
}
if err := dsa.GenerateKey(&priv.PrivateKey, rand); err != nil {
return err
}
priv.DSAPublicKey.PublicKey = priv.PrivateKey.PublicKe... | go | func (priv *DSAPrivateKey) Generate(rand io.Reader) error {
if err := dsa.GenerateParameters(&priv.PrivateKey.PublicKey.Parameters, rand, dsa.L1024N160); err != nil {
return err
}
if err := dsa.GenerateKey(&priv.PrivateKey, rand); err != nil {
return err
}
priv.DSAPublicKey.PublicKey = priv.PrivateKey.PublicKe... | [
"func",
"(",
"priv",
"*",
"DSAPrivateKey",
")",
"Generate",
"(",
"rand",
"io",
".",
"Reader",
")",
"error",
"{",
"if",
"err",
":=",
"dsa",
".",
"GenerateParameters",
"(",
"&",
"priv",
".",
"PrivateKey",
".",
"PublicKey",
".",
"Parameters",
",",
"rand",
... | // Generate will generate a new DSA Private Key with the randomness provided. The parameter size used is 1024 and 160. | [
"Generate",
"will",
"generate",
"a",
"new",
"DSA",
"Private",
"Key",
"with",
"the",
"randomness",
"provided",
".",
"The",
"parameter",
"size",
"used",
"is",
"1024",
"and",
"160",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/keys.go#L484-L493 |
13,795 | coyim/otr3 | smp_events.go | HandleSMPEvent | func (DebugSMPEventHandler) HandleSMPEvent(event SMPEvent, progressPercent int, question string) {
fmt.Fprintf(standardErrorOutput, "%sHandleSMPEvent(%s, %d, %#v)\n", debugPrefix, event, progressPercent, question)
} | go | func (DebugSMPEventHandler) HandleSMPEvent(event SMPEvent, progressPercent int, question string) {
fmt.Fprintf(standardErrorOutput, "%sHandleSMPEvent(%s, %d, %#v)\n", debugPrefix, event, progressPercent, question)
} | [
"func",
"(",
"DebugSMPEventHandler",
")",
"HandleSMPEvent",
"(",
"event",
"SMPEvent",
",",
"progressPercent",
"int",
",",
"question",
"string",
")",
"{",
"fmt",
".",
"Fprintf",
"(",
"standardErrorOutput",
",",
"\"",
"\\n",
"\"",
",",
"debugPrefix",
",",
"event... | // HandleSMPEvent dumps all SMP events | [
"HandleSMPEvent",
"dumps",
"all",
"SMP",
"events"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/smp_events.go#L98-L100 |
13,796 | coyim/otr3 | extra_key.go | UseExtraSymmetricKey | func (c *Conversation) UseExtraSymmetricKey(usage uint32, usageData []byte) ([]byte, []ValidMessage, error) {
if c.msgState != encrypted ||
c.keys.theirKeyID == 0 {
return nil, nil, newOtrError("cannot send message in current state")
}
t := tlv{
tlvType: tlvTypeExtraSymmetricKey,
tlvLength: 4 + uint16(len... | go | func (c *Conversation) UseExtraSymmetricKey(usage uint32, usageData []byte) ([]byte, []ValidMessage, error) {
if c.msgState != encrypted ||
c.keys.theirKeyID == 0 {
return nil, nil, newOtrError("cannot send message in current state")
}
t := tlv{
tlvType: tlvTypeExtraSymmetricKey,
tlvLength: 4 + uint16(len... | [
"func",
"(",
"c",
"*",
"Conversation",
")",
"UseExtraSymmetricKey",
"(",
"usage",
"uint32",
",",
"usageData",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"[",
"]",
"ValidMessage",
",",
"error",
")",
"{",
"if",
"c",
".",
"msgState",
"!=",
"encr... | // UseExtraSymmetricKey takes a usage parameter and optional usageData and returns the current symmetric key
// and a set of messages to send in order to ask the peer to use the same symmetric key for the usage defined | [
"UseExtraSymmetricKey",
"takes",
"a",
"usage",
"parameter",
"and",
"optional",
"usageData",
"and",
"returns",
"the",
"current",
"symmetric",
"key",
"and",
"a",
"set",
"of",
"messages",
"to",
"send",
"in",
"order",
"to",
"ask",
"the",
"peer",
"to",
"use",
"th... | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/extra_key.go#L15-L29 |
13,797 | coyim/otr3 | version.go | commitToVersionFrom | func (c *Conversation) commitToVersionFrom(versions int) error {
if c.version != nil {
return nil
}
var version otrVersion
switch {
case c.Policies.has(allowV3) && versions&(1<<3) > 0:
version = otrV3{}
case c.Policies.has(allowV2) && versions&(1<<2) > 0:
version = otrV2{}
default:
return errUnsupporte... | go | func (c *Conversation) commitToVersionFrom(versions int) error {
if c.version != nil {
return nil
}
var version otrVersion
switch {
case c.Policies.has(allowV3) && versions&(1<<3) > 0:
version = otrV3{}
case c.Policies.has(allowV2) && versions&(1<<2) > 0:
version = otrV2{}
default:
return errUnsupporte... | [
"func",
"(",
"c",
"*",
"Conversation",
")",
"commitToVersionFrom",
"(",
"versions",
"int",
")",
"error",
"{",
"if",
"c",
".",
"version",
"!=",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"var",
"version",
"otrVersion",
"\n\n",
"switch",
"{",
"case",
... | // Based on the policy, commit to a version given a set of versions offered by the other peer unless the conversation has already committed to a version. | [
"Based",
"on",
"the",
"policy",
"commit",
"to",
"a",
"version",
"given",
"a",
"set",
"of",
"versions",
"offered",
"by",
"the",
"other",
"peer",
"unless",
"the",
"conversation",
"has",
"already",
"committed",
"to",
"a",
"version",
"."
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/version.go#L82-L101 |
13,798 | coyim/otr3 | bytes.go | Bytes | func Bytes(m []ValidMessage) [][]byte {
ret := make([][]byte, len(m))
//copy because we don't want to hold references to m's fragments
for i, f := range m {
ret[i] = make([]byte, len(f))
copy(ret[i], []byte(f))
}
return ret
} | go | func Bytes(m []ValidMessage) [][]byte {
ret := make([][]byte, len(m))
//copy because we don't want to hold references to m's fragments
for i, f := range m {
ret[i] = make([]byte, len(f))
copy(ret[i], []byte(f))
}
return ret
} | [
"func",
"Bytes",
"(",
"m",
"[",
"]",
"ValidMessage",
")",
"[",
"]",
"[",
"]",
"byte",
"{",
"ret",
":=",
"make",
"(",
"[",
"]",
"[",
"]",
"byte",
",",
"len",
"(",
"m",
")",
")",
"\n",
"//copy because we don't want to hold references to m's fragments",
"fo... | // Bytes will turn a slice of valid messages into a slice of byte slices | [
"Bytes",
"will",
"turn",
"a",
"slice",
"of",
"valid",
"messages",
"into",
"a",
"slice",
"of",
"byte",
"slices"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/bytes.go#L17-L25 |
13,799 | coyim/otr3 | sexp/cons.go | String | func (l Cons) String() string {
return "(" + l.First().String() + " . " + l.Second().String() + ")"
} | go | func (l Cons) String() string {
return "(" + l.First().String() + " . " + l.Second().String() + ")"
} | [
"func",
"(",
"l",
"Cons",
")",
"String",
"(",
")",
"string",
"{",
"return",
"\"",
"\"",
"+",
"l",
".",
"First",
"(",
")",
".",
"String",
"(",
")",
"+",
"\"",
"\"",
"+",
"l",
".",
"Second",
"(",
")",
".",
"String",
"(",
")",
"+",
"\"",
"\"",... | // String returns the Cons formatted for printing in an S-Expression | [
"String",
"returns",
"the",
"Cons",
"formatted",
"for",
"printing",
"in",
"an",
"S",
"-",
"Expression"
] | 3bc9d9c574442c5f88a941e78f96cb57cb3fa357 | https://github.com/coyim/otr3/blob/3bc9d9c574442c5f88a941e78f96cb57cb3fa357/sexp/cons.go#L27-L29 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.