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 listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
135,700 | opsgenie/opsgenie-go-sdk | client/opsgenie_heartbeat_client.go | Ping | func (cli *OpsGenieHeartbeatClient) Ping(req heartbeat.PingHeartbeatRequest) (*AsyncRequestResponse, error) {
return cli.sendAsyncPostRequest(&req)
} | go | func (cli *OpsGenieHeartbeatClient) Ping(req heartbeat.PingHeartbeatRequest) (*AsyncRequestResponse, error) {
return cli.sendAsyncPostRequest(&req)
} | [
"func",
"(",
"cli",
"*",
"OpsGenieHeartbeatClient",
")",
"Ping",
"(",
"req",
"heartbeat",
".",
"PingHeartbeatRequest",
")",
"(",
"*",
"AsyncRequestResponse",
",",
"error",
")",
"{",
"return",
"cli",
".",
"sendAsyncPostRequest",
"(",
"&",
"req",
")",
"\n",
"}... | // Send method sends an Heartbeat Signal to OpsGenie. | [
"Send",
"method",
"sends",
"an",
"Heartbeat",
"Signal",
"to",
"OpsGenie",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/opsgenie_heartbeat_client.go#L152-L154 |
135,701 | opsgenie/opsgenie-go-sdk | client/client.go | ToString | func (p requestHeaderUserAgent) ToString() string {
return fmt.Sprintf("%s/%s (%s;%s;%s)", p.sdkName, p.version, p.os, p.goVersion, p.timezone)
} | go | func (p requestHeaderUserAgent) ToString() string {
return fmt.Sprintf("%s/%s (%s;%s;%s)", p.sdkName, p.version, p.os, p.goVersion, p.timezone)
} | [
"func",
"(",
"p",
"requestHeaderUserAgent",
")",
"ToString",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"p",
".",
"sdkName",
",",
"p",
".",
"version",
",",
"p",
".",
"os",
",",
"p",
".",
"goVersion",
",",
"p",
... | // ToString formats and returns RequestHeaderUserAgent type's fields as string. | [
"ToString",
"formats",
"and",
"returns",
"RequestHeaderUserAgent",
"type",
"s",
"fields",
"as",
"string",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L76-L78 |
135,702 | opsgenie/opsgenie-go-sdk | client/client.go | makeHTTPTransportSettings | func (cli *OpsGenieClient) makeHTTPTransportSettings() {
if cli.httpTransportSettings != nil {
if cli.httpTransportSettings.MaxRetryAttempts <= 0 {
cli.httpTransportSettings.MaxRetryAttempts = defaultMaxRetryAttempts
}
if cli.httpTransportSettings.ConnectionTimeout <= 0 {
cli.httpTransportSettings.Connecti... | go | func (cli *OpsGenieClient) makeHTTPTransportSettings() {
if cli.httpTransportSettings != nil {
if cli.httpTransportSettings.MaxRetryAttempts <= 0 {
cli.httpTransportSettings.MaxRetryAttempts = defaultMaxRetryAttempts
}
if cli.httpTransportSettings.ConnectionTimeout <= 0 {
cli.httpTransportSettings.Connecti... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"makeHTTPTransportSettings",
"(",
")",
"{",
"if",
"cli",
".",
"httpTransportSettings",
"!=",
"nil",
"{",
"if",
"cli",
".",
"httpTransportSettings",
".",
"MaxRetryAttempts",
"<=",
"0",
"{",
"cli",
".",
"httpTransp... | // makeHTTPTransportSettings internal method to set default values of HTTP transport layer configuration if necessary. | [
"makeHTTPTransportSettings",
"internal",
"method",
"to",
"set",
"default",
"values",
"of",
"HTTP",
"transport",
"layer",
"configuration",
"if",
"necessary",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L132-L146 |
135,703 | opsgenie/opsgenie-go-sdk | client/client.go | AlertV2 | func (cli *OpsGenieClient) AlertV2() (*OpsGenieAlertV2Client, error) {
cli.makeHTTPTransportSettings()
alertClient := new(OpsGenieAlertV2Client)
alertClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
alertClient.SetOpsGenieAPIUrl(endpointURL)
}
return alertClient, nil
} | go | func (cli *OpsGenieClient) AlertV2() (*OpsGenieAlertV2Client, error) {
cli.makeHTTPTransportSettings()
alertClient := new(OpsGenieAlertV2Client)
alertClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
alertClient.SetOpsGenieAPIUrl(endpointURL)
}
return alertClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"AlertV2",
"(",
")",
"(",
"*",
"OpsGenieAlertV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"alertClient",
":=",
"new",
"(",
"OpsGenieAlertV2Client",
")",
"\n",
"a... | // AlertV2 instantiates a new OpsGenieAlertV2Client. | [
"AlertV2",
"instantiates",
"a",
"new",
"OpsGenieAlertV2Client",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L164-L175 |
135,704 | opsgenie/opsgenie-go-sdk | client/client.go | Contact | func (cli *OpsGenieClient) Contact() (*OpsGenieContactClient, error) {
cli.makeHTTPTransportSettings()
contactClient := new(OpsGenieContactClient)
contactClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
contactClient.SetOpsGenieAPIUrl(endpointURL)
}
return contactClient, nil
} | go | func (cli *OpsGenieClient) Contact() (*OpsGenieContactClient, error) {
cli.makeHTTPTransportSettings()
contactClient := new(OpsGenieContactClient)
contactClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
contactClient.SetOpsGenieAPIUrl(endpointURL)
}
return contactClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Contact",
"(",
")",
"(",
"*",
"OpsGenieContactClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"contactClient",
":=",
"new",
"(",
"OpsGenieContactClient",
")",
"\n",
... | // Alert instantiates a new OpsGenieContactClient. | [
"Alert",
"instantiates",
"a",
"new",
"OpsGenieContactClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L178-L189 |
135,705 | opsgenie/opsgenie-go-sdk | client/client.go | Heartbeat | func (cli *OpsGenieClient) Heartbeat() (*OpsGenieHeartbeatClient, error) {
cli.makeHTTPTransportSettings()
heartbeatClient := new(OpsGenieHeartbeatClient)
heartbeatClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
heartbeatClient.SetOpsGenieAPIUrl(endpointURL)
}
return heartbeatClient, nil
} | go | func (cli *OpsGenieClient) Heartbeat() (*OpsGenieHeartbeatClient, error) {
cli.makeHTTPTransportSettings()
heartbeatClient := new(OpsGenieHeartbeatClient)
heartbeatClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
heartbeatClient.SetOpsGenieAPIUrl(endpointURL)
}
return heartbeatClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Heartbeat",
"(",
")",
"(",
"*",
"OpsGenieHeartbeatClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"heartbeatClient",
":=",
"new",
"(",
"OpsGenieHeartbeatClient",
")",
... | // Heartbeat instantiates a new OpsGenieHeartbeatClient. | [
"Heartbeat",
"instantiates",
"a",
"new",
"OpsGenieHeartbeatClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L192-L203 |
135,706 | opsgenie/opsgenie-go-sdk | client/client.go | Integration | func (cli *OpsGenieClient) Integration() (*OpsGenieIntegrationClient, error) {
cli.makeHTTPTransportSettings()
integrationClient := new(OpsGenieIntegrationClient)
integrationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
integrationClient.SetOpsGenieAPIUrl(endpointURL)
}
return integrationClien... | go | func (cli *OpsGenieClient) Integration() (*OpsGenieIntegrationClient, error) {
cli.makeHTTPTransportSettings()
integrationClient := new(OpsGenieIntegrationClient)
integrationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
integrationClient.SetOpsGenieAPIUrl(endpointURL)
}
return integrationClien... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Integration",
"(",
")",
"(",
"*",
"OpsGenieIntegrationClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"integrationClient",
":=",
"new",
"(",
"OpsGenieIntegrationClient",
... | // Integration instantiates a new OpsGenieIntegrationClient. | [
"Integration",
"instantiates",
"a",
"new",
"OpsGenieIntegrationClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L206-L217 |
135,707 | opsgenie/opsgenie-go-sdk | client/client.go | Policy | func (cli *OpsGenieClient) Policy() (*OpsGeniePolicyClient, error) {
cli.makeHTTPTransportSettings()
policyClient := new(OpsGeniePolicyClient)
policyClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
policyClient.SetOpsGenieAPIUrl(endpointURL)
}
return policyClient, nil
} | go | func (cli *OpsGenieClient) Policy() (*OpsGeniePolicyClient, error) {
cli.makeHTTPTransportSettings()
policyClient := new(OpsGeniePolicyClient)
policyClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
policyClient.SetOpsGenieAPIUrl(endpointURL)
}
return policyClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Policy",
"(",
")",
"(",
"*",
"OpsGeniePolicyClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"policyClient",
":=",
"new",
"(",
"OpsGeniePolicyClient",
")",
"\n",
"pol... | // Policy instantiates a new OpsGeniePolicyClient. | [
"Policy",
"instantiates",
"a",
"new",
"OpsGeniePolicyClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L220-L231 |
135,708 | opsgenie/opsgenie-go-sdk | client/client.go | Team | func (cli *OpsGenieClient) Team() (*OpsGenieTeamClient, error) {
cli.makeHTTPTransportSettings()
teamClient := new(OpsGenieTeamClient)
teamClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
teamClient.SetOpsGenieAPIUrl(endpointURL)
}
return teamClient, nil
} | go | func (cli *OpsGenieClient) Team() (*OpsGenieTeamClient, error) {
cli.makeHTTPTransportSettings()
teamClient := new(OpsGenieTeamClient)
teamClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
teamClient.SetOpsGenieAPIUrl(endpointURL)
}
return teamClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Team",
"(",
")",
"(",
"*",
"OpsGenieTeamClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"teamClient",
":=",
"new",
"(",
"OpsGenieTeamClient",
")",
"\n",
"teamClient"... | // Team instantiates a new OpsGenieTeamClient. | [
"Team",
"instantiates",
"a",
"new",
"OpsGenieTeamClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L234-L245 |
135,709 | opsgenie/opsgenie-go-sdk | client/client.go | Escalation | func (cli *OpsGenieClient) Escalation() (*OpsGenieEscalationClient, error) {
cli.makeHTTPTransportSettings()
escalationClient := new(OpsGenieEscalationClient)
escalationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
escalationClient.SetOpsGenieAPIUrl(endpointURL)
}
return escalationClient, nil
... | go | func (cli *OpsGenieClient) Escalation() (*OpsGenieEscalationClient, error) {
cli.makeHTTPTransportSettings()
escalationClient := new(OpsGenieEscalationClient)
escalationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
escalationClient.SetOpsGenieAPIUrl(endpointURL)
}
return escalationClient, nil
... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Escalation",
"(",
")",
"(",
"*",
"OpsGenieEscalationClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"escalationClient",
":=",
"new",
"(",
"OpsGenieEscalationClient",
")"... | // Escalation instantiates a new OpsGenieEscalationClient. | [
"Escalation",
"instantiates",
"a",
"new",
"OpsGenieEscalationClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L248-L259 |
135,710 | opsgenie/opsgenie-go-sdk | client/client.go | Schedule | func (cli *OpsGenieClient) Schedule() (*OpsGenieScheduleClient, error) {
cli.makeHTTPTransportSettings()
scheduleClient := new(OpsGenieScheduleClient)
scheduleClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleClient.SetOpsGenieAPIUrl(endpointURL)
}
return scheduleClient, nil
} | go | func (cli *OpsGenieClient) Schedule() (*OpsGenieScheduleClient, error) {
cli.makeHTTPTransportSettings()
scheduleClient := new(OpsGenieScheduleClient)
scheduleClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleClient.SetOpsGenieAPIUrl(endpointURL)
}
return scheduleClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"Schedule",
"(",
")",
"(",
"*",
"OpsGenieScheduleClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"scheduleClient",
":=",
"new",
"(",
"OpsGenieScheduleClient",
")",
"\n"... | // Schedule instantiates a new OpsGenieScheduleClient. | [
"Schedule",
"instantiates",
"a",
"new",
"OpsGenieScheduleClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L262-L273 |
135,711 | opsgenie/opsgenie-go-sdk | client/client.go | ScheduleOverride | func (cli *OpsGenieClient) ScheduleOverride() (*OpsGenieScheduleOverrideClient, error) {
cli.makeHTTPTransportSettings()
scheduleOverrideClient := new(OpsGenieScheduleOverrideClient)
scheduleOverrideClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleOverrideClient.SetOpsGenieAPIUrl(endpointURL... | go | func (cli *OpsGenieClient) ScheduleOverride() (*OpsGenieScheduleOverrideClient, error) {
cli.makeHTTPTransportSettings()
scheduleOverrideClient := new(OpsGenieScheduleOverrideClient)
scheduleOverrideClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleOverrideClient.SetOpsGenieAPIUrl(endpointURL... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"ScheduleOverride",
"(",
")",
"(",
"*",
"OpsGenieScheduleOverrideClient",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"scheduleOverrideClient",
":=",
"new",
"(",
"OpsGenieSchedu... | // ScheduleOverride instantiates a new OpsGenieScheduleOverrideClient. | [
"ScheduleOverride",
"instantiates",
"a",
"new",
"OpsGenieScheduleOverrideClient",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L276-L287 |
135,712 | opsgenie/opsgenie-go-sdk | client/client.go | UserV2 | func (cli *OpsGenieClient) UserV2() (*OpsGenieUserV2Client, error) {
cli.makeHTTPTransportSettings()
userClient := new(OpsGenieUserV2Client)
userClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
userClient.SetOpsGenieAPIUrl(endpointURL)
}
return userClient, nil
} | go | func (cli *OpsGenieClient) UserV2() (*OpsGenieUserV2Client, error) {
cli.makeHTTPTransportSettings()
userClient := new(OpsGenieUserV2Client)
userClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
userClient.SetOpsGenieAPIUrl(endpointURL)
}
return userClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"UserV2",
"(",
")",
"(",
"*",
"OpsGenieUserV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"userClient",
":=",
"new",
"(",
"OpsGenieUserV2Client",
")",
"\n",
"userC... | // UserV2 instantiates a new OpsGenieUserV2Client. | [
"UserV2",
"instantiates",
"a",
"new",
"OpsGenieUserV2Client",
"."
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L305-L316 |
135,713 | opsgenie/opsgenie-go-sdk | client/client.go | NotificationV2 | func (cli *OpsGenieClient) NotificationV2() (*OpsGenieNotificationV2Client, error) {
cli.makeHTTPTransportSettings()
notificationClient := new(OpsGenieNotificationV2Client)
notificationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
notificationClient.SetOpsGenieAPIUrl(endpointURL)
}
return noti... | go | func (cli *OpsGenieClient) NotificationV2() (*OpsGenieNotificationV2Client, error) {
cli.makeHTTPTransportSettings()
notificationClient := new(OpsGenieNotificationV2Client)
notificationClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
notificationClient.SetOpsGenieAPIUrl(endpointURL)
}
return noti... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"NotificationV2",
"(",
")",
"(",
"*",
"OpsGenieNotificationV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"notificationClient",
":=",
"new",
"(",
"OpsGenieNotificationV2... | // NotificationV2 instantiates a new OpsGenieNotificationV2Client | [
"NotificationV2",
"instantiates",
"a",
"new",
"OpsGenieNotificationV2Client"
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L319-L330 |
135,714 | opsgenie/opsgenie-go-sdk | client/client.go | ScheduleV2 | func (cli *OpsGenieClient) ScheduleV2() (*OpsGenieScheduleV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleClient := new(OpsGenieScheduleV2Client)
scheduleClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleClient.SetOpsGenieAPIUrl(endpointURL)
}
return scheduleClient, nil
} | go | func (cli *OpsGenieClient) ScheduleV2() (*OpsGenieScheduleV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleClient := new(OpsGenieScheduleV2Client)
scheduleClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleClient.SetOpsGenieAPIUrl(endpointURL)
}
return scheduleClient, nil
} | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"ScheduleV2",
"(",
")",
"(",
"*",
"OpsGenieScheduleV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"scheduleClient",
":=",
"new",
"(",
"OpsGenieScheduleV2Client",
")",
... | // ScheduleV2 instantiates a new OpsGenieScheduleV2Client | [
"ScheduleV2",
"instantiates",
"a",
"new",
"OpsGenieScheduleV2Client"
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L333-L344 |
135,715 | opsgenie/opsgenie-go-sdk | client/client.go | ScheduleOverrideV2 | func (cli *OpsGenieClient) ScheduleOverrideV2() (*OpsGenieScheduleOverrideV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleOverrideClient := new(OpsGenieScheduleOverrideV2Client)
scheduleOverrideClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleOverrideClient.SetOpsGenieAPIUrl(endpo... | go | func (cli *OpsGenieClient) ScheduleOverrideV2() (*OpsGenieScheduleOverrideV2Client, error) {
cli.makeHTTPTransportSettings()
scheduleOverrideClient := new(OpsGenieScheduleOverrideV2Client)
scheduleOverrideClient.SetOpsGenieClient(*cli)
if cli.opsGenieAPIURL == "" {
scheduleOverrideClient.SetOpsGenieAPIUrl(endpo... | [
"func",
"(",
"cli",
"*",
"OpsGenieClient",
")",
"ScheduleOverrideV2",
"(",
")",
"(",
"*",
"OpsGenieScheduleOverrideV2Client",
",",
"error",
")",
"{",
"cli",
".",
"makeHTTPTransportSettings",
"(",
")",
"\n\n",
"scheduleOverrideClient",
":=",
"new",
"(",
"OpsGenieSc... | // ScheduleOverrideV2 instantiates a new OpsGenieScheduleOverrideV2Client | [
"ScheduleOverrideV2",
"instantiates",
"a",
"new",
"OpsGenieScheduleOverrideV2Client"
] | d57b8391ca905cccc085a075a2f7c1308d01cca3 | https://github.com/opsgenie/opsgenie-go-sdk/blob/d57b8391ca905cccc085a075a2f7c1308d01cca3/client/client.go#L347-L358 |
135,716 | 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 |
135,717 | 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 |
135,718 | 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 |
135,719 | 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 |
135,720 | 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 |
135,721 | 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 |
135,722 | 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 |
135,723 | 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 |
135,724 | 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 |
135,725 | 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 |
135,726 | 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 |
135,727 | 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 |
135,728 | 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 |
135,729 | 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 |
135,730 | 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 |
135,731 | 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 |
135,732 | 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 |
135,733 | 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 |
135,734 | 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 |
135,735 | 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 |
135,736 | 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 |
135,737 | 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 |
135,738 | 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 |
135,739 | 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 |
135,740 | 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 |
135,741 | 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 |
135,742 | 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 |
135,743 | 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 |
135,744 | 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 |
135,745 | 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 |
135,746 | 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 |
135,747 | 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 |
135,748 | 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 |
135,749 | 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 |
135,750 | 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 |
135,751 | 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 |
135,752 | 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 |
135,753 | 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 |
135,754 | 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 |
135,755 | 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 |
135,756 | 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 |
135,757 | 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 |
135,758 | 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 |
135,759 | 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 |
135,760 | 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 |
135,761 | 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 |
135,762 | 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 |
135,763 | 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 |
135,764 | 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 |
135,765 | 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 |
135,766 | 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 |
135,767 | 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 |
135,768 | 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 |
135,769 | 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 |
135,770 | 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 |
135,771 | 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 |
135,772 | 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 |
135,773 | 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 |
135,774 | 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 |
135,775 | 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 |
135,776 | 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 |
135,777 | 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 |
135,778 | 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 |
135,779 | 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 |
135,780 | 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 |
135,781 | 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 |
135,782 | 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 |
135,783 | 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 |
135,784 | 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 |
135,785 | 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 |
135,786 | 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 |
135,787 | 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 |
135,788 | 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 |
135,789 | 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 |
135,790 | 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 |
135,791 | 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 |
135,792 | 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 |
135,793 | 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 |
135,794 | 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 |
135,795 | 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 |
135,796 | 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 |
135,797 | 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 |
135,798 | 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 |
135,799 | 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 |
Subsets and Splits
SQL Console for google/code_x_glue_ct_code_to_text
This query implements a thoughtful three-tier curation strategy to build a balanced safety dataset, categorizing code by destructive operations, safe I/O operations, and pure computational negatives with subsampling—revealing important patterns about how destructive intent manifests in Python code for model safety research.
SQL Console for google/code_x_glue_ct_code_to_text
This query performs meaningful classification of Python code samples into safety-relevant tiers based on destructive operations, I/O patterns, and pure computation, which could be valuable for building safety classifiers or curating training data, though the output itself is a filtered/ranked dataset rather than revealing novel statistical insights.