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
sequence | docstring
stringlengths 6
2.61k
| docstring_tokens
sequence | sha
stringlengths 40
40
| url
stringlengths 85
252
|
---|---|---|---|---|---|---|---|---|---|---|---|
6,800 | softlayer/softlayer-go | services/account.go | RequestGlobalFundedAccount | func (r Account_ProofOfConcept) RequestGlobalFundedAccount(request *datatypes.Container_Account_ProofOfConcept_Request_GlobalFunded) (resp datatypes.Container_Account_ProofOfConcept_Review_Summary, err error) {
params := []interface{}{
request,
}
err = r.Session.DoRequest("SoftLayer_Account_ProofOfConcept", "requestGlobalFundedAccount", params, &r.Options, &resp)
return
} | go | func (r Account_ProofOfConcept) RequestGlobalFundedAccount(request *datatypes.Container_Account_ProofOfConcept_Request_GlobalFunded) (resp datatypes.Container_Account_ProofOfConcept_Review_Summary, err error) {
params := []interface{}{
request,
}
err = r.Session.DoRequest("SoftLayer_Account_ProofOfConcept", "requestGlobalFundedAccount", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_ProofOfConcept",
")",
"RequestGlobalFundedAccount",
"(",
"request",
"*",
"datatypes",
".",
"Container_Account_ProofOfConcept_Request_GlobalFunded",
")",
"(",
"resp",
"datatypes",
".",
"Container_Account_ProofOfConcept_Review_Summary",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"request",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Allows authorized IBMer's to apply for a proof of concept account using global funding. Requests will be reviewed by multiple internal teams before an account is created.
//
// Note that the proof of concept system is for internal IBM employees only and is not applicable to users outside the IBM organization. | [
"Allows",
"authorized",
"IBMer",
"s",
"to",
"apply",
"for",
"a",
"proof",
"of",
"concept",
"account",
"using",
"global",
"funding",
".",
"Requests",
"will",
"be",
"reviewed",
"by",
"multiple",
"internal",
"teams",
"before",
"an",
"account",
"is",
"created",
".",
"Note",
"that",
"the",
"proof",
"of",
"concept",
"system",
"is",
"for",
"internal",
"IBM",
"employees",
"only",
"and",
"is",
"not",
"applicable",
"to",
"users",
"outside",
"the",
"IBM",
"organization",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4270-L4276 |
6,801 | softlayer/softlayer-go | services/account.go | VerifyReviewer | func (r Account_ProofOfConcept) VerifyReviewer(requestId *int, reviewerEmailAddress *string) (err error) {
var resp datatypes.Void
params := []interface{}{
requestId,
reviewerEmailAddress,
}
err = r.Session.DoRequest("SoftLayer_Account_ProofOfConcept", "verifyReviewer", params, &r.Options, &resp)
return
} | go | func (r Account_ProofOfConcept) VerifyReviewer(requestId *int, reviewerEmailAddress *string) (err error) {
var resp datatypes.Void
params := []interface{}{
requestId,
reviewerEmailAddress,
}
err = r.Session.DoRequest("SoftLayer_Account_ProofOfConcept", "verifyReviewer", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_ProofOfConcept",
")",
"VerifyReviewer",
"(",
"requestId",
"*",
"int",
",",
"reviewerEmailAddress",
"*",
"string",
")",
"(",
"err",
"error",
")",
"{",
"var",
"resp",
"datatypes",
".",
"Void",
"\n",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"requestId",
",",
"reviewerEmailAddress",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Verifies that a potential reviewer is an approved internal IBM employee | [
"Verifies",
"that",
"a",
"potential",
"reviewer",
"is",
"an",
"approved",
"internal",
"IBM",
"employee"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4279-L4287 |
6,802 | softlayer/softlayer-go | services/account.go | GetDetailType | func (r Account_Regional_Registry_Detail) GetDetailType() (resp datatypes.Account_Regional_Registry_Detail_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Regional_Registry_Detail", "getDetailType", nil, &r.Options, &resp)
return
} | go | func (r Account_Regional_Registry_Detail) GetDetailType() (resp datatypes.Account_Regional_Registry_Detail_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Regional_Registry_Detail", "getDetailType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Regional_Registry_Detail",
")",
"GetDetailType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Regional_Registry_Detail_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The associated type of this detail object. | [
"Retrieve",
"The",
"associated",
"type",
"of",
"this",
"detail",
"object",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4592-L4595 |
6,803 | softlayer/softlayer-go | services/account.go | GetRegionalInternetRegistryHandle | func (r Account_Regional_Registry_Detail) GetRegionalInternetRegistryHandle() (resp datatypes.Account_Rwhois_Handle, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Regional_Registry_Detail", "getRegionalInternetRegistryHandle", nil, &r.Options, &resp)
return
} | go | func (r Account_Regional_Registry_Detail) GetRegionalInternetRegistryHandle() (resp datatypes.Account_Rwhois_Handle, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Regional_Registry_Detail", "getRegionalInternetRegistryHandle", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Regional_Registry_Detail",
")",
"GetRegionalInternetRegistryHandle",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Rwhois_Handle",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The associated RWhois handle of this detail object. Used only when detailed reassignments are necessary. | [
"Retrieve",
"The",
"associated",
"RWhois",
"handle",
"of",
"this",
"detail",
"object",
".",
"Used",
"only",
"when",
"detailed",
"reassignments",
"are",
"necessary",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4616-L4619 |
6,804 | softlayer/softlayer-go | services/account.go | GetAccountContact | func (r Account_Reports_Request) GetAccountContact() (resp datatypes.Account_Contact, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Reports_Request", "getAccountContact", nil, &r.Options, &resp)
return
} | go | func (r Account_Reports_Request) GetAccountContact() (resp datatypes.Account_Contact, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Reports_Request", "getAccountContact", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Reports_Request",
")",
"GetAccountContact",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Contact",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A request's corresponding external contact, if one exists. | [
"Retrieve",
"A",
"request",
"s",
"corresponding",
"external",
"contact",
"if",
"one",
"exists",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4894-L4897 |
6,805 | softlayer/softlayer-go | services/account.go | GetReportType | func (r Account_Reports_Request) GetReportType() (resp datatypes.Compliance_Report_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Reports_Request", "getReportType", nil, &r.Options, &resp)
return
} | go | func (r Account_Reports_Request) GetReportType() (resp datatypes.Compliance_Report_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Reports_Request", "getReportType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Reports_Request",
")",
"GetReportType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Compliance_Report_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Type of the report customer is requesting for. | [
"Retrieve",
"Type",
"of",
"the",
"report",
"customer",
"is",
"requesting",
"for",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L4912-L4915 |
6,806 | softlayer/softlayer-go | services/account.go | GetAllCouriersByType | func (r Account_Shipment) GetAllCouriersByType(courierTypeKeyName *string) (resp []datatypes.Auxiliary_Shipping_Courier, err error) {
params := []interface{}{
courierTypeKeyName,
}
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getAllCouriersByType", params, &r.Options, &resp)
return
} | go | func (r Account_Shipment) GetAllCouriersByType(courierTypeKeyName *string) (resp []datatypes.Auxiliary_Shipping_Courier, err error) {
params := []interface{}{
courierTypeKeyName,
}
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getAllCouriersByType", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment",
")",
"GetAllCouriersByType",
"(",
"courierTypeKeyName",
"*",
"string",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Auxiliary_Shipping_Courier",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"courierTypeKeyName",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve a list of available shipping couriers. | [
"Retrieve",
"a",
"list",
"of",
"available",
"shipping",
"couriers",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5024-L5030 |
6,807 | softlayer/softlayer-go | services/account.go | GetCourier | func (r Account_Shipment) GetCourier() (resp datatypes.Auxiliary_Shipping_Courier, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getCourier", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment) GetCourier() (resp datatypes.Auxiliary_Shipping_Courier, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getCourier", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment",
")",
"GetCourier",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Auxiliary_Shipping_Courier",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The courier handling the shipment. | [
"Retrieve",
"The",
"courier",
"handling",
"the",
"shipment",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5045-L5048 |
6,808 | softlayer/softlayer-go | services/account.go | GetOriginationAddress | func (r Account_Shipment) GetOriginationAddress() (resp datatypes.Account_Address, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getOriginationAddress", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment) GetOriginationAddress() (resp datatypes.Account_Address, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getOriginationAddress", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment",
")",
"GetOriginationAddress",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Address",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The address from which the shipment is sent. | [
"Retrieve",
"The",
"address",
"from",
"which",
"the",
"shipment",
"is",
"sent",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5099-L5102 |
6,809 | softlayer/softlayer-go | services/account.go | GetStatus | func (r Account_Shipment) GetStatus() (resp datatypes.Account_Shipment_Status, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getStatus", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment) GetStatus() (resp datatypes.Account_Shipment_Status, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment", "getStatus", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment",
")",
"GetStatus",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Shipment_Status",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The status of the shipment. | [
"Retrieve",
"The",
"status",
"of",
"the",
"shipment",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5111-L5114 |
6,810 | softlayer/softlayer-go | services/account.go | GetShipmentItemType | func (r Account_Shipment_Item) GetShipmentItemType() (resp datatypes.Account_Shipment_Item_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Item", "getShipmentItemType", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment_Item) GetShipmentItemType() (resp datatypes.Account_Shipment_Item_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Item", "getShipmentItemType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment_Item",
")",
"GetShipmentItemType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Shipment_Item_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The type of this shipment item. | [
"Retrieve",
"The",
"type",
"of",
"this",
"shipment",
"item",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5190-L5193 |
6,811 | softlayer/softlayer-go | services/account.go | GetCreateUser | func (r Account_Shipment_Tracking_Data) GetCreateUser() (resp datatypes.User_Customer, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Tracking_Data", "getCreateUser", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment_Tracking_Data) GetCreateUser() (resp datatypes.User_Customer, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Tracking_Data", "getCreateUser", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment_Tracking_Data",
")",
"GetCreateUser",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The customer user who created the tracking datum. | [
"Retrieve",
"The",
"customer",
"user",
"who",
"created",
"the",
"tracking",
"datum",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5413-L5416 |
6,812 | softlayer/softlayer-go | services/account.go | GetShipment | func (r Account_Shipment_Tracking_Data) GetShipment() (resp datatypes.Account_Shipment, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Tracking_Data", "getShipment", nil, &r.Options, &resp)
return
} | go | func (r Account_Shipment_Tracking_Data) GetShipment() (resp datatypes.Account_Shipment, err error) {
err = r.Session.DoRequest("SoftLayer_Account_Shipment_Tracking_Data", "getShipment", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Account_Shipment_Tracking_Data",
")",
"GetShipment",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Account_Shipment",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The shipment of the tracking datum. | [
"Retrieve",
"The",
"shipment",
"of",
"the",
"tracking",
"datum",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/account.go#L5437-L5440 |
6,813 | softlayer/softlayer-go | services/location.go | GetVdrGroup | func (r Location) GetVdrGroup() (resp datatypes.Location_Group_Location_CrossReference, err error) {
err = r.Session.DoRequest("SoftLayer_Location", "getVdrGroup", nil, &r.Options, &resp)
return
} | go | func (r Location) GetVdrGroup() (resp datatypes.Location_Group_Location_CrossReference, err error) {
err = r.Session.DoRequest("SoftLayer_Location", "getVdrGroup", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location",
")",
"GetVdrGroup",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Location_Group_Location_CrossReference",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A location can be a member of 1 Bandwidth Pooling Group. This will show which group to which a location belongs. | [
"Retrieve",
"A",
"location",
"can",
"be",
"a",
"member",
"of",
"1",
"Bandwidth",
"Pooling",
"Group",
".",
"This",
"will",
"show",
"which",
"group",
"to",
"which",
"a",
"location",
"belongs",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L193-L196 |
6,814 | softlayer/softlayer-go | services/location.go | GetBrandCountryRestrictions | func (r Location_Datacenter) GetBrandCountryRestrictions() (resp []datatypes.Brand_Restriction_Location_CustomerCountry, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getBrandCountryRestrictions", nil, &r.Options, &resp)
return
} | go | func (r Location_Datacenter) GetBrandCountryRestrictions() (resp []datatypes.Brand_Restriction_Location_CustomerCountry, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getBrandCountryRestrictions", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Datacenter",
")",
"GetBrandCountryRestrictions",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Brand_Restriction_Location_CustomerCountry",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve This references relationship between brands, locations and countries associated with a user's account that are ineligible when ordering products. For example, the India datacenter may not be available on this brand for customers that live in Great Britain. | [
"Retrieve",
"This",
"references",
"relationship",
"between",
"brands",
"locations",
"and",
"countries",
"associated",
"with",
"a",
"user",
"s",
"account",
"that",
"are",
"ineligible",
"when",
"ordering",
"products",
".",
"For",
"example",
"the",
"India",
"datacenter",
"may",
"not",
"be",
"available",
"on",
"this",
"brand",
"for",
"customers",
"that",
"live",
"in",
"Great",
"Britain",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L299-L302 |
6,815 | softlayer/softlayer-go | services/location.go | GetLocationStatus | func (r Location_Datacenter) GetLocationStatus() (resp datatypes.Location_Status, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getLocationStatus", nil, &r.Options, &resp)
return
} | go | func (r Location_Datacenter) GetLocationStatus() (resp datatypes.Location_Status, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getLocationStatus", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Datacenter",
")",
"GetLocationStatus",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Location_Status",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The current locations status. | [
"Retrieve",
"The",
"current",
"locations",
"status",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L365-L368 |
6,816 | softlayer/softlayer-go | services/location.go | GetOnlineSslVpnUserCount | func (r Location_Datacenter) GetOnlineSslVpnUserCount() (resp int, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getOnlineSslVpnUserCount", nil, &r.Options, &resp)
return
} | go | func (r Location_Datacenter) GetOnlineSslVpnUserCount() (resp int, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getOnlineSslVpnUserCount", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Datacenter",
")",
"GetOnlineSslVpnUserCount",
"(",
")",
"(",
"resp",
"int",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The total number of users online using SoftLayer's SSL VPN service for a location. | [
"Retrieve",
"The",
"total",
"number",
"of",
"users",
"online",
"using",
"SoftLayer",
"s",
"SSL",
"VPN",
"service",
"for",
"a",
"location",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L389-L392 |
6,817 | softlayer/softlayer-go | services/location.go | GetStatisticsGraphImage | func (r Location_Datacenter) GetStatisticsGraphImage() (resp []byte, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getStatisticsGraphImage", nil, &r.Options, &resp)
return
} | go | func (r Location_Datacenter) GetStatisticsGraphImage() (resp []byte, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Datacenter", "getStatisticsGraphImage", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Datacenter",
")",
"GetStatisticsGraphImage",
"(",
")",
"(",
"resp",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve a graph of a SoftLayer datacenter's last 48 hours of network activity. Statistics graphs show traffic outbound from a datacenter on top and inbound traffic on the bottom followed by a legend of the network services tracked in the graph. getStatisticsGraphImage returns a PNG image of variable width and height depending on the number of services reported in the image. | [
"Retrieve",
"a",
"graph",
"of",
"a",
"SoftLayer",
"datacenter",
"s",
"last",
"48",
"hours",
"of",
"network",
"activity",
".",
"Statistics",
"graphs",
"show",
"traffic",
"outbound",
"from",
"a",
"datacenter",
"on",
"top",
"and",
"inbound",
"traffic",
"on",
"the",
"bottom",
"followed",
"by",
"a",
"legend",
"of",
"the",
"network",
"services",
"tracked",
"in",
"the",
"graph",
".",
"getStatisticsGraphImage",
"returns",
"a",
"PNG",
"image",
"of",
"variable",
"width",
"and",
"height",
"depending",
"on",
"the",
"number",
"of",
"services",
"reported",
"in",
"the",
"image",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L437-L440 |
6,818 | softlayer/softlayer-go | services/location.go | GetLocationGroupType | func (r Location_Group_Pricing) GetLocationGroupType() (resp datatypes.Location_Group_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Group_Pricing", "getLocationGroupType", nil, &r.Options, &resp)
return
} | go | func (r Location_Group_Pricing) GetLocationGroupType() (resp datatypes.Location_Group_Type, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Group_Pricing", "getLocationGroupType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Group_Pricing",
")",
"GetLocationGroupType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Location_Group_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The type for this location group. | [
"Retrieve",
"The",
"type",
"for",
"this",
"location",
"group",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L589-L592 |
6,819 | softlayer/softlayer-go | services/location.go | GetPrices | func (r Location_Group_Pricing) GetPrices() (resp []datatypes.Product_Item_Price, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Group_Pricing", "getPrices", nil, &r.Options, &resp)
return
} | go | func (r Location_Group_Pricing) GetPrices() (resp []datatypes.Product_Item_Price, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Group_Pricing", "getPrices", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Group_Pricing",
")",
"GetPrices",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Product_Item_Price",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The prices that this pricing location group limits. All of these prices will only be available in the locations defined by this pricing location group. | [
"Retrieve",
"The",
"prices",
"that",
"this",
"pricing",
"location",
"group",
"limits",
".",
"All",
"of",
"these",
"prices",
"will",
"only",
"be",
"available",
"in",
"the",
"locations",
"defined",
"by",
"this",
"pricing",
"location",
"group",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L607-L610 |
6,820 | softlayer/softlayer-go | services/location.go | GetAllotment | func (r Location_Reservation) GetAllotment() (resp datatypes.Network_Bandwidth_Version1_Allotment, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Reservation", "getAllotment", nil, &r.Options, &resp)
return
} | go | func (r Location_Reservation) GetAllotment() (resp datatypes.Network_Bandwidth_Version1_Allotment, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Reservation", "getAllotment", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Reservation",
")",
"GetAllotment",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Network_Bandwidth_Version1_Allotment",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The bandwidth allotment that the reservation belongs to. | [
"Retrieve",
"The",
"bandwidth",
"allotment",
"that",
"the",
"reservation",
"belongs",
"to",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L741-L744 |
6,821 | softlayer/softlayer-go | services/location.go | GetLocationReservationRack | func (r Location_Reservation) GetLocationReservationRack() (resp datatypes.Location_Reservation_Rack, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Reservation", "getLocationReservationRack", nil, &r.Options, &resp)
return
} | go | func (r Location_Reservation) GetLocationReservationRack() (resp datatypes.Location_Reservation_Rack, err error) {
err = r.Session.DoRequest("SoftLayer_Location_Reservation", "getLocationReservationRack", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"Location_Reservation",
")",
"GetLocationReservationRack",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Location_Reservation_Rack",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Rack information for the reservation | [
"Retrieve",
"Rack",
"information",
"for",
"the",
"reservation"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/location.go#L759-L762 |
6,822 | softlayer/softlayer-go | services/user.go | GetActiveExternalAuthenticationVendors | func (r User_Customer) GetActiveExternalAuthenticationVendors() (resp []datatypes.Container_User_Customer_External_Binding_Vendor, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getActiveExternalAuthenticationVendors", nil, &r.Options, &resp)
return
} | go | func (r User_Customer) GetActiveExternalAuthenticationVendors() (resp []datatypes.Container_User_Customer_External_Binding_Vendor, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getActiveExternalAuthenticationVendors", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer",
")",
"GetActiveExternalAuthenticationVendors",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Container_User_Customer_External_Binding_Vendor",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // The getActiveExternalAuthenticationVendors method will return a list of available external vendors that a SoftLayer user can authenticate against. The list will only contain vendors for which the user has at least one active external binding. | [
"The",
"getActiveExternalAuthenticationVendors",
"method",
"will",
"return",
"a",
"list",
"of",
"available",
"external",
"vendors",
"that",
"a",
"SoftLayer",
"user",
"can",
"authenticate",
"against",
".",
"The",
"list",
"will",
"only",
"contain",
"vendors",
"for",
"which",
"the",
"user",
"has",
"at",
"least",
"one",
"active",
"external",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L357-L360 |
6,823 | softlayer/softlayer-go | services/user.go | GetAdditionalEmails | func (r User_Customer) GetAdditionalEmails() (resp []datatypes.User_Customer_AdditionalEmail, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getAdditionalEmails", nil, &r.Options, &resp)
return
} | go | func (r User_Customer) GetAdditionalEmails() (resp []datatypes.User_Customer_AdditionalEmail, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getAdditionalEmails", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer",
")",
"GetAdditionalEmails",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_Customer_AdditionalEmail",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A portal user's additional email addresses. These email addresses are contacted when updates are made to support tickets. | [
"Retrieve",
"A",
"portal",
"user",
"s",
"additional",
"email",
"addresses",
".",
"These",
"email",
"addresses",
"are",
"contacted",
"when",
"updates",
"are",
"made",
"to",
"support",
"tickets",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L363-L366 |
6,824 | softlayer/softlayer-go | services/user.go | GetLoginToken | func (r User_Customer) GetLoginToken(request *datatypes.Container_Authentication_Request_Contract) (resp datatypes.Container_Authentication_Response_Common, err error) {
params := []interface{}{
request,
}
err = r.Session.DoRequest("SoftLayer_User_Customer", "getLoginToken", params, &r.Options, &resp)
return
} | go | func (r User_Customer) GetLoginToken(request *datatypes.Container_Authentication_Request_Contract) (resp datatypes.Container_Authentication_Response_Common, err error) {
params := []interface{}{
request,
}
err = r.Session.DoRequest("SoftLayer_User_Customer", "getLoginToken", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer",
")",
"GetLoginToken",
"(",
"request",
"*",
"datatypes",
".",
"Container_Authentication_Request_Contract",
")",
"(",
"resp",
"datatypes",
".",
"Container_Authentication_Response_Common",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"request",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Attempt to authenticate a user to the SoftLayer customer portal using the provided authentication container. Depending on the specific type of authentication container that is used, this API will leverage the appropriate authentication protocol. If authentication is successful then the API returns a list of linked accounts for the user, a token containing the ID of the authenticated user and a hash key used by the SoftLayer customer portal to maintain authentication. | [
"Attempt",
"to",
"authenticate",
"a",
"user",
"to",
"the",
"SoftLayer",
"customer",
"portal",
"using",
"the",
"provided",
"authentication",
"container",
".",
"Depending",
"on",
"the",
"specific",
"type",
"of",
"authentication",
"container",
"that",
"is",
"used",
"this",
"API",
"will",
"leverage",
"the",
"appropriate",
"authentication",
"protocol",
".",
"If",
"authentication",
"is",
"successful",
"then",
"the",
"API",
"returns",
"a",
"list",
"of",
"linked",
"accounts",
"for",
"the",
"user",
"a",
"token",
"containing",
"the",
"ID",
"of",
"the",
"authenticated",
"user",
"and",
"a",
"hash",
"key",
"used",
"by",
"the",
"SoftLayer",
"customer",
"portal",
"to",
"maintain",
"authentication",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L513-L519 |
6,825 | softlayer/softlayer-go | services/user.go | GetOpenIdConnectMigrationState | func (r User_Customer) GetOpenIdConnectMigrationState() (resp datatypes.Container_User_Customer_OpenIdConnect_MigrationState, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getOpenIdConnectMigrationState", nil, &r.Options, &resp)
return
} | go | func (r User_Customer) GetOpenIdConnectMigrationState() (resp datatypes.Container_User_Customer_OpenIdConnect_MigrationState, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer", "getOpenIdConnectMigrationState", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer",
")",
"GetOpenIdConnectMigrationState",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Container_User_Customer_OpenIdConnect_MigrationState",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // This API returns a SoftLayer_Container_User_Customer_OpenIdConnect_MigrationState object containing the necessary information to determine what migration state the user is in. If the account is not OpenIdConnect authenticated, then an exception is thrown. | [
"This",
"API",
"returns",
"a",
"SoftLayer_Container_User_Customer_OpenIdConnect_MigrationState",
"object",
"containing",
"the",
"necessary",
"information",
"to",
"determine",
"what",
"migration",
"state",
"the",
"user",
"is",
"in",
".",
"If",
"the",
"account",
"is",
"not",
"OpenIdConnect",
"authenticated",
"then",
"an",
"exception",
"is",
"thrown",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L549-L552 |
6,826 | softlayer/softlayer-go | services/user.go | GetUserIdForPasswordSet | func (r User_Customer) GetUserIdForPasswordSet(key *string) (resp int, err error) {
params := []interface{}{
key,
}
err = r.Session.DoRequest("SoftLayer_User_Customer", "getUserIdForPasswordSet", params, &r.Options, &resp)
return
} | go | func (r User_Customer) GetUserIdForPasswordSet(key *string) (resp int, err error) {
params := []interface{}{
key,
}
err = r.Session.DoRequest("SoftLayer_User_Customer", "getUserIdForPasswordSet", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer",
")",
"GetUserIdForPasswordSet",
"(",
"key",
"*",
"string",
")",
"(",
"resp",
"int",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"key",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve a user object using a password token. When a new user is created or when a user has requested a password change using initiatePortalPasswordChange, they will have received an email that contains a url with a token. That token is used as the parameter for getUserIdForPasswordSet. | [
"Retrieve",
"a",
"user",
"object",
"using",
"a",
"password",
"token",
".",
"When",
"a",
"new",
"user",
"is",
"created",
"or",
"when",
"a",
"user",
"has",
"requested",
"a",
"password",
"change",
"using",
"initiatePortalPasswordChange",
"they",
"will",
"have",
"received",
"an",
"email",
"that",
"contains",
"a",
"url",
"with",
"a",
"token",
".",
"That",
"token",
"is",
"used",
"as",
"the",
"parameter",
"for",
"getUserIdForPasswordSet",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L705-L711 |
6,827 | softlayer/softlayer-go | services/user.go | GetBillingItem | func (r User_Customer_External_Binding) GetBillingItem() (resp datatypes.Billing_Item, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getBillingItem", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding) GetBillingItem() (resp datatypes.Billing_Item, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getBillingItem", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding",
")",
"GetBillingItem",
"(",
")",
"(",
"resp",
"datatypes",
".",
"Billing_Item",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Information regarding the billing item for external authentication. | [
"Retrieve",
"Information",
"regarding",
"the",
"billing",
"item",
"for",
"external",
"authentication",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1354-L1357 |
6,828 | softlayer/softlayer-go | services/user.go | GetNote | func (r User_Customer_External_Binding) GetNote() (resp string, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getNote", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding) GetNote() (resp string, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getNote", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding",
")",
"GetNote",
"(",
")",
"(",
"resp",
"string",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve An optional note for identifying the external binding. | [
"Retrieve",
"An",
"optional",
"note",
"for",
"identifying",
"the",
"external",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1360-L1363 |
6,829 | softlayer/softlayer-go | services/user.go | GetType | func (r User_Customer_External_Binding) GetType() (resp datatypes.User_External_Binding_Type, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getType", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding) GetType() (resp datatypes.User_External_Binding_Type, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding",
")",
"GetType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_External_Binding_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The type of external authentication binding. | [
"Retrieve",
"The",
"type",
"of",
"external",
"authentication",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1372-L1375 |
6,830 | softlayer/softlayer-go | services/user.go | GetUser | func (r User_Customer_External_Binding) GetUser() (resp datatypes.User_Customer, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getUser", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding) GetUser() (resp datatypes.User_Customer, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getUser", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding",
")",
"GetUser",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The SoftLayer user that the external authentication binding belongs to. | [
"Retrieve",
"The",
"SoftLayer",
"user",
"that",
"the",
"external",
"authentication",
"binding",
"belongs",
"to",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1378-L1381 |
6,831 | softlayer/softlayer-go | services/user.go | GetVendor | func (r User_Customer_External_Binding) GetVendor() (resp datatypes.User_External_Binding_Vendor, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getVendor", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding) GetVendor() (resp datatypes.User_External_Binding_Vendor, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding", "getVendor", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding",
")",
"GetVendor",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_External_Binding_Vendor",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The vendor of an external authentication binding. | [
"Retrieve",
"The",
"vendor",
"of",
"an",
"external",
"authentication",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1384-L1387 |
6,832 | softlayer/softlayer-go | services/user.go | CheckPhoneValidationResult | func (r User_Customer_External_Binding_Phone) CheckPhoneValidationResult(token *string) (resp bool, err error) {
params := []interface{}{
token,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Phone", "checkPhoneValidationResult", params, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding_Phone) CheckPhoneValidationResult(token *string) (resp bool, err error) {
params := []interface{}{
token,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Phone", "checkPhoneValidationResult", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding_Phone",
")",
"CheckPhoneValidationResult",
"(",
"token",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"token",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Return a phone validation result. | [
"Return",
"a",
"phone",
"validation",
"result",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1441-L1447 |
6,833 | softlayer/softlayer-go | services/user.go | UpdateNote | func (r User_Customer_External_Binding_Phone) UpdateNote(text *string) (resp bool, err error) {
params := []interface{}{
text,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Phone", "updateNote", params, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding_Phone) UpdateNote(text *string) (resp bool, err error) {
params := []interface{}{
text,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Phone", "updateNote", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding_Phone",
")",
"UpdateNote",
"(",
"text",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"text",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Update the note of an external binding. The note is an optional property that is used to store information about a binding. | [
"Update",
"the",
"note",
"of",
"an",
"external",
"binding",
".",
"The",
"note",
"is",
"an",
"optional",
"property",
"that",
"is",
"used",
"to",
"store",
"information",
"about",
"a",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1584-L1590 |
6,834 | softlayer/softlayer-go | services/user.go | GetAttributes | func (r User_Customer_External_Binding_Verisign) GetAttributes() (resp []datatypes.User_External_Binding_Attribute, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "getAttributes", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding_Verisign) GetAttributes() (resp []datatypes.User_External_Binding_Attribute, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "getAttributes", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding_Verisign",
")",
"GetAttributes",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_External_Binding_Attribute",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Attributes of an external authentication binding. | [
"Retrieve",
"Attributes",
"of",
"an",
"external",
"authentication",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1901-L1904 |
6,835 | softlayer/softlayer-go | services/user.go | Unlock | func (r User_Customer_External_Binding_Verisign) Unlock(securityCode *string) (resp bool, err error) {
params := []interface{}{
securityCode,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "unlock", params, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding_Verisign) Unlock(securityCode *string) (resp bool, err error) {
params := []interface{}{
securityCode,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "unlock", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding_Verisign",
")",
"Unlock",
"(",
"securityCode",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"securityCode",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // If a VeriSign credential becomes locked because of too many failed login attempts the unlock method can be used to unlock a VeriSign credential. As a security precaution a valid security code generated by the credential will be required before the credential is unlocked. | [
"If",
"a",
"VeriSign",
"credential",
"becomes",
"locked",
"because",
"of",
"too",
"many",
"failed",
"login",
"attempts",
"the",
"unlock",
"method",
"can",
"be",
"used",
"to",
"unlock",
"a",
"VeriSign",
"credential",
".",
"As",
"a",
"security",
"precaution",
"a",
"valid",
"security",
"code",
"generated",
"by",
"the",
"credential",
"will",
"be",
"required",
"before",
"the",
"credential",
"is",
"unlocked",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1967-L1973 |
6,836 | softlayer/softlayer-go | services/user.go | ValidateCredentialId | func (r User_Customer_External_Binding_Verisign) ValidateCredentialId(userId *int, externalId *string) (resp bool, err error) {
params := []interface{}{
userId,
externalId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "validateCredentialId", params, &r.Options, &resp)
return
} | go | func (r User_Customer_External_Binding_Verisign) ValidateCredentialId(userId *int, externalId *string) (resp bool, err error) {
params := []interface{}{
userId,
externalId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_External_Binding_Verisign", "validateCredentialId", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_External_Binding_Verisign",
")",
"ValidateCredentialId",
"(",
"userId",
"*",
"int",
",",
"externalId",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"userId",
",",
"externalId",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Validate the user id and VeriSign credential id used to create an external authentication binding. | [
"Validate",
"the",
"user",
"id",
"and",
"VeriSign",
"credential",
"id",
"used",
"to",
"create",
"an",
"external",
"authentication",
"binding",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L1985-L1992 |
6,837 | softlayer/softlayer-go | services/user.go | GetAvailablePushNotificationSubscriptions | func (r User_Customer_MobileDevice) GetAvailablePushNotificationSubscriptions() (resp []datatypes.Notification, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getAvailablePushNotificationSubscriptions", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_MobileDevice) GetAvailablePushNotificationSubscriptions() (resp []datatypes.Notification, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getAvailablePushNotificationSubscriptions", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_MobileDevice",
")",
"GetAvailablePushNotificationSubscriptions",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Notification",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Notification subscriptions available to a mobile device. | [
"Retrieve",
"Notification",
"subscriptions",
"available",
"to",
"a",
"mobile",
"device",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2111-L2114 |
6,838 | softlayer/softlayer-go | services/user.go | GetOperatingSystem | func (r User_Customer_MobileDevice) GetOperatingSystem() (resp datatypes.User_Customer_MobileDevice_OperatingSystem, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getOperatingSystem", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_MobileDevice) GetOperatingSystem() (resp datatypes.User_Customer_MobileDevice_OperatingSystem, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getOperatingSystem", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_MobileDevice",
")",
"GetOperatingSystem",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer_MobileDevice_OperatingSystem",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The operating system this device is using | [
"Retrieve",
"The",
"operating",
"system",
"this",
"device",
"is",
"using"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2129-L2132 |
6,839 | softlayer/softlayer-go | services/user.go | GetPushNotificationSubscriptions | func (r User_Customer_MobileDevice) GetPushNotificationSubscriptions() (resp []datatypes.Notification_User_Subscriber, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getPushNotificationSubscriptions", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_MobileDevice) GetPushNotificationSubscriptions() (resp []datatypes.Notification_User_Subscriber, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getPushNotificationSubscriptions", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_MobileDevice",
")",
"GetPushNotificationSubscriptions",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Notification_User_Subscriber",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve Notification subscriptions attached to a mobile device. | [
"Retrieve",
"Notification",
"subscriptions",
"attached",
"to",
"a",
"mobile",
"device",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2135-L2138 |
6,840 | softlayer/softlayer-go | services/user.go | GetType | func (r User_Customer_MobileDevice) GetType() (resp datatypes.User_Customer_MobileDevice_Type, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getType", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_MobileDevice) GetType() (resp datatypes.User_Customer_MobileDevice_Type, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_MobileDevice", "getType", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_MobileDevice",
")",
"GetType",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer_MobileDevice_Type",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The type of device this user is using | [
"Retrieve",
"The",
"type",
"of",
"device",
"this",
"user",
"is",
"using"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2141-L2144 |
6,841 | softlayer/softlayer-go | services/user.go | FindByGuestId | func (r User_Customer_Notification_Virtual_Guest) FindByGuestId(id *int) (resp []datatypes.User_Customer_Notification_Virtual_Guest, err error) {
params := []interface{}{
id,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_Notification_Virtual_Guest", "findByGuestId", params, &r.Options, &resp)
return
} | go | func (r User_Customer_Notification_Virtual_Guest) FindByGuestId(id *int) (resp []datatypes.User_Customer_Notification_Virtual_Guest, err error) {
params := []interface{}{
id,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_Notification_Virtual_Guest", "findByGuestId", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_Notification_Virtual_Guest",
")",
"FindByGuestId",
"(",
"id",
"*",
"int",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_Customer_Notification_Virtual_Guest",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"id",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // This method returns all SoftLayer_User_Customer_Notification_Virtual_Guest objects associated with the passed in ID as long as that hardware ID is owned by the current user's account.
//
// This behavior can also be accomplished by simply tapping monitoringUserNotification on the Virtual_Guest object. | [
"This",
"method",
"returns",
"all",
"SoftLayer_User_Customer_Notification_Virtual_Guest",
"objects",
"associated",
"with",
"the",
"passed",
"in",
"ID",
"as",
"long",
"as",
"that",
"hardware",
"ID",
"is",
"owned",
"by",
"the",
"current",
"user",
"s",
"account",
".",
"This",
"behavior",
"can",
"also",
"be",
"accomplished",
"by",
"simply",
"tapping",
"monitoringUserNotification",
"on",
"the",
"Virtual_Guest",
"object",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2416-L2422 |
6,842 | softlayer/softlayer-go | services/user.go | ActivateOpenIdConnectUser | func (r User_Customer_OpenIdConnect) ActivateOpenIdConnectUser(verificationCode *string, userInfo *datatypes.User_Customer, iamId *string) (err error) {
var resp datatypes.Void
params := []interface{}{
verificationCode,
userInfo,
iamId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "activateOpenIdConnectUser", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) ActivateOpenIdConnectUser(verificationCode *string, userInfo *datatypes.User_Customer, iamId *string) (err error) {
var resp datatypes.Void
params := []interface{}{
verificationCode,
userInfo,
iamId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "activateOpenIdConnectUser", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"ActivateOpenIdConnectUser",
"(",
"verificationCode",
"*",
"string",
",",
"userInfo",
"*",
"datatypes",
".",
"User_Customer",
",",
"iamId",
"*",
"string",
")",
"(",
"err",
"error",
")",
"{",
"var",
"resp",
"datatypes",
".",
"Void",
"\n",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"verificationCode",
",",
"userInfo",
",",
"iamId",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Completes invitation process for an OpenIdConnect user created by Bluemix Unified User Console. | [
"Completes",
"invitation",
"process",
"for",
"an",
"OpenIdConnect",
"user",
"created",
"by",
"Bluemix",
"Unified",
"User",
"Console",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2490-L2499 |
6,843 | softlayer/softlayer-go | services/user.go | AddNotificationSubscriber | func (r User_Customer_OpenIdConnect) AddNotificationSubscriber(notificationKeyName *string) (resp bool, err error) {
params := []interface{}{
notificationKeyName,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "addNotificationSubscriber", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) AddNotificationSubscriber(notificationKeyName *string) (resp bool, err error) {
params := []interface{}{
notificationKeyName,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "addNotificationSubscriber", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"AddNotificationSubscriber",
"(",
"notificationKeyName",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"notificationKeyName",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Create a notification subscription record for the user. If a subscription record exists for the notification, the record will be set to active, if currently inactive. | [
"Create",
"a",
"notification",
"subscription",
"record",
"for",
"the",
"user",
".",
"If",
"a",
"subscription",
"record",
"exists",
"for",
"the",
"notification",
"the",
"record",
"will",
"be",
"set",
"to",
"active",
"if",
"currently",
"inactive",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2595-L2601 |
6,844 | softlayer/softlayer-go | services/user.go | CheckPhoneFactorAuthenticationForPasswordSet | func (r User_Customer_OpenIdConnect) CheckPhoneFactorAuthenticationForPasswordSet(passwordSet *datatypes.Container_User_Customer_PasswordSet, authenticationContainer *datatypes.Container_User_Customer_External_Binding) (resp bool, err error) {
params := []interface{}{
passwordSet,
authenticationContainer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "checkPhoneFactorAuthenticationForPasswordSet", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) CheckPhoneFactorAuthenticationForPasswordSet(passwordSet *datatypes.Container_User_Customer_PasswordSet, authenticationContainer *datatypes.Container_User_Customer_External_Binding) (resp bool, err error) {
params := []interface{}{
passwordSet,
authenticationContainer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "checkPhoneFactorAuthenticationForPasswordSet", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"CheckPhoneFactorAuthenticationForPasswordSet",
"(",
"passwordSet",
"*",
"datatypes",
".",
"Container_User_Customer_PasswordSet",
",",
"authenticationContainer",
"*",
"datatypes",
".",
"Container_User_Customer_External_Binding",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"passwordSet",
",",
"authenticationContainer",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Add a description here
//
// | [
"Add",
"a",
"description",
"here"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2673-L2680 |
6,845 | softlayer/softlayer-go | services/user.go | GetExternalBindings | func (r User_Customer_OpenIdConnect) GetExternalBindings() (resp []datatypes.User_External_Binding, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getExternalBindings", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetExternalBindings() (resp []datatypes.User_External_Binding, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getExternalBindings", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetExternalBindings",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_External_Binding",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The external authentication bindings that link an external identifier to a SoftLayer user. | [
"Retrieve",
"The",
"external",
"authentication",
"bindings",
"that",
"link",
"an",
"external",
"identifier",
"to",
"a",
"SoftLayer",
"user",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2892-L2895 |
6,846 | softlayer/softlayer-go | services/user.go | GetLoginAccountInfoOpenIdConnect | func (r User_Customer_OpenIdConnect) GetLoginAccountInfoOpenIdConnect(providerType *string, accessToken *string) (resp datatypes.Container_User_Customer_OpenIdConnect_LoginAccountInfo, err error) {
params := []interface{}{
providerType,
accessToken,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getLoginAccountInfoOpenIdConnect", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetLoginAccountInfoOpenIdConnect(providerType *string, accessToken *string) (resp datatypes.Container_User_Customer_OpenIdConnect_LoginAccountInfo, err error) {
params := []interface{}{
providerType,
accessToken,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getLoginAccountInfoOpenIdConnect", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetLoginAccountInfoOpenIdConnect",
"(",
"providerType",
"*",
"string",
",",
"accessToken",
"*",
"string",
")",
"(",
"resp",
"datatypes",
".",
"Container_User_Customer_OpenIdConnect_LoginAccountInfo",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"providerType",
",",
"accessToken",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Validates a supplied OpenIdConnect access token to the SoftLayer customer portal and returns the default account name and id for the active user. An exception will be thrown if no matching customer is found. | [
"Validates",
"a",
"supplied",
"OpenIdConnect",
"access",
"token",
"to",
"the",
"SoftLayer",
"customer",
"portal",
"and",
"returns",
"the",
"default",
"account",
"name",
"and",
"id",
"for",
"the",
"active",
"user",
".",
"An",
"exception",
"will",
"be",
"thrown",
"if",
"no",
"matching",
"customer",
"is",
"found",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2964-L2971 |
6,847 | softlayer/softlayer-go | services/user.go | GetMappedAccounts | func (r User_Customer_OpenIdConnect) GetMappedAccounts(providerType *string) (resp []datatypes.Account, err error) {
params := []interface{}{
providerType,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getMappedAccounts", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetMappedAccounts(providerType *string) (resp []datatypes.Account, err error) {
params := []interface{}{
providerType,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getMappedAccounts", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetMappedAccounts",
"(",
"providerType",
"*",
"string",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Account",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"providerType",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // An OpenIdConnect identity, for example an IAMid, can be linked or mapped to one or more individual SoftLayer users, but no more than one SoftLayer user per account. This effectively links the OpenIdConnect identity to those accounts. This API returns a list of all active accounts for which there is a link between the OpenIdConnect identity and a SoftLayer user. Invoke this only on IAMid-authenticated users. | [
"An",
"OpenIdConnect",
"identity",
"for",
"example",
"an",
"IAMid",
"can",
"be",
"linked",
"or",
"mapped",
"to",
"one",
"or",
"more",
"individual",
"SoftLayer",
"users",
"but",
"no",
"more",
"than",
"one",
"SoftLayer",
"user",
"per",
"account",
".",
"This",
"effectively",
"links",
"the",
"OpenIdConnect",
"identity",
"to",
"those",
"accounts",
".",
"This",
"API",
"returns",
"a",
"list",
"of",
"all",
"active",
"accounts",
"for",
"which",
"there",
"is",
"a",
"link",
"between",
"the",
"OpenIdConnect",
"identity",
"and",
"a",
"SoftLayer",
"user",
".",
"Invoke",
"this",
"only",
"on",
"IAMid",
"-",
"authenticated",
"users",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2989-L2995 |
6,848 | softlayer/softlayer-go | services/user.go | GetMobileDevices | func (r User_Customer_OpenIdConnect) GetMobileDevices() (resp []datatypes.User_Customer_MobileDevice, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getMobileDevices", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetMobileDevices() (resp []datatypes.User_Customer_MobileDevice, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getMobileDevices", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetMobileDevices",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_Customer_MobileDevice",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A portal user's associated mobile device profiles. | [
"Retrieve",
"A",
"portal",
"user",
"s",
"associated",
"mobile",
"device",
"profiles",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L2998-L3001 |
6,849 | softlayer/softlayer-go | services/user.go | GetPermissions | func (r User_Customer_OpenIdConnect) GetPermissions() (resp []datatypes.User_Customer_CustomerPermission_Permission, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getPermissions", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetPermissions() (resp []datatypes.User_Customer_CustomerPermission_Permission, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getPermissions", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetPermissions",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_Customer_CustomerPermission_Permission",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A portal user's permissions. These permissions control that user's access to functions within the SoftLayer customer portal and API. | [
"Retrieve",
"A",
"portal",
"user",
"s",
"permissions",
".",
"These",
"permissions",
"control",
"that",
"user",
"s",
"access",
"to",
"functions",
"within",
"the",
"SoftLayer",
"customer",
"portal",
"and",
"API",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3050-L3053 |
6,850 | softlayer/softlayer-go | services/user.go | GetPortalLoginTokenOpenIdConnect | func (r User_Customer_OpenIdConnect) GetPortalLoginTokenOpenIdConnect(providerType *string, accessToken *string, accountId *int, securityQuestionId *int, securityQuestionAnswer *string) (resp datatypes.Container_User_Customer_Portal_Token, err error) {
params := []interface{}{
providerType,
accessToken,
accountId,
securityQuestionId,
securityQuestionAnswer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getPortalLoginTokenOpenIdConnect", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetPortalLoginTokenOpenIdConnect(providerType *string, accessToken *string, accountId *int, securityQuestionId *int, securityQuestionAnswer *string) (resp datatypes.Container_User_Customer_Portal_Token, err error) {
params := []interface{}{
providerType,
accessToken,
accountId,
securityQuestionId,
securityQuestionAnswer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getPortalLoginTokenOpenIdConnect", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetPortalLoginTokenOpenIdConnect",
"(",
"providerType",
"*",
"string",
",",
"accessToken",
"*",
"string",
",",
"accountId",
"*",
"int",
",",
"securityQuestionId",
"*",
"int",
",",
"securityQuestionAnswer",
"*",
"string",
")",
"(",
"resp",
"datatypes",
".",
"Container_User_Customer_Portal_Token",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"providerType",
",",
"accessToken",
",",
"accountId",
",",
"securityQuestionId",
",",
"securityQuestionAnswer",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Attempt to authenticate a supplied OpenIdConnect access token to the SoftLayer customer portal. If authentication is successful then the API returns a token containing the ID of the authenticated user and a hash key used by the SoftLayer customer portal to maintain authentication. | [
"Attempt",
"to",
"authenticate",
"a",
"supplied",
"OpenIdConnect",
"access",
"token",
"to",
"the",
"SoftLayer",
"customer",
"portal",
".",
"If",
"authentication",
"is",
"successful",
"then",
"the",
"API",
"returns",
"a",
"token",
"containing",
"the",
"ID",
"of",
"the",
"authenticated",
"user",
"and",
"a",
"hash",
"key",
"used",
"by",
"the",
"SoftLayer",
"customer",
"portal",
"to",
"maintain",
"authentication",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3068-L3078 |
6,851 | softlayer/softlayer-go | services/user.go | GetSuccessfulLogins | func (r User_Customer_OpenIdConnect) GetSuccessfulLogins() (resp []datatypes.User_Customer_Access_Authentication, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getSuccessfulLogins", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetSuccessfulLogins() (resp []datatypes.User_Customer_Access_Authentication, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getSuccessfulLogins", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetSuccessfulLogins",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"User_Customer_Access_Authentication",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A user's successful attempts to log into the SoftLayer customer portal. | [
"Retrieve",
"A",
"user",
"s",
"successful",
"attempts",
"to",
"log",
"into",
"the",
"SoftLayer",
"customer",
"portal",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3135-L3138 |
6,852 | softlayer/softlayer-go | services/user.go | GetSurveys | func (r User_Customer_OpenIdConnect) GetSurveys() (resp []datatypes.Survey, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getSurveys", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetSurveys() (resp []datatypes.Survey, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getSurveys", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetSurveys",
"(",
")",
"(",
"resp",
"[",
"]",
"datatypes",
".",
"Survey",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The surveys that a user has taken in the SoftLayer customer portal. | [
"Retrieve",
"The",
"surveys",
"that",
"a",
"user",
"has",
"taken",
"in",
"the",
"SoftLayer",
"customer",
"portal",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3171-L3174 |
6,853 | softlayer/softlayer-go | services/user.go | GetUserForUnifiedInvitation | func (r User_Customer_OpenIdConnect) GetUserForUnifiedInvitation(openIdConnectUserId *string, uniqueIdentifier *string, searchInvitationsNotLinksFlag *string) (resp datatypes.User_Customer_OpenIdConnect, err error) {
params := []interface{}{
openIdConnectUserId,
uniqueIdentifier,
searchInvitationsNotLinksFlag,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getUserForUnifiedInvitation", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetUserForUnifiedInvitation(openIdConnectUserId *string, uniqueIdentifier *string, searchInvitationsNotLinksFlag *string) (resp datatypes.User_Customer_OpenIdConnect, err error) {
params := []interface{}{
openIdConnectUserId,
uniqueIdentifier,
searchInvitationsNotLinksFlag,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getUserForUnifiedInvitation", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetUserForUnifiedInvitation",
"(",
"openIdConnectUserId",
"*",
"string",
",",
"uniqueIdentifier",
"*",
"string",
",",
"searchInvitationsNotLinksFlag",
"*",
"string",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer_OpenIdConnect",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"openIdConnectUserId",
",",
"uniqueIdentifier",
",",
"searchInvitationsNotLinksFlag",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Returns an IMS User Object from the provided OpenIdConnect User ID or IBMid Unique Identifier for the Account of the active user. Enforces the User Management permissions for the Active User. An exception will be thrown if no matching IMS User is found. NOTE that providing IBMid Unique Identifier is optional, but it will be preferred over OpenIdConnect User ID if provided. | [
"Returns",
"an",
"IMS",
"User",
"Object",
"from",
"the",
"provided",
"OpenIdConnect",
"User",
"ID",
"or",
"IBMid",
"Unique",
"Identifier",
"for",
"the",
"Account",
"of",
"the",
"active",
"user",
".",
"Enforces",
"the",
"User",
"Management",
"permissions",
"for",
"the",
"Active",
"User",
".",
"An",
"exception",
"will",
"be",
"thrown",
"if",
"no",
"matching",
"IMS",
"User",
"is",
"found",
".",
"NOTE",
"that",
"providing",
"IBMid",
"Unique",
"Identifier",
"is",
"optional",
"but",
"it",
"will",
"be",
"preferred",
"over",
"OpenIdConnect",
"User",
"ID",
"if",
"provided",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3195-L3203 |
6,854 | softlayer/softlayer-go | services/user.go | GetUserStatus | func (r User_Customer_OpenIdConnect) GetUserStatus() (resp datatypes.User_Customer_Status, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getUserStatus", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) GetUserStatus() (resp datatypes.User_Customer_Status, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "getUserStatus", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"GetUserStatus",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer_Status",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve A portal user's status, which controls overall access to the SoftLayer customer portal and VPN access to the private network. | [
"Retrieve",
"A",
"portal",
"user",
"s",
"status",
"which",
"controls",
"overall",
"access",
"to",
"the",
"SoftLayer",
"customer",
"portal",
"and",
"VPN",
"access",
"to",
"the",
"private",
"network",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3231-L3234 |
6,855 | softlayer/softlayer-go | services/user.go | InitiatePortalPasswordChangeByBrandAgent | func (r User_Customer_OpenIdConnect) InitiatePortalPasswordChangeByBrandAgent(username *string) (resp bool, err error) {
params := []interface{}{
username,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "initiatePortalPasswordChangeByBrandAgent", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) InitiatePortalPasswordChangeByBrandAgent(username *string) (resp bool, err error) {
params := []interface{}{
username,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "initiatePortalPasswordChangeByBrandAgent", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"InitiatePortalPasswordChangeByBrandAgent",
"(",
"username",
"*",
"string",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"username",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // A Brand Agent that has permissions to Add Customer Accounts will be able to request the password email be sent to the Master User of a Customer Account created by the same Brand as the agent making the request. Due to security reasons, the number of reset requests are limited within an undisclosed timeframe. | [
"A",
"Brand",
"Agent",
"that",
"has",
"permissions",
"to",
"Add",
"Customer",
"Accounts",
"will",
"be",
"able",
"to",
"request",
"the",
"password",
"email",
"be",
"sent",
"to",
"the",
"Master",
"User",
"of",
"a",
"Customer",
"Account",
"created",
"by",
"the",
"same",
"Brand",
"as",
"the",
"agent",
"making",
"the",
"request",
".",
"Due",
"to",
"security",
"reasons",
"the",
"number",
"of",
"reset",
"requests",
"are",
"limited",
"within",
"an",
"undisclosed",
"timeframe",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3279-L3285 |
6,856 | softlayer/softlayer-go | services/user.go | InviteUserToLinkOpenIdConnect | func (r User_Customer_OpenIdConnect) InviteUserToLinkOpenIdConnect(providerType *string) (err error) {
var resp datatypes.Void
params := []interface{}{
providerType,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "inviteUserToLinkOpenIdConnect", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) InviteUserToLinkOpenIdConnect(providerType *string) (err error) {
var resp datatypes.Void
params := []interface{}{
providerType,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "inviteUserToLinkOpenIdConnect", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"InviteUserToLinkOpenIdConnect",
"(",
"providerType",
"*",
"string",
")",
"(",
"err",
"error",
")",
"{",
"var",
"resp",
"datatypes",
".",
"Void",
"\n",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"providerType",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Send email invitation to a user to join a SoftLayer account and authenticate with OpenIdConnect. Throws an exception on error. | [
"Send",
"email",
"invitation",
"to",
"a",
"user",
"to",
"join",
"a",
"SoftLayer",
"account",
"and",
"authenticate",
"with",
"OpenIdConnect",
".",
"Throws",
"an",
"exception",
"on",
"error",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3288-L3295 |
6,857 | softlayer/softlayer-go | services/user.go | IsMasterUser | func (r User_Customer_OpenIdConnect) IsMasterUser() (resp bool, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "isMasterUser", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) IsMasterUser() (resp bool, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "isMasterUser", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"IsMasterUser",
"(",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Portal users are considered master users if they don't have an associated parent user. The only users who don't have parent users are users whose username matches their SoftLayer account name. Master users have special permissions throughout the SoftLayer customer portal. | [
"Portal",
"users",
"are",
"considered",
"master",
"users",
"if",
"they",
"don",
"t",
"have",
"an",
"associated",
"parent",
"user",
".",
"The",
"only",
"users",
"who",
"don",
"t",
"have",
"parent",
"users",
"are",
"users",
"whose",
"username",
"matches",
"their",
"SoftLayer",
"account",
"name",
".",
"Master",
"users",
"have",
"special",
"permissions",
"throughout",
"the",
"SoftLayer",
"customer",
"portal",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3298-L3301 |
6,858 | softlayer/softlayer-go | services/user.go | IsValidForumPassword | func (r User_Customer_OpenIdConnect) IsValidForumPassword(password *string) (err error) {
var resp datatypes.Void
params := []interface{}{
password,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "isValidForumPassword", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) IsValidForumPassword(password *string) (err error) {
var resp datatypes.Void
params := []interface{}{
password,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "isValidForumPassword", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"IsValidForumPassword",
"(",
"password",
"*",
"string",
")",
"(",
"err",
"error",
")",
"{",
"var",
"resp",
"datatypes",
".",
"Void",
"\n",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"password",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // This method is deprecated! SoftLayer Community Forums no longer exist, therefore, any password verified will return false. In the future, this method will be completely removed.
//
// Determine if a string is the given user's login password to the SoftLayer community forums. | [
"This",
"method",
"is",
"deprecated!",
"SoftLayer",
"Community",
"Forums",
"no",
"longer",
"exist",
"therefore",
"any",
"password",
"verified",
"will",
"return",
"false",
".",
"In",
"the",
"future",
"this",
"method",
"will",
"be",
"completely",
"removed",
".",
"Determine",
"if",
"a",
"string",
"is",
"the",
"given",
"user",
"s",
"login",
"password",
"to",
"the",
"SoftLayer",
"community",
"forums",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3306-L3313 |
6,859 | softlayer/softlayer-go | services/user.go | PerformExternalAuthentication | func (r User_Customer_OpenIdConnect) PerformExternalAuthentication(authenticationContainer *datatypes.Container_User_Customer_External_Binding) (resp datatypes.Container_User_Customer_Portal_Token, err error) {
params := []interface{}{
authenticationContainer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "performExternalAuthentication", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) PerformExternalAuthentication(authenticationContainer *datatypes.Container_User_Customer_External_Binding) (resp datatypes.Container_User_Customer_Portal_Token, err error) {
params := []interface{}{
authenticationContainer,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "performExternalAuthentication", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"PerformExternalAuthentication",
"(",
"authenticationContainer",
"*",
"datatypes",
".",
"Container_User_Customer_External_Binding",
")",
"(",
"resp",
"datatypes",
".",
"Container_User_Customer_Portal_Token",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"authenticationContainer",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // The perform external authentication method will authenticate the given external authentication container with an external vendor. The authentication container and its contents will be verified before an attempt is made to authenticate the contents of the container with an external vendor. | [
"The",
"perform",
"external",
"authentication",
"method",
"will",
"authenticate",
"the",
"given",
"external",
"authentication",
"container",
"with",
"an",
"external",
"vendor",
".",
"The",
"authentication",
"container",
"and",
"its",
"contents",
"will",
"be",
"verified",
"before",
"an",
"attempt",
"is",
"made",
"to",
"authenticate",
"the",
"contents",
"of",
"the",
"container",
"with",
"an",
"external",
"vendor",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3325-L3331 |
6,860 | softlayer/softlayer-go | services/user.go | RemoveApiAuthenticationKey | func (r User_Customer_OpenIdConnect) RemoveApiAuthenticationKey(keyId *int) (resp bool, err error) {
params := []interface{}{
keyId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeApiAuthenticationKey", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) RemoveApiAuthenticationKey(keyId *int) (resp bool, err error) {
params := []interface{}{
keyId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeApiAuthenticationKey", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"RemoveApiAuthenticationKey",
"(",
"keyId",
"*",
"int",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"keyId",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Remove a user's API authentication key, removing that user's access to query the SoftLayer API. | [
"Remove",
"a",
"user",
"s",
"API",
"authentication",
"key",
"removing",
"that",
"user",
"s",
"access",
"to",
"query",
"the",
"SoftLayer",
"API",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3378-L3384 |
6,861 | softlayer/softlayer-go | services/user.go | RemoveBulkDedicatedHostAccess | func (r User_Customer_OpenIdConnect) RemoveBulkDedicatedHostAccess(dedicatedHostIds []int) (resp bool, err error) {
params := []interface{}{
dedicatedHostIds,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeBulkDedicatedHostAccess", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) RemoveBulkDedicatedHostAccess(dedicatedHostIds []int) (resp bool, err error) {
params := []interface{}{
dedicatedHostIds,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeBulkDedicatedHostAccess", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"RemoveBulkDedicatedHostAccess",
"(",
"dedicatedHostIds",
"[",
"]",
"int",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"dedicatedHostIds",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Revokes access for the user to one or more dedicated host devices. The user will only be allowed to see and access devices in both the portal and the API to which they have been granted access. If the user's account has devices to which the user has not been granted access or the access has been revoked, then "not found" exceptions are thrown if the user attempts to access any of these devices.
//
// Users can assign device access to their child users, but not to themselves. An account's master has access to all devices on their customer account and can set dedicated host access for any of the other users on their account.
//
// If the user has full dedicatedHost access, then it will provide access to "ALL but passed in" dedicatedHost ids. | [
"Revokes",
"access",
"for",
"the",
"user",
"to",
"one",
"or",
"more",
"dedicated",
"host",
"devices",
".",
"The",
"user",
"will",
"only",
"be",
"allowed",
"to",
"see",
"and",
"access",
"devices",
"in",
"both",
"the",
"portal",
"and",
"the",
"API",
"to",
"which",
"they",
"have",
"been",
"granted",
"access",
".",
"If",
"the",
"user",
"s",
"account",
"has",
"devices",
"to",
"which",
"the",
"user",
"has",
"not",
"been",
"granted",
"access",
"or",
"the",
"access",
"has",
"been",
"revoked",
"then",
"not",
"found",
"exceptions",
"are",
"thrown",
"if",
"the",
"user",
"attempts",
"to",
"access",
"any",
"of",
"these",
"devices",
".",
"Users",
"can",
"assign",
"device",
"access",
"to",
"their",
"child",
"users",
"but",
"not",
"to",
"themselves",
".",
"An",
"account",
"s",
"master",
"has",
"access",
"to",
"all",
"devices",
"on",
"their",
"customer",
"account",
"and",
"can",
"set",
"dedicated",
"host",
"access",
"for",
"any",
"of",
"the",
"other",
"users",
"on",
"their",
"account",
".",
"If",
"the",
"user",
"has",
"full",
"dedicatedHost",
"access",
"then",
"it",
"will",
"provide",
"access",
"to",
"ALL",
"but",
"passed",
"in",
"dedicatedHost",
"ids",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3391-L3397 |
6,862 | softlayer/softlayer-go | services/user.go | RemoveDedicatedHostAccess | func (r User_Customer_OpenIdConnect) RemoveDedicatedHostAccess(dedicatedHostId *int) (resp bool, err error) {
params := []interface{}{
dedicatedHostId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeDedicatedHostAccess", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) RemoveDedicatedHostAccess(dedicatedHostId *int) (resp bool, err error) {
params := []interface{}{
dedicatedHostId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "removeDedicatedHostAccess", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"RemoveDedicatedHostAccess",
"(",
"dedicatedHostId",
"*",
"int",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"dedicatedHostId",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Revokes access for the user to a single dedicated host device. The user will only be allowed to see and access devices in both the portal and the API to which they have been granted access. If the user's account has devices to which the user has not been granted access or the access has been revoked, then "not found" exceptions are thrown if the user attempts to access any of these devices.
//
// Users can assign device access to their child users, but not to themselves. An account's master has access to all devices on their customer account and can set dedicated host access for any of the other users on their account. | [
"Revokes",
"access",
"for",
"the",
"user",
"to",
"a",
"single",
"dedicated",
"host",
"device",
".",
"The",
"user",
"will",
"only",
"be",
"allowed",
"to",
"see",
"and",
"access",
"devices",
"in",
"both",
"the",
"portal",
"and",
"the",
"API",
"to",
"which",
"they",
"have",
"been",
"granted",
"access",
".",
"If",
"the",
"user",
"s",
"account",
"has",
"devices",
"to",
"which",
"the",
"user",
"has",
"not",
"been",
"granted",
"access",
"or",
"the",
"access",
"has",
"been",
"revoked",
"then",
"not",
"found",
"exceptions",
"are",
"thrown",
"if",
"the",
"user",
"attempts",
"to",
"access",
"any",
"of",
"these",
"devices",
".",
"Users",
"can",
"assign",
"device",
"access",
"to",
"their",
"child",
"users",
"but",
"not",
"to",
"themselves",
".",
"An",
"account",
"s",
"master",
"has",
"access",
"to",
"all",
"devices",
"on",
"their",
"customer",
"account",
"and",
"can",
"set",
"dedicated",
"host",
"access",
"for",
"any",
"of",
"the",
"other",
"users",
"on",
"their",
"account",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3454-L3460 |
6,863 | softlayer/softlayer-go | services/user.go | SetDefaultAccount | func (r User_Customer_OpenIdConnect) SetDefaultAccount(providerType *string, accountId *int) (resp datatypes.Account, err error) {
params := []interface{}{
providerType,
accountId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "setDefaultAccount", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) SetDefaultAccount(providerType *string, accountId *int) (resp datatypes.Account, err error) {
params := []interface{}{
providerType,
accountId,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "setDefaultAccount", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"SetDefaultAccount",
"(",
"providerType",
"*",
"string",
",",
"accountId",
"*",
"int",
")",
"(",
"resp",
"datatypes",
".",
"Account",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"providerType",
",",
"accountId",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // An OpenIdConnect identity, for example an IAMid, can be linked or mapped to one or more individual SoftLayer users, but no more than one per account. If an OpenIdConnect identity is mapped to multiple accounts in this manner, one such account should be identified as the default account for that identity. Invoke this only on IBMid-authenticated users. | [
"An",
"OpenIdConnect",
"identity",
"for",
"example",
"an",
"IAMid",
"can",
"be",
"linked",
"or",
"mapped",
"to",
"one",
"or",
"more",
"individual",
"SoftLayer",
"users",
"but",
"no",
"more",
"than",
"one",
"per",
"account",
".",
"If",
"an",
"OpenIdConnect",
"identity",
"is",
"mapped",
"to",
"multiple",
"accounts",
"in",
"this",
"manner",
"one",
"such",
"account",
"should",
"be",
"identified",
"as",
"the",
"default",
"account",
"for",
"that",
"identity",
".",
"Invoke",
"this",
"only",
"on",
"IBMid",
"-",
"authenticated",
"users",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3563-L3570 |
6,864 | softlayer/softlayer-go | services/user.go | UpdateSubscriberDeliveryMethod | func (r User_Customer_OpenIdConnect) UpdateSubscriberDeliveryMethod(notificationKeyName *string, deliveryMethodKeyNames []string, active *int) (resp bool, err error) {
params := []interface{}{
notificationKeyName,
deliveryMethodKeyNames,
active,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "updateSubscriberDeliveryMethod", params, &r.Options, &resp)
return
} | go | func (r User_Customer_OpenIdConnect) UpdateSubscriberDeliveryMethod(notificationKeyName *string, deliveryMethodKeyNames []string, active *int) (resp bool, err error) {
params := []interface{}{
notificationKeyName,
deliveryMethodKeyNames,
active,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_OpenIdConnect", "updateSubscriberDeliveryMethod", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_OpenIdConnect",
")",
"UpdateSubscriberDeliveryMethod",
"(",
"notificationKeyName",
"*",
"string",
",",
"deliveryMethodKeyNames",
"[",
"]",
"string",
",",
"active",
"*",
"int",
")",
"(",
"resp",
"bool",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"notificationKeyName",
",",
"deliveryMethodKeyNames",
",",
"active",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Update a delivery method for a notification that the user is subscribed to. A delivery method keyName along with an active flag can be supplied to update the active status of the delivery methods for the specified notification. Available delivery methods - 'EMAIL'. Available notifications - 'PLANNED_MAINTENANCE', 'UNPLANNED_INCIDENT'. | [
"Update",
"a",
"delivery",
"method",
"for",
"a",
"notification",
"that",
"the",
"user",
"is",
"subscribed",
"to",
".",
"A",
"delivery",
"method",
"keyName",
"along",
"with",
"an",
"active",
"flag",
"can",
"be",
"supplied",
"to",
"update",
"the",
"active",
"status",
"of",
"the",
"delivery",
"methods",
"for",
"the",
"specified",
"notification",
".",
"Available",
"delivery",
"methods",
"-",
"EMAIL",
".",
"Available",
"notifications",
"-",
"PLANNED_MAINTENANCE",
"UNPLANNED_INCIDENT",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3623-L3631 |
6,865 | softlayer/softlayer-go | services/user.go | Enroll | func (r User_Customer_Prospect_ServiceProvider_EnrollRequest) Enroll(templateObject *datatypes.User_Customer_Prospect_ServiceProvider_EnrollRequest) (resp datatypes.User_Customer_Prospect_ServiceProvider_EnrollRequest, err error) {
params := []interface{}{
templateObject,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_Prospect_ServiceProvider_EnrollRequest", "enroll", params, &r.Options, &resp)
return
} | go | func (r User_Customer_Prospect_ServiceProvider_EnrollRequest) Enroll(templateObject *datatypes.User_Customer_Prospect_ServiceProvider_EnrollRequest) (resp datatypes.User_Customer_Prospect_ServiceProvider_EnrollRequest, err error) {
params := []interface{}{
templateObject,
}
err = r.Session.DoRequest("SoftLayer_User_Customer_Prospect_ServiceProvider_EnrollRequest", "enroll", params, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_Prospect_ServiceProvider_EnrollRequest",
")",
"Enroll",
"(",
"templateObject",
"*",
"datatypes",
".",
"User_Customer_Prospect_ServiceProvider_EnrollRequest",
")",
"(",
"resp",
"datatypes",
".",
"User_Customer_Prospect_ServiceProvider_EnrollRequest",
",",
"err",
"error",
")",
"{",
"params",
":=",
"[",
"]",
"interface",
"{",
"}",
"{",
"templateObject",
",",
"}",
"\n",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"params",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Create a new Service Provider Enrollment | [
"Create",
"a",
"new",
"Service",
"Provider",
"Enrollment"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3756-L3762 |
6,866 | softlayer/softlayer-go | services/user.go | GetQuestion | func (r User_Customer_Security_Answer) GetQuestion() (resp datatypes.User_Security_Question, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_Security_Answer", "getQuestion", nil, &r.Options, &resp)
return
} | go | func (r User_Customer_Security_Answer) GetQuestion() (resp datatypes.User_Security_Question, err error) {
err = r.Session.DoRequest("SoftLayer_User_Customer_Security_Answer", "getQuestion", nil, &r.Options, &resp)
return
} | [
"func",
"(",
"r",
"User_Customer_Security_Answer",
")",
"GetQuestion",
"(",
")",
"(",
"resp",
"datatypes",
".",
"User_Security_Question",
",",
"err",
"error",
")",
"{",
"err",
"=",
"r",
".",
"Session",
".",
"DoRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
",",
"nil",
",",
"&",
"r",
".",
"Options",
",",
"&",
"resp",
")",
"\n",
"return",
"\n",
"}"
] | // Retrieve The question the security answer is associated with. | [
"Retrieve",
"The",
"question",
"the",
"security",
"answer",
"is",
"associated",
"with",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/services/user.go#L3823-L3826 |
6,867 | softlayer/softlayer-go | sl/helpers.go | Time | func Time(v time.Time) *datatypes.Time {
r := datatypes.Time{Time: v}
return &r
} | go | func Time(v time.Time) *datatypes.Time {
r := datatypes.Time{Time: v}
return &r
} | [
"func",
"Time",
"(",
"v",
"time",
".",
"Time",
")",
"*",
"datatypes",
".",
"Time",
"{",
"r",
":=",
"datatypes",
".",
"Time",
"{",
"Time",
":",
"v",
"}",
"\n",
"return",
"&",
"r",
"\n",
"}"
] | // Time converts the time.Time value provided to a datatypes.Time value,
// and returns a pointer to it | [
"Time",
"converts",
"the",
"time",
".",
"Time",
"value",
"provided",
"to",
"a",
"datatypes",
".",
"Time",
"value",
"and",
"returns",
"a",
"pointer",
"to",
"it"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/sl/helpers.go#L50-L53 |
6,868 | softlayer/softlayer-go | sl/helpers.go | Float | func Float(v float64) *datatypes.Float64 {
r := datatypes.Float64(v)
return &r
} | go | func Float(v float64) *datatypes.Float64 {
r := datatypes.Float64(v)
return &r
} | [
"func",
"Float",
"(",
"v",
"float64",
")",
"*",
"datatypes",
".",
"Float64",
"{",
"r",
":=",
"datatypes",
".",
"Float64",
"(",
"v",
")",
"\n",
"return",
"&",
"r",
"\n",
"}"
] | // Float converts the float value provided to a datatypes.Float64 value,
// and returns a pointer to it | [
"Float",
"converts",
"the",
"float",
"value",
"provided",
"to",
"a",
"datatypes",
".",
"Float64",
"value",
"and",
"returns",
"a",
"pointer",
"to",
"it"
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/sl/helpers.go#L57-L60 |
6,869 | softlayer/softlayer-go | sl/helpers.go | Get | func Get(p interface{}, d ...interface{}) interface{} {
var (
val interface{}
ok bool
)
if val, ok = GetOk(p); ok {
return val
}
if len(d) > 0 {
return d[0]
}
return val
} | go | func Get(p interface{}, d ...interface{}) interface{} {
var (
val interface{}
ok bool
)
if val, ok = GetOk(p); ok {
return val
}
if len(d) > 0 {
return d[0]
}
return val
} | [
"func",
"Get",
"(",
"p",
"interface",
"{",
"}",
",",
"d",
"...",
"interface",
"{",
"}",
")",
"interface",
"{",
"}",
"{",
"var",
"(",
"val",
"interface",
"{",
"}",
"\n",
"ok",
"bool",
"\n",
")",
"\n\n",
"if",
"val",
",",
"ok",
"=",
"GetOk",
"(",
"p",
")",
";",
"ok",
"{",
"return",
"val",
"\n",
"}",
"\n\n",
"if",
"len",
"(",
"d",
")",
">",
"0",
"{",
"return",
"d",
"[",
"0",
"]",
"\n",
"}",
"\n\n",
"return",
"val",
"\n",
"}"
] | // Convenience functions to simplify dereference of datatype properties
// Get returns the value of p, either p itself, or, if p is a pointer, the
// value that p points to. d is an optional default value to be returned
// in the event that p is nil. If d is not specified, and p is nil, a
// type-appropriate zero-value is returned instead. | [
"Convenience",
"functions",
"to",
"simplify",
"dereference",
"of",
"datatype",
"properties",
"Get",
"returns",
"the",
"value",
"of",
"p",
"either",
"p",
"itself",
"or",
"if",
"p",
"is",
"a",
"pointer",
"the",
"value",
"that",
"p",
"points",
"to",
".",
"d",
"is",
"an",
"optional",
"default",
"value",
"to",
"be",
"returned",
"in",
"the",
"event",
"that",
"p",
"is",
"nil",
".",
"If",
"d",
"is",
"not",
"specified",
"and",
"p",
"is",
"nil",
"a",
"type",
"-",
"appropriate",
"zero",
"-",
"value",
"is",
"returned",
"instead",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/sl/helpers.go#L68-L83 |
6,870 | softlayer/softlayer-go | sl/helpers.go | GetOk | func GetOk(p interface{}) (interface{}, bool) {
t := reflect.TypeOf(p)
// if p is a non-pointer, just return it
if t.Kind() != reflect.Ptr {
return p, true
}
// p is a pointer. If non-nil, return the value pointed to
v := reflect.Indirect(reflect.ValueOf(p))
if v.IsValid() {
return v.Interface(), true
}
// p is a nil pointer. Return the zero value for the pointed-to type
return reflect.Zero(t.Elem()).Interface(), false
} | go | func GetOk(p interface{}) (interface{}, bool) {
t := reflect.TypeOf(p)
// if p is a non-pointer, just return it
if t.Kind() != reflect.Ptr {
return p, true
}
// p is a pointer. If non-nil, return the value pointed to
v := reflect.Indirect(reflect.ValueOf(p))
if v.IsValid() {
return v.Interface(), true
}
// p is a nil pointer. Return the zero value for the pointed-to type
return reflect.Zero(t.Elem()).Interface(), false
} | [
"func",
"GetOk",
"(",
"p",
"interface",
"{",
"}",
")",
"(",
"interface",
"{",
"}",
",",
"bool",
")",
"{",
"t",
":=",
"reflect",
".",
"TypeOf",
"(",
"p",
")",
"\n\n",
"// if p is a non-pointer, just return it",
"if",
"t",
".",
"Kind",
"(",
")",
"!=",
"reflect",
".",
"Ptr",
"{",
"return",
"p",
",",
"true",
"\n",
"}",
"\n\n",
"// p is a pointer. If non-nil, return the value pointed to",
"v",
":=",
"reflect",
".",
"Indirect",
"(",
"reflect",
".",
"ValueOf",
"(",
"p",
")",
")",
"\n",
"if",
"v",
".",
"IsValid",
"(",
")",
"{",
"return",
"v",
".",
"Interface",
"(",
")",
",",
"true",
"\n",
"}",
"\n\n",
"// p is a nil pointer. Return the zero value for the pointed-to type",
"return",
"reflect",
".",
"Zero",
"(",
"t",
".",
"Elem",
"(",
")",
")",
".",
"Interface",
"(",
")",
",",
"false",
"\n",
"}"
] | // GetOk returns the value of p, either p itself, or, if p is a pointer, the
// value that p points to. If p is nil, a type-appropriate zero-value is
// returned instead. If p is a value or non-nil pointer, the second return
// value will be true. Otherwise, it will be false. | [
"GetOk",
"returns",
"the",
"value",
"of",
"p",
"either",
"p",
"itself",
"or",
"if",
"p",
"is",
"a",
"pointer",
"the",
"value",
"that",
"p",
"points",
"to",
".",
"If",
"p",
"is",
"nil",
"a",
"type",
"-",
"appropriate",
"zero",
"-",
"value",
"is",
"returned",
"instead",
".",
"If",
"p",
"is",
"a",
"value",
"or",
"non",
"-",
"nil",
"pointer",
"the",
"second",
"return",
"value",
"will",
"be",
"true",
".",
"Otherwise",
"it",
"will",
"be",
"false",
"."
] | aa510384a41b6450fa6a50e943ed32f5e838fada | https://github.com/softlayer/softlayer-go/blob/aa510384a41b6450fa6a50e943ed32f5e838fada/sl/helpers.go#L89-L105 |
6,871 | hectane/go-acl | chmod.go | Chmod | func Chmod(name string, mode os.FileMode) error {
// https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems
creatorOwnerSID, err := windows.StringToSid("S-1-3-0")
if err != nil {
return err
}
creatorGroupSID, err := windows.StringToSid("S-1-3-1")
if err != nil {
return err
}
everyoneSID, err := windows.StringToSid("S-1-1-0")
if err != nil {
return err
}
return Apply(
name,
true,
false,
GrantSid((uint32(mode)&0700)<<23, creatorOwnerSID),
GrantSid((uint32(mode)&0070)<<26, creatorGroupSID),
GrantSid((uint32(mode)&0007)<<29, everyoneSID),
)
} | go | func Chmod(name string, mode os.FileMode) error {
// https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems
creatorOwnerSID, err := windows.StringToSid("S-1-3-0")
if err != nil {
return err
}
creatorGroupSID, err := windows.StringToSid("S-1-3-1")
if err != nil {
return err
}
everyoneSID, err := windows.StringToSid("S-1-1-0")
if err != nil {
return err
}
return Apply(
name,
true,
false,
GrantSid((uint32(mode)&0700)<<23, creatorOwnerSID),
GrantSid((uint32(mode)&0070)<<26, creatorGroupSID),
GrantSid((uint32(mode)&0007)<<29, everyoneSID),
)
} | [
"func",
"Chmod",
"(",
"name",
"string",
",",
"mode",
"os",
".",
"FileMode",
")",
"error",
"{",
"// https://support.microsoft.com/en-us/help/243330/well-known-security-identifiers-in-windows-operating-systems",
"creatorOwnerSID",
",",
"err",
":=",
"windows",
".",
"StringToSid",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"creatorGroupSID",
",",
"err",
":=",
"windows",
".",
"StringToSid",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"everyoneSID",
",",
"err",
":=",
"windows",
".",
"StringToSid",
"(",
"\"",
"\"",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"Apply",
"(",
"name",
",",
"true",
",",
"false",
",",
"GrantSid",
"(",
"(",
"uint32",
"(",
"mode",
")",
"&",
"0700",
")",
"<<",
"23",
",",
"creatorOwnerSID",
")",
",",
"GrantSid",
"(",
"(",
"uint32",
"(",
"mode",
")",
"&",
"0070",
")",
"<<",
"26",
",",
"creatorGroupSID",
")",
",",
"GrantSid",
"(",
"(",
"uint32",
"(",
"mode",
")",
"&",
"0007",
")",
"<<",
"29",
",",
"everyoneSID",
")",
",",
")",
"\n",
"}"
] | // Change the permissions of the specified file. Only the nine
// least-significant bytes are used, allowing access by the file's owner, the
// file's group, and everyone else to be explicitly controlled. | [
"Change",
"the",
"permissions",
"of",
"the",
"specified",
"file",
".",
"Only",
"the",
"nine",
"least",
"-",
"significant",
"bytes",
"are",
"used",
"allowing",
"access",
"by",
"the",
"file",
"s",
"owner",
"the",
"file",
"s",
"group",
"and",
"everyone",
"else",
"to",
"be",
"explicitly",
"controlled",
"."
] | e28f47eff0c447e859f6c95bf830678734822412 | https://github.com/hectane/go-acl/blob/e28f47eff0c447e859f6c95bf830678734822412/chmod.go#L12-L35 |
6,872 | hectane/go-acl | util.go | GrantSid | func GrantSid(accessPermissions uint32, sid *windows.SID) api.ExplicitAccess {
return api.ExplicitAccess{
AccessPermissions: accessPermissions,
AccessMode: api.GRANT_ACCESS,
Inheritance: api.SUB_CONTAINERS_AND_OBJECTS_INHERIT,
Trustee: api.Trustee{
TrusteeForm: api.TRUSTEE_IS_SID,
Name: (*uint16)(unsafe.Pointer(sid)),
},
}
} | go | func GrantSid(accessPermissions uint32, sid *windows.SID) api.ExplicitAccess {
return api.ExplicitAccess{
AccessPermissions: accessPermissions,
AccessMode: api.GRANT_ACCESS,
Inheritance: api.SUB_CONTAINERS_AND_OBJECTS_INHERIT,
Trustee: api.Trustee{
TrusteeForm: api.TRUSTEE_IS_SID,
Name: (*uint16)(unsafe.Pointer(sid)),
},
}
} | [
"func",
"GrantSid",
"(",
"accessPermissions",
"uint32",
",",
"sid",
"*",
"windows",
".",
"SID",
")",
"api",
".",
"ExplicitAccess",
"{",
"return",
"api",
".",
"ExplicitAccess",
"{",
"AccessPermissions",
":",
"accessPermissions",
",",
"AccessMode",
":",
"api",
".",
"GRANT_ACCESS",
",",
"Inheritance",
":",
"api",
".",
"SUB_CONTAINERS_AND_OBJECTS_INHERIT",
",",
"Trustee",
":",
"api",
".",
"Trustee",
"{",
"TrusteeForm",
":",
"api",
".",
"TRUSTEE_IS_SID",
",",
"Name",
":",
"(",
"*",
"uint16",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"sid",
")",
")",
",",
"}",
",",
"}",
"\n",
"}"
] | // Create an ExplicitAccess instance granting permissions to the provided SID. | [
"Create",
"an",
"ExplicitAccess",
"instance",
"granting",
"permissions",
"to",
"the",
"provided",
"SID",
"."
] | e28f47eff0c447e859f6c95bf830678734822412 | https://github.com/hectane/go-acl/blob/e28f47eff0c447e859f6c95bf830678734822412/util.go#L11-L21 |
6,873 | hectane/go-acl | util.go | GrantName | func GrantName(accessPermissions uint32, name string) api.ExplicitAccess {
return api.ExplicitAccess{
AccessPermissions: accessPermissions,
AccessMode: api.GRANT_ACCESS,
Inheritance: api.SUB_CONTAINERS_AND_OBJECTS_INHERIT,
Trustee: api.Trustee{
TrusteeForm: api.TRUSTEE_IS_NAME,
Name: windows.StringToUTF16Ptr(name),
},
}
} | go | func GrantName(accessPermissions uint32, name string) api.ExplicitAccess {
return api.ExplicitAccess{
AccessPermissions: accessPermissions,
AccessMode: api.GRANT_ACCESS,
Inheritance: api.SUB_CONTAINERS_AND_OBJECTS_INHERIT,
Trustee: api.Trustee{
TrusteeForm: api.TRUSTEE_IS_NAME,
Name: windows.StringToUTF16Ptr(name),
},
}
} | [
"func",
"GrantName",
"(",
"accessPermissions",
"uint32",
",",
"name",
"string",
")",
"api",
".",
"ExplicitAccess",
"{",
"return",
"api",
".",
"ExplicitAccess",
"{",
"AccessPermissions",
":",
"accessPermissions",
",",
"AccessMode",
":",
"api",
".",
"GRANT_ACCESS",
",",
"Inheritance",
":",
"api",
".",
"SUB_CONTAINERS_AND_OBJECTS_INHERIT",
",",
"Trustee",
":",
"api",
".",
"Trustee",
"{",
"TrusteeForm",
":",
"api",
".",
"TRUSTEE_IS_NAME",
",",
"Name",
":",
"windows",
".",
"StringToUTF16Ptr",
"(",
"name",
")",
",",
"}",
",",
"}",
"\n",
"}"
] | // Create an ExplicitAccess instance granting permissions to the provided name. | [
"Create",
"an",
"ExplicitAccess",
"instance",
"granting",
"permissions",
"to",
"the",
"provided",
"name",
"."
] | e28f47eff0c447e859f6c95bf830678734822412 | https://github.com/hectane/go-acl/blob/e28f47eff0c447e859f6c95bf830678734822412/util.go#L24-L34 |
6,874 | hectane/go-acl | apply.go | Apply | func Apply(name string, replace, inherit bool, entries ...api.ExplicitAccess) error {
var oldAcl windows.Handle
if !replace {
var secDesc windows.Handle
api.GetNamedSecurityInfo(
name,
api.SE_FILE_OBJECT,
api.DACL_SECURITY_INFORMATION,
nil,
nil,
&oldAcl,
nil,
&secDesc,
)
defer windows.LocalFree(secDesc)
}
var acl windows.Handle
if err := api.SetEntriesInAcl(
entries,
oldAcl,
&acl,
); err != nil {
return err
}
defer windows.LocalFree((windows.Handle)(unsafe.Pointer(acl)))
var secInfo uint32
if !inherit {
secInfo = api.PROTECTED_DACL_SECURITY_INFORMATION
} else {
secInfo = api.UNPROTECTED_DACL_SECURITY_INFORMATION
}
return api.SetNamedSecurityInfo(
name,
api.SE_FILE_OBJECT,
api.DACL_SECURITY_INFORMATION|secInfo,
nil,
nil,
acl,
0,
)
} | go | func Apply(name string, replace, inherit bool, entries ...api.ExplicitAccess) error {
var oldAcl windows.Handle
if !replace {
var secDesc windows.Handle
api.GetNamedSecurityInfo(
name,
api.SE_FILE_OBJECT,
api.DACL_SECURITY_INFORMATION,
nil,
nil,
&oldAcl,
nil,
&secDesc,
)
defer windows.LocalFree(secDesc)
}
var acl windows.Handle
if err := api.SetEntriesInAcl(
entries,
oldAcl,
&acl,
); err != nil {
return err
}
defer windows.LocalFree((windows.Handle)(unsafe.Pointer(acl)))
var secInfo uint32
if !inherit {
secInfo = api.PROTECTED_DACL_SECURITY_INFORMATION
} else {
secInfo = api.UNPROTECTED_DACL_SECURITY_INFORMATION
}
return api.SetNamedSecurityInfo(
name,
api.SE_FILE_OBJECT,
api.DACL_SECURITY_INFORMATION|secInfo,
nil,
nil,
acl,
0,
)
} | [
"func",
"Apply",
"(",
"name",
"string",
",",
"replace",
",",
"inherit",
"bool",
",",
"entries",
"...",
"api",
".",
"ExplicitAccess",
")",
"error",
"{",
"var",
"oldAcl",
"windows",
".",
"Handle",
"\n",
"if",
"!",
"replace",
"{",
"var",
"secDesc",
"windows",
".",
"Handle",
"\n",
"api",
".",
"GetNamedSecurityInfo",
"(",
"name",
",",
"api",
".",
"SE_FILE_OBJECT",
",",
"api",
".",
"DACL_SECURITY_INFORMATION",
",",
"nil",
",",
"nil",
",",
"&",
"oldAcl",
",",
"nil",
",",
"&",
"secDesc",
",",
")",
"\n",
"defer",
"windows",
".",
"LocalFree",
"(",
"secDesc",
")",
"\n",
"}",
"\n",
"var",
"acl",
"windows",
".",
"Handle",
"\n",
"if",
"err",
":=",
"api",
".",
"SetEntriesInAcl",
"(",
"entries",
",",
"oldAcl",
",",
"&",
"acl",
",",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"windows",
".",
"LocalFree",
"(",
"(",
"windows",
".",
"Handle",
")",
"(",
"unsafe",
".",
"Pointer",
"(",
"acl",
")",
")",
")",
"\n",
"var",
"secInfo",
"uint32",
"\n",
"if",
"!",
"inherit",
"{",
"secInfo",
"=",
"api",
".",
"PROTECTED_DACL_SECURITY_INFORMATION",
"\n",
"}",
"else",
"{",
"secInfo",
"=",
"api",
".",
"UNPROTECTED_DACL_SECURITY_INFORMATION",
"\n",
"}",
"\n",
"return",
"api",
".",
"SetNamedSecurityInfo",
"(",
"name",
",",
"api",
".",
"SE_FILE_OBJECT",
",",
"api",
".",
"DACL_SECURITY_INFORMATION",
"|",
"secInfo",
",",
"nil",
",",
"nil",
",",
"acl",
",",
"0",
",",
")",
"\n",
"}"
] | // Apply the provided access control entries to a file. If the replace
// parameter is true, existing entries will be overwritten. If the inherit
// parameter is true, the file will inherit ACEs from its parent. | [
"Apply",
"the",
"provided",
"access",
"control",
"entries",
"to",
"a",
"file",
".",
"If",
"the",
"replace",
"parameter",
"is",
"true",
"existing",
"entries",
"will",
"be",
"overwritten",
".",
"If",
"the",
"inherit",
"parameter",
"is",
"true",
"the",
"file",
"will",
"inherit",
"ACEs",
"from",
"its",
"parent",
"."
] | e28f47eff0c447e859f6c95bf830678734822412 | https://github.com/hectane/go-acl/blob/e28f47eff0c447e859f6c95bf830678734822412/apply.go#L13-L53 |
6,875 | felixge/tcpkeepalive | keepalive.go | SetKeepAliveCount | func (c *Conn) SetKeepAliveCount(n int) error {
return setCount(c.fd, n)
} | go | func (c *Conn) SetKeepAliveCount(n int) error {
return setCount(c.fd, n)
} | [
"func",
"(",
"c",
"*",
"Conn",
")",
"SetKeepAliveCount",
"(",
"n",
"int",
")",
"error",
"{",
"return",
"setCount",
"(",
"c",
".",
"fd",
",",
"n",
")",
"\n",
"}"
] | // SetKeepAliveCount sets the maximum number of keepalive probes TCP should
// send before dropping the connection. | [
"SetKeepAliveCount",
"sets",
"the",
"maximum",
"number",
"of",
"keepalive",
"probes",
"TCP",
"should",
"send",
"before",
"dropping",
"the",
"connection",
"."
] | 5bb0b2dea91e0de550022159b9571aafc72c08ba | https://github.com/felixge/tcpkeepalive/blob/5bb0b2dea91e0de550022159b9571aafc72c08ba/keepalive.go#L52-L54 |
6,876 | plaid/plaid-go | internal/release/release.go | Main | func Main(args []string) error {
pkgName := "github.com/plaid/plaid-go"
pkg, err := build.Import(pkgName, "", build.FindOnly)
if err != nil {
return err
}
// Open the git repository
logger.Println("Opening", pkgName)
r, err := git.PlainOpen(pkg.Dir)
if err != nil {
return err
}
w, err := r.Worktree()
if err != nil {
return err
}
// Check the git status to make sure the working tree is clean
status, err := w.Status()
if err != nil {
return err
}
if !status.IsClean() {
return fmt.Errorf("working tree contains uncommitted changes, cannot proceed")
}
release, err := validateArguments(args)
if err != nil {
return err
}
newVersion, err := incrementVersion(pkg, release)
if err != nil {
return err
}
if _, err := w.Add("internal"); err != nil {
return err
}
logger.Println("added internal/... to working tree")
if err := commitAndTagRepo(r, w, newVersion); err != nil {
return err
}
return nil
} | go | func Main(args []string) error {
pkgName := "github.com/plaid/plaid-go"
pkg, err := build.Import(pkgName, "", build.FindOnly)
if err != nil {
return err
}
// Open the git repository
logger.Println("Opening", pkgName)
r, err := git.PlainOpen(pkg.Dir)
if err != nil {
return err
}
w, err := r.Worktree()
if err != nil {
return err
}
// Check the git status to make sure the working tree is clean
status, err := w.Status()
if err != nil {
return err
}
if !status.IsClean() {
return fmt.Errorf("working tree contains uncommitted changes, cannot proceed")
}
release, err := validateArguments(args)
if err != nil {
return err
}
newVersion, err := incrementVersion(pkg, release)
if err != nil {
return err
}
if _, err := w.Add("internal"); err != nil {
return err
}
logger.Println("added internal/... to working tree")
if err := commitAndTagRepo(r, w, newVersion); err != nil {
return err
}
return nil
} | [
"func",
"Main",
"(",
"args",
"[",
"]",
"string",
")",
"error",
"{",
"pkgName",
":=",
"\"",
"\"",
"\n",
"pkg",
",",
"err",
":=",
"build",
".",
"Import",
"(",
"pkgName",
",",
"\"",
"\"",
",",
"build",
".",
"FindOnly",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Open the git repository",
"logger",
".",
"Println",
"(",
"\"",
"\"",
",",
"pkgName",
")",
"\n",
"r",
",",
"err",
":=",
"git",
".",
"PlainOpen",
"(",
"pkg",
".",
"Dir",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"w",
",",
"err",
":=",
"r",
".",
"Worktree",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Check the git status to make sure the working tree is clean",
"status",
",",
"err",
":=",
"w",
".",
"Status",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"!",
"status",
".",
"IsClean",
"(",
")",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"release",
",",
"err",
":=",
"validateArguments",
"(",
"args",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"newVersion",
",",
"err",
":=",
"incrementVersion",
"(",
"pkg",
",",
"release",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"_",
",",
"err",
":=",
"w",
".",
"Add",
"(",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"logger",
".",
"Println",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"err",
":=",
"commitAndTagRepo",
"(",
"r",
",",
"w",
",",
"newVersion",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // Main is the entry point into the release script | [
"Main",
"is",
"the",
"entry",
"point",
"into",
"the",
"release",
"script"
] | 1109794cef7b985dd9519a6d4439fd4bd4cdd2ea | https://github.com/plaid/plaid-go/blob/1109794cef7b985dd9519a6d4439fd4bd4cdd2ea/internal/release/release.go#L45-L95 |
6,877 | plaid/plaid-go | plaid/plaid.go | NewClient | func NewClient(options ClientOptions) (client *Client, err error) {
if !options.Environment.Valid() {
return nil, errors.New("Invalid environment specified: " + string(options.Environment))
}
if options.HTTPClient == nil {
options.HTTPClient = &http.Client{}
}
return &Client{
clientID: options.ClientID,
secret: options.Secret,
publicKey: options.PublicKey,
environment: options.Environment,
httpClient: options.HTTPClient,
}, nil
} | go | func NewClient(options ClientOptions) (client *Client, err error) {
if !options.Environment.Valid() {
return nil, errors.New("Invalid environment specified: " + string(options.Environment))
}
if options.HTTPClient == nil {
options.HTTPClient = &http.Client{}
}
return &Client{
clientID: options.ClientID,
secret: options.Secret,
publicKey: options.PublicKey,
environment: options.Environment,
httpClient: options.HTTPClient,
}, nil
} | [
"func",
"NewClient",
"(",
"options",
"ClientOptions",
")",
"(",
"client",
"*",
"Client",
",",
"err",
"error",
")",
"{",
"if",
"!",
"options",
".",
"Environment",
".",
"Valid",
"(",
")",
"{",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
"+",
"string",
"(",
"options",
".",
"Environment",
")",
")",
"\n",
"}",
"\n\n",
"if",
"options",
".",
"HTTPClient",
"==",
"nil",
"{",
"options",
".",
"HTTPClient",
"=",
"&",
"http",
".",
"Client",
"{",
"}",
"\n",
"}",
"\n\n",
"return",
"&",
"Client",
"{",
"clientID",
":",
"options",
".",
"ClientID",
",",
"secret",
":",
"options",
".",
"Secret",
",",
"publicKey",
":",
"options",
".",
"PublicKey",
",",
"environment",
":",
"options",
".",
"Environment",
",",
"httpClient",
":",
"options",
".",
"HTTPClient",
",",
"}",
",",
"nil",
"\n",
"}"
] | // NewClient instantiates a Client associated with a client id, secret and environment. | [
"NewClient",
"instantiates",
"a",
"Client",
"associated",
"with",
"a",
"client",
"id",
"secret",
"and",
"environment",
"."
] | 1109794cef7b985dd9519a6d4439fd4bd4cdd2ea | https://github.com/plaid/plaid-go/blob/1109794cef7b985dd9519a6d4439fd4bd4cdd2ea/plaid/plaid.go#L40-L56 |
6,878 | plaid/plaid-go | plaid/plaid.go | newRequest | func (c *Client) newRequest(endpoint string, body io.Reader, v interface{}) (*http.Request, error) {
if !strings.HasPrefix(endpoint, "/") {
endpoint = "/" + endpoint
}
req, err := http.NewRequest("POST", "https://"+string(c.environment)+endpoint, body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("User-Agent", "Plaid Go v"+internal.Version)
// Add header for Plaid API version
req.Header.Add("Plaid-Version", APIVersion)
return req, nil
} | go | func (c *Client) newRequest(endpoint string, body io.Reader, v interface{}) (*http.Request, error) {
if !strings.HasPrefix(endpoint, "/") {
endpoint = "/" + endpoint
}
req, err := http.NewRequest("POST", "https://"+string(c.environment)+endpoint, body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("User-Agent", "Plaid Go v"+internal.Version)
// Add header for Plaid API version
req.Header.Add("Plaid-Version", APIVersion)
return req, nil
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"newRequest",
"(",
"endpoint",
"string",
",",
"body",
"io",
".",
"Reader",
",",
"v",
"interface",
"{",
"}",
")",
"(",
"*",
"http",
".",
"Request",
",",
"error",
")",
"{",
"if",
"!",
"strings",
".",
"HasPrefix",
"(",
"endpoint",
",",
"\"",
"\"",
")",
"{",
"endpoint",
"=",
"\"",
"\"",
"+",
"endpoint",
"\n",
"}",
"\n\n",
"req",
",",
"err",
":=",
"http",
".",
"NewRequest",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"string",
"(",
"c",
".",
"environment",
")",
"+",
"endpoint",
",",
"body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"req",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
"\n",
"req",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"\"",
"\"",
"+",
"internal",
".",
"Version",
")",
"\n\n",
"// Add header for Plaid API version",
"req",
".",
"Header",
".",
"Add",
"(",
"\"",
"\"",
",",
"APIVersion",
")",
"\n\n",
"return",
"req",
",",
"nil",
"\n",
"}"
] | // newRequest is used by Call to generate a http.Request with appropriate headers. | [
"newRequest",
"is",
"used",
"by",
"Call",
"to",
"generate",
"a",
"http",
".",
"Request",
"with",
"appropriate",
"headers",
"."
] | 1109794cef7b985dd9519a6d4439fd4bd4cdd2ea | https://github.com/plaid/plaid-go/blob/1109794cef7b985dd9519a6d4439fd4bd4cdd2ea/plaid/plaid.go#L68-L85 |
6,879 | plaid/plaid-go | plaid/plaid.go | do | func (c *Client) do(req *http.Request, v interface{}) error {
res, err := c.httpClient.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
return err
}
// Successful response
if res.StatusCode == 200 {
return json.Unmarshal(resBody, v)
}
// Attempt to unmarshal into Plaid error format
var plaidErr Error
if err = json.Unmarshal(resBody, &plaidErr); err != nil {
return err
}
plaidErr.StatusCode = res.StatusCode
return plaidErr
} | go | func (c *Client) do(req *http.Request, v interface{}) error {
res, err := c.httpClient.Do(req)
if err != nil {
return err
}
defer res.Body.Close()
resBody, err := ioutil.ReadAll(res.Body)
if err != nil {
return err
}
// Successful response
if res.StatusCode == 200 {
return json.Unmarshal(resBody, v)
}
// Attempt to unmarshal into Plaid error format
var plaidErr Error
if err = json.Unmarshal(resBody, &plaidErr); err != nil {
return err
}
plaidErr.StatusCode = res.StatusCode
return plaidErr
} | [
"func",
"(",
"c",
"*",
"Client",
")",
"do",
"(",
"req",
"*",
"http",
".",
"Request",
",",
"v",
"interface",
"{",
"}",
")",
"error",
"{",
"res",
",",
"err",
":=",
"c",
".",
"httpClient",
".",
"Do",
"(",
"req",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"defer",
"res",
".",
"Body",
".",
"Close",
"(",
")",
"\n\n",
"resBody",
",",
"err",
":=",
"ioutil",
".",
"ReadAll",
"(",
"res",
".",
"Body",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// Successful response",
"if",
"res",
".",
"StatusCode",
"==",
"200",
"{",
"return",
"json",
".",
"Unmarshal",
"(",
"resBody",
",",
"v",
")",
"\n",
"}",
"\n\n",
"// Attempt to unmarshal into Plaid error format",
"var",
"plaidErr",
"Error",
"\n",
"if",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"resBody",
",",
"&",
"plaidErr",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"plaidErr",
".",
"StatusCode",
"=",
"res",
".",
"StatusCode",
"\n",
"return",
"plaidErr",
"\n",
"}"
] | // do is used by Call to execute an http.Request and parse its response.
// Also handles parsing of the plaid error format. | [
"do",
"is",
"used",
"by",
"Call",
"to",
"execute",
"an",
"http",
".",
"Request",
"and",
"parse",
"its",
"response",
".",
"Also",
"handles",
"parsing",
"of",
"the",
"plaid",
"error",
"format",
"."
] | 1109794cef7b985dd9519a6d4439fd4bd4cdd2ea | https://github.com/plaid/plaid-go/blob/1109794cef7b985dd9519a6d4439fd4bd4cdd2ea/plaid/plaid.go#L89-L114 |
6,880 | colinmarc/cdb | cdb.go | Open | func Open(path string) (*CDB, error) {
f, err := os.Open(path)
if err != nil {
return nil, err
}
return New(f, nil)
} | go | func Open(path string) (*CDB, error) {
f, err := os.Open(path)
if err != nil {
return nil, err
}
return New(f, nil)
} | [
"func",
"Open",
"(",
"path",
"string",
")",
"(",
"*",
"CDB",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Open",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"New",
"(",
"f",
",",
"nil",
")",
"\n",
"}"
] | // Open opens an existing CDB database at the given path. | [
"Open",
"opens",
"an",
"existing",
"CDB",
"database",
"at",
"the",
"given",
"path",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/cdb.go#L34-L41 |
6,881 | colinmarc/cdb | cdb.go | New | func New(reader io.ReaderAt, hash func([]byte) uint32) (*CDB, error) {
if hash == nil {
hash = cdbHash
}
cdb := &CDB{reader: reader, hash: hash}
err := cdb.readIndex()
if err != nil {
return nil, err
}
return cdb, nil
} | go | func New(reader io.ReaderAt, hash func([]byte) uint32) (*CDB, error) {
if hash == nil {
hash = cdbHash
}
cdb := &CDB{reader: reader, hash: hash}
err := cdb.readIndex()
if err != nil {
return nil, err
}
return cdb, nil
} | [
"func",
"New",
"(",
"reader",
"io",
".",
"ReaderAt",
",",
"hash",
"func",
"(",
"[",
"]",
"byte",
")",
"uint32",
")",
"(",
"*",
"CDB",
",",
"error",
")",
"{",
"if",
"hash",
"==",
"nil",
"{",
"hash",
"=",
"cdbHash",
"\n",
"}",
"\n\n",
"cdb",
":=",
"&",
"CDB",
"{",
"reader",
":",
"reader",
",",
"hash",
":",
"hash",
"}",
"\n",
"err",
":=",
"cdb",
".",
"readIndex",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"cdb",
",",
"nil",
"\n",
"}"
] | // New opens a new CDB instance for the given io.ReaderAt. It can only be used
// for reads; to create a database, use Writer. The returned CDB instance is
// thread-safe as long as reader is.
//
// If hash is nil, it will default to the CDB hash function. If a database
// was created with a particular hash function, that same hash function must be
// passed to New, or the database will return incorrect results. | [
"New",
"opens",
"a",
"new",
"CDB",
"instance",
"for",
"the",
"given",
"io",
".",
"ReaderAt",
".",
"It",
"can",
"only",
"be",
"used",
"for",
"reads",
";",
"to",
"create",
"a",
"database",
"use",
"Writer",
".",
"The",
"returned",
"CDB",
"instance",
"is",
"thread",
"-",
"safe",
"as",
"long",
"as",
"reader",
"is",
".",
"If",
"hash",
"is",
"nil",
"it",
"will",
"default",
"to",
"the",
"CDB",
"hash",
"function",
".",
"If",
"a",
"database",
"was",
"created",
"with",
"a",
"particular",
"hash",
"function",
"that",
"same",
"hash",
"function",
"must",
"be",
"passed",
"to",
"New",
"or",
"the",
"database",
"will",
"return",
"incorrect",
"results",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/cdb.go#L50-L62 |
6,882 | colinmarc/cdb | cdb.go | Get | func (cdb *CDB) Get(key []byte) ([]byte, error) {
hash := cdb.hash(key)
table := cdb.index[hash&0xff]
if table.length == 0 {
return nil, nil
}
// Probe the given hash table, starting at the given slot.
startingSlot := (hash >> 8) % table.length
slot := startingSlot
for {
slotOffset := table.offset + (8 * slot)
slotHash, offset, err := readTuple(cdb.reader, slotOffset)
if err != nil {
return nil, err
}
// An empty slot means the key doesn't exist.
if slotHash == 0 {
break
} else if slotHash == hash {
value, err := cdb.getValueAt(offset, key)
if err != nil {
return nil, err
} else if value != nil {
return value, nil
}
}
slot = (slot + 1) % table.length
if slot == startingSlot {
break
}
}
return nil, nil
} | go | func (cdb *CDB) Get(key []byte) ([]byte, error) {
hash := cdb.hash(key)
table := cdb.index[hash&0xff]
if table.length == 0 {
return nil, nil
}
// Probe the given hash table, starting at the given slot.
startingSlot := (hash >> 8) % table.length
slot := startingSlot
for {
slotOffset := table.offset + (8 * slot)
slotHash, offset, err := readTuple(cdb.reader, slotOffset)
if err != nil {
return nil, err
}
// An empty slot means the key doesn't exist.
if slotHash == 0 {
break
} else if slotHash == hash {
value, err := cdb.getValueAt(offset, key)
if err != nil {
return nil, err
} else if value != nil {
return value, nil
}
}
slot = (slot + 1) % table.length
if slot == startingSlot {
break
}
}
return nil, nil
} | [
"func",
"(",
"cdb",
"*",
"CDB",
")",
"Get",
"(",
"key",
"[",
"]",
"byte",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"hash",
":=",
"cdb",
".",
"hash",
"(",
"key",
")",
"\n\n",
"table",
":=",
"cdb",
".",
"index",
"[",
"hash",
"&",
"0xff",
"]",
"\n",
"if",
"table",
".",
"length",
"==",
"0",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n\n",
"// Probe the given hash table, starting at the given slot.",
"startingSlot",
":=",
"(",
"hash",
">>",
"8",
")",
"%",
"table",
".",
"length",
"\n",
"slot",
":=",
"startingSlot",
"\n\n",
"for",
"{",
"slotOffset",
":=",
"table",
".",
"offset",
"+",
"(",
"8",
"*",
"slot",
")",
"\n",
"slotHash",
",",
"offset",
",",
"err",
":=",
"readTuple",
"(",
"cdb",
".",
"reader",
",",
"slotOffset",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// An empty slot means the key doesn't exist.",
"if",
"slotHash",
"==",
"0",
"{",
"break",
"\n",
"}",
"else",
"if",
"slotHash",
"==",
"hash",
"{",
"value",
",",
"err",
":=",
"cdb",
".",
"getValueAt",
"(",
"offset",
",",
"key",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"else",
"if",
"value",
"!=",
"nil",
"{",
"return",
"value",
",",
"nil",
"\n",
"}",
"\n",
"}",
"\n\n",
"slot",
"=",
"(",
"slot",
"+",
"1",
")",
"%",
"table",
".",
"length",
"\n",
"if",
"slot",
"==",
"startingSlot",
"{",
"break",
"\n",
"}",
"\n",
"}",
"\n\n",
"return",
"nil",
",",
"nil",
"\n",
"}"
] | // Get returns the value for a given key, or nil if it can't be found. | [
"Get",
"returns",
"the",
"value",
"for",
"a",
"given",
"key",
"or",
"nil",
"if",
"it",
"can",
"t",
"be",
"found",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/cdb.go#L65-L103 |
6,883 | colinmarc/cdb | cdb.go | Close | func (cdb *CDB) Close() error {
if closer, ok := cdb.reader.(io.Closer); ok {
return closer.Close()
} else {
return nil
}
} | go | func (cdb *CDB) Close() error {
if closer, ok := cdb.reader.(io.Closer); ok {
return closer.Close()
} else {
return nil
}
} | [
"func",
"(",
"cdb",
"*",
"CDB",
")",
"Close",
"(",
")",
"error",
"{",
"if",
"closer",
",",
"ok",
":=",
"cdb",
".",
"reader",
".",
"(",
"io",
".",
"Closer",
")",
";",
"ok",
"{",
"return",
"closer",
".",
"Close",
"(",
")",
"\n",
"}",
"else",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] | // Close closes the database to further reads. | [
"Close",
"closes",
"the",
"database",
"to",
"further",
"reads",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/cdb.go#L106-L112 |
6,884 | colinmarc/cdb | writer.go | Create | func Create(path string) (*Writer, error) {
f, err := os.Create(path)
if err != nil {
return nil, err
}
return NewWriter(f, nil)
} | go | func Create(path string) (*Writer, error) {
f, err := os.Create(path)
if err != nil {
return nil, err
}
return NewWriter(f, nil)
} | [
"func",
"Create",
"(",
"path",
"string",
")",
"(",
"*",
"Writer",
",",
"error",
")",
"{",
"f",
",",
"err",
":=",
"os",
".",
"Create",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"return",
"NewWriter",
"(",
"f",
",",
"nil",
")",
"\n",
"}"
] | // Create opens a CDB database at the given path. If the file exists, it will
// be overwritten. The returned database is not safe for concurrent writes. | [
"Create",
"opens",
"a",
"CDB",
"database",
"at",
"the",
"given",
"path",
".",
"If",
"the",
"file",
"exists",
"it",
"will",
"be",
"overwritten",
".",
"The",
"returned",
"database",
"is",
"not",
"safe",
"for",
"concurrent",
"writes",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/writer.go#L37-L44 |
6,885 | colinmarc/cdb | writer.go | NewWriter | func NewWriter(writer io.WriteSeeker, hash func([]byte) uint32) (*Writer, error) {
// Leave 256 * 8 bytes for the index at the head of the file.
_, err := writer.Seek(0, os.SEEK_SET)
if err != nil {
return nil, err
}
_, err = writer.Write(make([]byte, indexSize))
if err != nil {
return nil, err
}
if hash == nil {
hash = cdbHash
}
return &Writer{
hash: hash,
writer: writer,
bufferedWriter: bufio.NewWriterSize(writer, 65536),
bufferedOffset: indexSize,
}, nil
} | go | func NewWriter(writer io.WriteSeeker, hash func([]byte) uint32) (*Writer, error) {
// Leave 256 * 8 bytes for the index at the head of the file.
_, err := writer.Seek(0, os.SEEK_SET)
if err != nil {
return nil, err
}
_, err = writer.Write(make([]byte, indexSize))
if err != nil {
return nil, err
}
if hash == nil {
hash = cdbHash
}
return &Writer{
hash: hash,
writer: writer,
bufferedWriter: bufio.NewWriterSize(writer, 65536),
bufferedOffset: indexSize,
}, nil
} | [
"func",
"NewWriter",
"(",
"writer",
"io",
".",
"WriteSeeker",
",",
"hash",
"func",
"(",
"[",
"]",
"byte",
")",
"uint32",
")",
"(",
"*",
"Writer",
",",
"error",
")",
"{",
"// Leave 256 * 8 bytes for the index at the head of the file.",
"_",
",",
"err",
":=",
"writer",
".",
"Seek",
"(",
"0",
",",
"os",
".",
"SEEK_SET",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"_",
",",
"err",
"=",
"writer",
".",
"Write",
"(",
"make",
"(",
"[",
"]",
"byte",
",",
"indexSize",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"hash",
"==",
"nil",
"{",
"hash",
"=",
"cdbHash",
"\n",
"}",
"\n\n",
"return",
"&",
"Writer",
"{",
"hash",
":",
"hash",
",",
"writer",
":",
"writer",
",",
"bufferedWriter",
":",
"bufio",
".",
"NewWriterSize",
"(",
"writer",
",",
"65536",
")",
",",
"bufferedOffset",
":",
"indexSize",
",",
"}",
",",
"nil",
"\n",
"}"
] | // NewWriter opens a CDB database for the given io.WriteSeeker.
//
// If hash is nil, it will default to the CDB hash function. | [
"NewWriter",
"opens",
"a",
"CDB",
"database",
"for",
"the",
"given",
"io",
".",
"WriteSeeker",
".",
"If",
"hash",
"is",
"nil",
"it",
"will",
"default",
"to",
"the",
"CDB",
"hash",
"function",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/writer.go#L49-L71 |
6,886 | colinmarc/cdb | writer.go | Close | func (cdb *Writer) Close() error {
var err error
cdb.finalizeOnce.Do(func() {
_, err = cdb.finalize()
})
if err != nil {
return err
}
if closer, ok := cdb.writer.(io.Closer); ok {
return closer.Close()
} else {
return nil
}
} | go | func (cdb *Writer) Close() error {
var err error
cdb.finalizeOnce.Do(func() {
_, err = cdb.finalize()
})
if err != nil {
return err
}
if closer, ok := cdb.writer.(io.Closer); ok {
return closer.Close()
} else {
return nil
}
} | [
"func",
"(",
"cdb",
"*",
"Writer",
")",
"Close",
"(",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"cdb",
".",
"finalizeOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"_",
",",
"err",
"=",
"cdb",
".",
"finalize",
"(",
")",
"\n",
"}",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"closer",
",",
"ok",
":=",
"cdb",
".",
"writer",
".",
"(",
"io",
".",
"Closer",
")",
";",
"ok",
"{",
"return",
"closer",
".",
"Close",
"(",
")",
"\n",
"}",
"else",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] | // Close finalizes the database, then closes it to further writes.
//
// Close or Freeze must be called to finalize the database, or the resulting
// file will be invalid. | [
"Close",
"finalizes",
"the",
"database",
"then",
"closes",
"it",
"to",
"further",
"writes",
".",
"Close",
"or",
"Freeze",
"must",
"be",
"called",
"to",
"finalize",
"the",
"database",
"or",
"the",
"resulting",
"file",
"will",
"be",
"invalid",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/writer.go#L113-L128 |
6,887 | colinmarc/cdb | writer.go | Freeze | func (cdb *Writer) Freeze() (*CDB, error) {
var err error
var index index
cdb.finalizeOnce.Do(func() {
index, err = cdb.finalize()
})
if err != nil {
return nil, err
}
if readerAt, ok := cdb.writer.(io.ReaderAt); ok {
return &CDB{reader: readerAt, index: index, hash: cdb.hash}, nil
} else {
return nil, os.ErrInvalid
}
} | go | func (cdb *Writer) Freeze() (*CDB, error) {
var err error
var index index
cdb.finalizeOnce.Do(func() {
index, err = cdb.finalize()
})
if err != nil {
return nil, err
}
if readerAt, ok := cdb.writer.(io.ReaderAt); ok {
return &CDB{reader: readerAt, index: index, hash: cdb.hash}, nil
} else {
return nil, os.ErrInvalid
}
} | [
"func",
"(",
"cdb",
"*",
"Writer",
")",
"Freeze",
"(",
")",
"(",
"*",
"CDB",
",",
"error",
")",
"{",
"var",
"err",
"error",
"\n",
"var",
"index",
"index",
"\n",
"cdb",
".",
"finalizeOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"index",
",",
"err",
"=",
"cdb",
".",
"finalize",
"(",
")",
"\n",
"}",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"if",
"readerAt",
",",
"ok",
":=",
"cdb",
".",
"writer",
".",
"(",
"io",
".",
"ReaderAt",
")",
";",
"ok",
"{",
"return",
"&",
"CDB",
"{",
"reader",
":",
"readerAt",
",",
"index",
":",
"index",
",",
"hash",
":",
"cdb",
".",
"hash",
"}",
",",
"nil",
"\n",
"}",
"else",
"{",
"return",
"nil",
",",
"os",
".",
"ErrInvalid",
"\n",
"}",
"\n",
"}"
] | // Freeze finalizes the database, then opens it for reads. If the stream cannot
// be converted to a io.ReaderAt, Freeze will return os.ErrInvalid.
//
// Close or Freeze must be called to finalize the database, or the resulting
// file will be invalid. | [
"Freeze",
"finalizes",
"the",
"database",
"then",
"opens",
"it",
"for",
"reads",
".",
"If",
"the",
"stream",
"cannot",
"be",
"converted",
"to",
"a",
"io",
".",
"ReaderAt",
"Freeze",
"will",
"return",
"os",
".",
"ErrInvalid",
".",
"Close",
"or",
"Freeze",
"must",
"be",
"called",
"to",
"finalize",
"the",
"database",
"or",
"the",
"resulting",
"file",
"will",
"be",
"invalid",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/writer.go#L135-L151 |
6,888 | colinmarc/cdb | iterator.go | Iter | func (cdb *CDB) Iter() *Iterator {
return &Iterator{
db: cdb,
pos: uint32(indexSize),
endPos: cdb.index[0].offset,
}
} | go | func (cdb *CDB) Iter() *Iterator {
return &Iterator{
db: cdb,
pos: uint32(indexSize),
endPos: cdb.index[0].offset,
}
} | [
"func",
"(",
"cdb",
"*",
"CDB",
")",
"Iter",
"(",
")",
"*",
"Iterator",
"{",
"return",
"&",
"Iterator",
"{",
"db",
":",
"cdb",
",",
"pos",
":",
"uint32",
"(",
"indexSize",
")",
",",
"endPos",
":",
"cdb",
".",
"index",
"[",
"0",
"]",
".",
"offset",
",",
"}",
"\n",
"}"
] | // Iter creates an Iterator that can be used to iterate the database. | [
"Iter",
"creates",
"an",
"Iterator",
"that",
"can",
"be",
"used",
"to",
"iterate",
"the",
"database",
"."
] | 60f317823f7076bef6824144d9a1d5467c182928 | https://github.com/colinmarc/cdb/blob/60f317823f7076bef6824144d9a1d5467c182928/iterator.go#L14-L20 |
6,889 | luci/luci-go | gce/appengine/rpc/projects.go | NewProjectsServer | func NewProjectsServer() projects.ProjectsServer {
return &projects.DecoratedProjects{
Prelude: readOnlyAuthPrelude,
Service: &Projects{},
Postlude: gRPCifyAndLogErr,
}
} | go | func NewProjectsServer() projects.ProjectsServer {
return &projects.DecoratedProjects{
Prelude: readOnlyAuthPrelude,
Service: &Projects{},
Postlude: gRPCifyAndLogErr,
}
} | [
"func",
"NewProjectsServer",
"(",
")",
"projects",
".",
"ProjectsServer",
"{",
"return",
"&",
"projects",
".",
"DecoratedProjects",
"{",
"Prelude",
":",
"readOnlyAuthPrelude",
",",
"Service",
":",
"&",
"Projects",
"{",
"}",
",",
"Postlude",
":",
"gRPCifyAndLogErr",
",",
"}",
"\n",
"}"
] | // NewProjectsServer returns a new projects server. | [
"NewProjectsServer",
"returns",
"a",
"new",
"projects",
"server",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/gce/appengine/rpc/projects.go#L101-L107 |
6,890 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | GetSnapshotID | func (si *SnapshotInfo) GetSnapshotID() string {
if strings.IndexByte(si.AuthServiceURL, ',') != -1 {
panic(fmt.Errorf("forbidden symbol ',' in URL %q", si.AuthServiceURL))
}
return fmt.Sprintf("v1,%s,%d", si.AuthServiceURL, si.Rev)
} | go | func (si *SnapshotInfo) GetSnapshotID() string {
if strings.IndexByte(si.AuthServiceURL, ',') != -1 {
panic(fmt.Errorf("forbidden symbol ',' in URL %q", si.AuthServiceURL))
}
return fmt.Sprintf("v1,%s,%d", si.AuthServiceURL, si.Rev)
} | [
"func",
"(",
"si",
"*",
"SnapshotInfo",
")",
"GetSnapshotID",
"(",
")",
"string",
"{",
"if",
"strings",
".",
"IndexByte",
"(",
"si",
".",
"AuthServiceURL",
",",
"','",
")",
"!=",
"-",
"1",
"{",
"panic",
"(",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"si",
".",
"AuthServiceURL",
")",
")",
"\n",
"}",
"\n",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"si",
".",
"AuthServiceURL",
",",
"si",
".",
"Rev",
")",
"\n",
"}"
] | // GetSnapshotID returns datastore ID of the corresponding Snapshot entity. | [
"GetSnapshotID",
"returns",
"datastore",
"ID",
"of",
"the",
"corresponding",
"Snapshot",
"entity",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L46-L51 |
6,891 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | deleteSnapshotInfo | func deleteSnapshotInfo(c context.Context) error {
c = ds.WithoutTransaction(c)
return ds.Delete(c, ds.KeyForObj(c, &SnapshotInfo{}))
} | go | func deleteSnapshotInfo(c context.Context) error {
c = ds.WithoutTransaction(c)
return ds.Delete(c, ds.KeyForObj(c, &SnapshotInfo{}))
} | [
"func",
"deleteSnapshotInfo",
"(",
"c",
"context",
".",
"Context",
")",
"error",
"{",
"c",
"=",
"ds",
".",
"WithoutTransaction",
"(",
"c",
")",
"\n",
"return",
"ds",
".",
"Delete",
"(",
"c",
",",
"ds",
".",
"KeyForObj",
"(",
"c",
",",
"&",
"SnapshotInfo",
"{",
"}",
")",
")",
"\n",
"}"
] | // deleteSnapshotInfo removes SnapshotInfo entity from the datastore.
//
// Used to detach the service from auth_service. | [
"deleteSnapshotInfo",
"removes",
"SnapshotInfo",
"entity",
"from",
"the",
"datastore",
".",
"Used",
"to",
"detach",
"the",
"service",
"from",
"auth_service",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L97-L100 |
6,892 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | GetAuthDBSnapshot | func GetAuthDBSnapshot(c context.Context, id string) (*protocol.AuthDB, error) {
report := durationReporter(c, getSnapshotDuration)
logging.Debugf(c, "Fetching AuthDB snapshot from the datastore")
defer logging.Debugf(c, "AuthDB snapshot fetched")
c = ds.WithoutTransaction(defaultNS(c))
snap := Snapshot{ID: id}
switch err := ds.Get(c, &snap); {
case err == ds.ErrNoSuchEntity:
report("ERROR_NO_SNAPSHOT")
return nil, err // not transient
case err != nil:
report("ERROR_TRANSIENT")
return nil, transient.Tag.Apply(err)
}
db, err := service.InflateAuthDB(snap.AuthDBDeflated)
if err != nil {
report("ERROR_INFLATION")
return nil, err
}
report("SUCCESS")
return db, nil
} | go | func GetAuthDBSnapshot(c context.Context, id string) (*protocol.AuthDB, error) {
report := durationReporter(c, getSnapshotDuration)
logging.Debugf(c, "Fetching AuthDB snapshot from the datastore")
defer logging.Debugf(c, "AuthDB snapshot fetched")
c = ds.WithoutTransaction(defaultNS(c))
snap := Snapshot{ID: id}
switch err := ds.Get(c, &snap); {
case err == ds.ErrNoSuchEntity:
report("ERROR_NO_SNAPSHOT")
return nil, err // not transient
case err != nil:
report("ERROR_TRANSIENT")
return nil, transient.Tag.Apply(err)
}
db, err := service.InflateAuthDB(snap.AuthDBDeflated)
if err != nil {
report("ERROR_INFLATION")
return nil, err
}
report("SUCCESS")
return db, nil
} | [
"func",
"GetAuthDBSnapshot",
"(",
"c",
"context",
".",
"Context",
",",
"id",
"string",
")",
"(",
"*",
"protocol",
".",
"AuthDB",
",",
"error",
")",
"{",
"report",
":=",
"durationReporter",
"(",
"c",
",",
"getSnapshotDuration",
")",
"\n",
"logging",
".",
"Debugf",
"(",
"c",
",",
"\"",
"\"",
")",
"\n",
"defer",
"logging",
".",
"Debugf",
"(",
"c",
",",
"\"",
"\"",
")",
"\n\n",
"c",
"=",
"ds",
".",
"WithoutTransaction",
"(",
"defaultNS",
"(",
"c",
")",
")",
"\n",
"snap",
":=",
"Snapshot",
"{",
"ID",
":",
"id",
"}",
"\n",
"switch",
"err",
":=",
"ds",
".",
"Get",
"(",
"c",
",",
"&",
"snap",
")",
";",
"{",
"case",
"err",
"==",
"ds",
".",
"ErrNoSuchEntity",
":",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"// not transient",
"\n",
"case",
"err",
"!=",
"nil",
":",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"transient",
".",
"Tag",
".",
"Apply",
"(",
"err",
")",
"\n",
"}",
"\n\n",
"db",
",",
"err",
":=",
"service",
".",
"InflateAuthDB",
"(",
"snap",
".",
"AuthDBDeflated",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"db",
",",
"nil",
"\n",
"}"
] | // GetAuthDBSnapshot fetches, inflates and deserializes AuthDB snapshot. | [
"GetAuthDBSnapshot",
"fetches",
"inflates",
"and",
"deserializes",
"AuthDB",
"snapshot",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L103-L127 |
6,893 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | ConfigureAuthService | func ConfigureAuthService(c context.Context, baseURL, authServiceURL string) error {
logging.Infof(c, "Reconfiguring AuthDB to be fetched from %q", authServiceURL)
c = defaultNS(c)
// If switching auth services, need to grab URL of a currently configured
// auth service to unsubscribe from its PubSub stream.
prevAuthServiceURL := ""
switch existing, err := GetLatestSnapshotInfo(c); {
case err != nil:
return err
case existing != nil:
prevAuthServiceURL = existing.AuthServiceURL
}
// Stopping synchronization completely?
if authServiceURL == "" {
if prevAuthServiceURL != "" {
if err := killPubSub(c, prevAuthServiceURL); err != nil {
return err
}
}
return deleteSnapshotInfo(c)
}
// Fetch latest AuthDB snapshot and store it in the datastore, thus verifying
// authServiceURL works end-to-end.
srv := getAuthService(c, authServiceURL)
latestRev, err := srv.GetLatestSnapshotRevision(c)
if err != nil {
return err
}
info := &SnapshotInfo{
AuthServiceURL: authServiceURL,
Rev: latestRev,
}
if err := fetchSnapshot(c, info); err != nil {
logging.Errorf(c, "Failed to fetch latest snapshot from %s - %s", authServiceURL, err)
return err
}
// Configure PubSub subscription to receive future updates.
if err := setupPubSub(c, baseURL, authServiceURL); err != nil {
logging.Errorf(c, "Failed to configure pubsub subscription - %s", err)
return err
}
// All is configured. Switch SnapshotInfo entity to point to new snapshot.
// It makes syncAuthDB fetch changes from `authServiceURL`, thus promoting
// `authServiceURL` to the status of main auth service.
if err := ds.Put(ds.WithoutTransaction(c), info); err != nil {
return transient.Tag.Apply(err)
}
// Stop getting notifications from previously used auth service.
if prevAuthServiceURL != "" && prevAuthServiceURL != authServiceURL {
return killPubSub(c, prevAuthServiceURL)
}
return nil
} | go | func ConfigureAuthService(c context.Context, baseURL, authServiceURL string) error {
logging.Infof(c, "Reconfiguring AuthDB to be fetched from %q", authServiceURL)
c = defaultNS(c)
// If switching auth services, need to grab URL of a currently configured
// auth service to unsubscribe from its PubSub stream.
prevAuthServiceURL := ""
switch existing, err := GetLatestSnapshotInfo(c); {
case err != nil:
return err
case existing != nil:
prevAuthServiceURL = existing.AuthServiceURL
}
// Stopping synchronization completely?
if authServiceURL == "" {
if prevAuthServiceURL != "" {
if err := killPubSub(c, prevAuthServiceURL); err != nil {
return err
}
}
return deleteSnapshotInfo(c)
}
// Fetch latest AuthDB snapshot and store it in the datastore, thus verifying
// authServiceURL works end-to-end.
srv := getAuthService(c, authServiceURL)
latestRev, err := srv.GetLatestSnapshotRevision(c)
if err != nil {
return err
}
info := &SnapshotInfo{
AuthServiceURL: authServiceURL,
Rev: latestRev,
}
if err := fetchSnapshot(c, info); err != nil {
logging.Errorf(c, "Failed to fetch latest snapshot from %s - %s", authServiceURL, err)
return err
}
// Configure PubSub subscription to receive future updates.
if err := setupPubSub(c, baseURL, authServiceURL); err != nil {
logging.Errorf(c, "Failed to configure pubsub subscription - %s", err)
return err
}
// All is configured. Switch SnapshotInfo entity to point to new snapshot.
// It makes syncAuthDB fetch changes from `authServiceURL`, thus promoting
// `authServiceURL` to the status of main auth service.
if err := ds.Put(ds.WithoutTransaction(c), info); err != nil {
return transient.Tag.Apply(err)
}
// Stop getting notifications from previously used auth service.
if prevAuthServiceURL != "" && prevAuthServiceURL != authServiceURL {
return killPubSub(c, prevAuthServiceURL)
}
return nil
} | [
"func",
"ConfigureAuthService",
"(",
"c",
"context",
".",
"Context",
",",
"baseURL",
",",
"authServiceURL",
"string",
")",
"error",
"{",
"logging",
".",
"Infof",
"(",
"c",
",",
"\"",
"\"",
",",
"authServiceURL",
")",
"\n",
"c",
"=",
"defaultNS",
"(",
"c",
")",
"\n\n",
"// If switching auth services, need to grab URL of a currently configured",
"// auth service to unsubscribe from its PubSub stream.",
"prevAuthServiceURL",
":=",
"\"",
"\"",
"\n",
"switch",
"existing",
",",
"err",
":=",
"GetLatestSnapshotInfo",
"(",
"c",
")",
";",
"{",
"case",
"err",
"!=",
"nil",
":",
"return",
"err",
"\n",
"case",
"existing",
"!=",
"nil",
":",
"prevAuthServiceURL",
"=",
"existing",
".",
"AuthServiceURL",
"\n",
"}",
"\n\n",
"// Stopping synchronization completely?",
"if",
"authServiceURL",
"==",
"\"",
"\"",
"{",
"if",
"prevAuthServiceURL",
"!=",
"\"",
"\"",
"{",
"if",
"err",
":=",
"killPubSub",
"(",
"c",
",",
"prevAuthServiceURL",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"}",
"\n",
"return",
"deleteSnapshotInfo",
"(",
"c",
")",
"\n",
"}",
"\n\n",
"// Fetch latest AuthDB snapshot and store it in the datastore, thus verifying",
"// authServiceURL works end-to-end.",
"srv",
":=",
"getAuthService",
"(",
"c",
",",
"authServiceURL",
")",
"\n",
"latestRev",
",",
"err",
":=",
"srv",
".",
"GetLatestSnapshotRevision",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"info",
":=",
"&",
"SnapshotInfo",
"{",
"AuthServiceURL",
":",
"authServiceURL",
",",
"Rev",
":",
"latestRev",
",",
"}",
"\n",
"if",
"err",
":=",
"fetchSnapshot",
"(",
"c",
",",
"info",
")",
";",
"err",
"!=",
"nil",
"{",
"logging",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
",",
"authServiceURL",
",",
"err",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"// Configure PubSub subscription to receive future updates.",
"if",
"err",
":=",
"setupPubSub",
"(",
"c",
",",
"baseURL",
",",
"authServiceURL",
")",
";",
"err",
"!=",
"nil",
"{",
"logging",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
",",
"err",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n\n",
"// All is configured. Switch SnapshotInfo entity to point to new snapshot.",
"// It makes syncAuthDB fetch changes from `authServiceURL`, thus promoting",
"// `authServiceURL` to the status of main auth service.",
"if",
"err",
":=",
"ds",
".",
"Put",
"(",
"ds",
".",
"WithoutTransaction",
"(",
"c",
")",
",",
"info",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"transient",
".",
"Tag",
".",
"Apply",
"(",
"err",
")",
"\n",
"}",
"\n\n",
"// Stop getting notifications from previously used auth service.",
"if",
"prevAuthServiceURL",
"!=",
"\"",
"\"",
"&&",
"prevAuthServiceURL",
"!=",
"authServiceURL",
"{",
"return",
"killPubSub",
"(",
"c",
",",
"prevAuthServiceURL",
")",
"\n",
"}",
"\n\n",
"return",
"nil",
"\n",
"}"
] | // ConfigureAuthService makes initial fetch of AuthDB snapshot from the auth
// service and sets up PubSub subscription.
//
// `baseURL` is root URL of currently running service, will be used to derive
// PubSub push endpoint URL.
//
// If `authServiceURL` is blank, disables the fetching. | [
"ConfigureAuthService",
"makes",
"initial",
"fetch",
"of",
"AuthDB",
"snapshot",
"from",
"the",
"auth",
"service",
"and",
"sets",
"up",
"PubSub",
"subscription",
".",
"baseURL",
"is",
"root",
"URL",
"of",
"currently",
"running",
"service",
"will",
"be",
"used",
"to",
"derive",
"PubSub",
"push",
"endpoint",
"URL",
".",
"If",
"authServiceURL",
"is",
"blank",
"disables",
"the",
"fetching",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L136-L195 |
6,894 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | fetchSnapshot | func fetchSnapshot(c context.Context, info *SnapshotInfo) error {
srv := getAuthService(c, info.AuthServiceURL)
snap, err := srv.GetSnapshot(c, info.Rev)
if err != nil {
return err
}
blob, err := service.DeflateAuthDB(snap.AuthDB)
if err != nil {
return err
}
ent := Snapshot{
ID: info.GetSnapshotID(),
AuthDBDeflated: blob,
CreatedAt: snap.Created.UTC(),
FetchedAt: clock.Now(c).UTC(),
}
logging.Infof(c, "Lag: %s", ent.FetchedAt.Sub(ent.CreatedAt))
return transient.Tag.Apply(ds.Put(ds.WithoutTransaction(c), &ent))
} | go | func fetchSnapshot(c context.Context, info *SnapshotInfo) error {
srv := getAuthService(c, info.AuthServiceURL)
snap, err := srv.GetSnapshot(c, info.Rev)
if err != nil {
return err
}
blob, err := service.DeflateAuthDB(snap.AuthDB)
if err != nil {
return err
}
ent := Snapshot{
ID: info.GetSnapshotID(),
AuthDBDeflated: blob,
CreatedAt: snap.Created.UTC(),
FetchedAt: clock.Now(c).UTC(),
}
logging.Infof(c, "Lag: %s", ent.FetchedAt.Sub(ent.CreatedAt))
return transient.Tag.Apply(ds.Put(ds.WithoutTransaction(c), &ent))
} | [
"func",
"fetchSnapshot",
"(",
"c",
"context",
".",
"Context",
",",
"info",
"*",
"SnapshotInfo",
")",
"error",
"{",
"srv",
":=",
"getAuthService",
"(",
"c",
",",
"info",
".",
"AuthServiceURL",
")",
"\n",
"snap",
",",
"err",
":=",
"srv",
".",
"GetSnapshot",
"(",
"c",
",",
"info",
".",
"Rev",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"blob",
",",
"err",
":=",
"service",
".",
"DeflateAuthDB",
"(",
"snap",
".",
"AuthDB",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"ent",
":=",
"Snapshot",
"{",
"ID",
":",
"info",
".",
"GetSnapshotID",
"(",
")",
",",
"AuthDBDeflated",
":",
"blob",
",",
"CreatedAt",
":",
"snap",
".",
"Created",
".",
"UTC",
"(",
")",
",",
"FetchedAt",
":",
"clock",
".",
"Now",
"(",
"c",
")",
".",
"UTC",
"(",
")",
",",
"}",
"\n",
"logging",
".",
"Infof",
"(",
"c",
",",
"\"",
"\"",
",",
"ent",
".",
"FetchedAt",
".",
"Sub",
"(",
"ent",
".",
"CreatedAt",
")",
")",
"\n",
"return",
"transient",
".",
"Tag",
".",
"Apply",
"(",
"ds",
".",
"Put",
"(",
"ds",
".",
"WithoutTransaction",
"(",
"c",
")",
",",
"&",
"ent",
")",
")",
"\n",
"}"
] | // fetchSnapshot fetches AuthDB snapshot specified by `info` and puts it into
// the datastore.
//
// Idempotent. Doesn't touch SnapshotInfo entity itself, and thus always safe
// to call. | [
"fetchSnapshot",
"fetches",
"AuthDB",
"snapshot",
"specified",
"by",
"info",
"and",
"puts",
"it",
"into",
"the",
"datastore",
".",
"Idempotent",
".",
"Doesn",
"t",
"touch",
"SnapshotInfo",
"entity",
"itself",
"and",
"thus",
"always",
"safe",
"to",
"call",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L202-L220 |
6,895 | luci/luci-go | appengine/gaeauth/server/internal/authdbimpl/authdb.go | syncAuthDB | func syncAuthDB(c context.Context) (*SnapshotInfo, error) {
report := durationReporter(c, syncAuthDBDuration)
// `info` is what we have in the datastore now.
info, err := GetLatestSnapshotInfo(c)
if err != nil {
report("ERROR_GET_LATEST_INFO")
return nil, err
}
if info == nil {
report("ERROR_NOT_CONFIGURED")
return nil, errors.New("auth_service URL is not configured")
}
// Grab revision number of the latest snapshot on the server.
srv := getAuthService(c, info.AuthServiceURL)
latestRev, err := srv.GetLatestSnapshotRevision(c)
if err != nil {
report("ERROR_GET_LATEST_REVISION")
return nil, err
}
// Nothing new?
if info.Rev == latestRev {
logging.Infof(c, "AuthDB is up-to-date at revision %d", latestRev)
report("SUCCESS_UP_TO_DATE")
return info, nil
}
// Auth service traveled back in time?
if info.Rev > latestRev {
logging.Errorf(
c, "Latest AuthDB revision on server is %d, we have %d. It should not happen",
latestRev, info.Rev)
report("SUCCESS_NEWER_ALREADY")
return info, nil
}
// Fetch the actual snapshot from the server and put it into the datastore.
info.Rev = latestRev
if err = fetchSnapshot(c, info); err != nil {
logging.Errorf(c, "Failed to fetch snapshot %d from %q - %s", info.Rev, info.AuthServiceURL, err)
report("ERROR_FETCHING")
return nil, err
}
// Move pointer to the latest snapshot only if it is more recent than what is
// already in the datastore.
var latest *SnapshotInfo
err = ds.RunInTransaction(ds.WithoutTransaction(c), func(c context.Context) error {
latest = &SnapshotInfo{}
switch err := ds.Get(c, latest); {
case err == ds.ErrNoSuchEntity:
logging.Warningf(c, "No longer need to fetch AuthDB, not configured anymore")
return nil
case err != nil:
return err
case latest.AuthServiceURL != info.AuthServiceURL:
logging.Warningf(
c, "No longer need to fetch AuthDB from %q, %q is primary now",
info.AuthServiceURL, latest.AuthServiceURL)
return nil
case latest.Rev >= info.Rev:
logging.Warningf(c, "Already have rev %d", info.Rev)
return nil
}
latest = info
return ds.Put(c, info)
}, nil)
if err != nil {
report("ERROR_COMMITTING")
return nil, transient.Tag.Apply(err)
}
report("SUCCESS_UPDATED")
return latest, nil
} | go | func syncAuthDB(c context.Context) (*SnapshotInfo, error) {
report := durationReporter(c, syncAuthDBDuration)
// `info` is what we have in the datastore now.
info, err := GetLatestSnapshotInfo(c)
if err != nil {
report("ERROR_GET_LATEST_INFO")
return nil, err
}
if info == nil {
report("ERROR_NOT_CONFIGURED")
return nil, errors.New("auth_service URL is not configured")
}
// Grab revision number of the latest snapshot on the server.
srv := getAuthService(c, info.AuthServiceURL)
latestRev, err := srv.GetLatestSnapshotRevision(c)
if err != nil {
report("ERROR_GET_LATEST_REVISION")
return nil, err
}
// Nothing new?
if info.Rev == latestRev {
logging.Infof(c, "AuthDB is up-to-date at revision %d", latestRev)
report("SUCCESS_UP_TO_DATE")
return info, nil
}
// Auth service traveled back in time?
if info.Rev > latestRev {
logging.Errorf(
c, "Latest AuthDB revision on server is %d, we have %d. It should not happen",
latestRev, info.Rev)
report("SUCCESS_NEWER_ALREADY")
return info, nil
}
// Fetch the actual snapshot from the server and put it into the datastore.
info.Rev = latestRev
if err = fetchSnapshot(c, info); err != nil {
logging.Errorf(c, "Failed to fetch snapshot %d from %q - %s", info.Rev, info.AuthServiceURL, err)
report("ERROR_FETCHING")
return nil, err
}
// Move pointer to the latest snapshot only if it is more recent than what is
// already in the datastore.
var latest *SnapshotInfo
err = ds.RunInTransaction(ds.WithoutTransaction(c), func(c context.Context) error {
latest = &SnapshotInfo{}
switch err := ds.Get(c, latest); {
case err == ds.ErrNoSuchEntity:
logging.Warningf(c, "No longer need to fetch AuthDB, not configured anymore")
return nil
case err != nil:
return err
case latest.AuthServiceURL != info.AuthServiceURL:
logging.Warningf(
c, "No longer need to fetch AuthDB from %q, %q is primary now",
info.AuthServiceURL, latest.AuthServiceURL)
return nil
case latest.Rev >= info.Rev:
logging.Warningf(c, "Already have rev %d", info.Rev)
return nil
}
latest = info
return ds.Put(c, info)
}, nil)
if err != nil {
report("ERROR_COMMITTING")
return nil, transient.Tag.Apply(err)
}
report("SUCCESS_UPDATED")
return latest, nil
} | [
"func",
"syncAuthDB",
"(",
"c",
"context",
".",
"Context",
")",
"(",
"*",
"SnapshotInfo",
",",
"error",
")",
"{",
"report",
":=",
"durationReporter",
"(",
"c",
",",
"syncAuthDBDuration",
")",
"\n\n",
"// `info` is what we have in the datastore now.",
"info",
",",
"err",
":=",
"GetLatestSnapshotInfo",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n",
"if",
"info",
"==",
"nil",
"{",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"// Grab revision number of the latest snapshot on the server.",
"srv",
":=",
"getAuthService",
"(",
"c",
",",
"info",
".",
"AuthServiceURL",
")",
"\n",
"latestRev",
",",
"err",
":=",
"srv",
".",
"GetLatestSnapshotRevision",
"(",
"c",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Nothing new?",
"if",
"info",
".",
"Rev",
"==",
"latestRev",
"{",
"logging",
".",
"Infof",
"(",
"c",
",",
"\"",
"\"",
",",
"latestRev",
")",
"\n",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"info",
",",
"nil",
"\n",
"}",
"\n\n",
"// Auth service traveled back in time?",
"if",
"info",
".",
"Rev",
">",
"latestRev",
"{",
"logging",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
",",
"latestRev",
",",
"info",
".",
"Rev",
")",
"\n",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"info",
",",
"nil",
"\n",
"}",
"\n\n",
"// Fetch the actual snapshot from the server and put it into the datastore.",
"info",
".",
"Rev",
"=",
"latestRev",
"\n",
"if",
"err",
"=",
"fetchSnapshot",
"(",
"c",
",",
"info",
")",
";",
"err",
"!=",
"nil",
"{",
"logging",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
",",
"info",
".",
"Rev",
",",
"info",
".",
"AuthServiceURL",
",",
"err",
")",
"\n",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"err",
"\n",
"}",
"\n\n",
"// Move pointer to the latest snapshot only if it is more recent than what is",
"// already in the datastore.",
"var",
"latest",
"*",
"SnapshotInfo",
"\n",
"err",
"=",
"ds",
".",
"RunInTransaction",
"(",
"ds",
".",
"WithoutTransaction",
"(",
"c",
")",
",",
"func",
"(",
"c",
"context",
".",
"Context",
")",
"error",
"{",
"latest",
"=",
"&",
"SnapshotInfo",
"{",
"}",
"\n",
"switch",
"err",
":=",
"ds",
".",
"Get",
"(",
"c",
",",
"latest",
")",
";",
"{",
"case",
"err",
"==",
"ds",
".",
"ErrNoSuchEntity",
":",
"logging",
".",
"Warningf",
"(",
"c",
",",
"\"",
"\"",
")",
"\n",
"return",
"nil",
"\n",
"case",
"err",
"!=",
"nil",
":",
"return",
"err",
"\n",
"case",
"latest",
".",
"AuthServiceURL",
"!=",
"info",
".",
"AuthServiceURL",
":",
"logging",
".",
"Warningf",
"(",
"c",
",",
"\"",
"\"",
",",
"info",
".",
"AuthServiceURL",
",",
"latest",
".",
"AuthServiceURL",
")",
"\n",
"return",
"nil",
"\n",
"case",
"latest",
".",
"Rev",
">=",
"info",
".",
"Rev",
":",
"logging",
".",
"Warningf",
"(",
"c",
",",
"\"",
"\"",
",",
"info",
".",
"Rev",
")",
"\n",
"return",
"nil",
"\n",
"}",
"\n",
"latest",
"=",
"info",
"\n",
"return",
"ds",
".",
"Put",
"(",
"c",
",",
"info",
")",
"\n",
"}",
",",
"nil",
")",
"\n\n",
"if",
"err",
"!=",
"nil",
"{",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"transient",
".",
"Tag",
".",
"Apply",
"(",
"err",
")",
"\n",
"}",
"\n\n",
"report",
"(",
"\"",
"\"",
")",
"\n",
"return",
"latest",
",",
"nil",
"\n",
"}"
] | // syncAuthDB fetches latest AuthDB snapshot from the configured auth service,
// puts it into the datastore and updates SnapshotInfo entity to point to it.
//
// Expects authenticating transport to be in the context. Called when receiving
// PubSub notifications.
//
// Returns SnapshotInfo of the most recent snapshot. | [
"syncAuthDB",
"fetches",
"latest",
"AuthDB",
"snapshot",
"from",
"the",
"configured",
"auth",
"service",
"puts",
"it",
"into",
"the",
"datastore",
"and",
"updates",
"SnapshotInfo",
"entity",
"to",
"point",
"to",
"it",
".",
"Expects",
"authenticating",
"transport",
"to",
"be",
"in",
"the",
"context",
".",
"Called",
"when",
"receiving",
"PubSub",
"notifications",
".",
"Returns",
"SnapshotInfo",
"of",
"the",
"most",
"recent",
"snapshot",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/appengine/gaeauth/server/internal/authdbimpl/authdb.go#L229-L306 |
6,896 | luci/luci-go | common/tsmon/distribution/bucketer.go | NewBucketer | func NewBucketer(width, growthFactor float64, numFiniteBuckets int) *Bucketer {
b := &Bucketer{
width: width,
growthFactor: growthFactor,
numFiniteBuckets: numFiniteBuckets,
}
b.init()
return b
} | go | func NewBucketer(width, growthFactor float64, numFiniteBuckets int) *Bucketer {
b := &Bucketer{
width: width,
growthFactor: growthFactor,
numFiniteBuckets: numFiniteBuckets,
}
b.init()
return b
} | [
"func",
"NewBucketer",
"(",
"width",
",",
"growthFactor",
"float64",
",",
"numFiniteBuckets",
"int",
")",
"*",
"Bucketer",
"{",
"b",
":=",
"&",
"Bucketer",
"{",
"width",
":",
"width",
",",
"growthFactor",
":",
"growthFactor",
",",
"numFiniteBuckets",
":",
"numFiniteBuckets",
",",
"}",
"\n",
"b",
".",
"init",
"(",
")",
"\n",
"return",
"b",
"\n",
"}"
] | // NewBucketer creates a bucketer from custom parameters. | [
"NewBucketer",
"creates",
"a",
"bucketer",
"from",
"custom",
"parameters",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/common/tsmon/distribution/bucketer.go#L31-L39 |
6,897 | luci/luci-go | logdog/appengine/coordinator/endpoints/admin/setConfig.go | SetConfig | func (s *server) SetConfig(c context.Context, req *logdog.SetConfigRequest) (*empty.Empty, error) {
se := config.Settings{
BigTableServiceAccountJSON: req.StorageServiceAccountJson,
}
if err := se.Validate(); err != nil {
log.Fields{
log.ErrorKey: err,
}.Errorf(c, "New configuration did not validate.")
return nil, grpcutil.Errf(codes.InvalidArgument, "config did not validate: %v", err)
}
if err := se.Store(c, "setConfig endpoint"); err != nil {
log.Fields{
log.ErrorKey: err,
}.Errorf(c, "Failed to store new configuration.")
return nil, grpcutil.Internal
}
return &empty.Empty{}, nil
} | go | func (s *server) SetConfig(c context.Context, req *logdog.SetConfigRequest) (*empty.Empty, error) {
se := config.Settings{
BigTableServiceAccountJSON: req.StorageServiceAccountJson,
}
if err := se.Validate(); err != nil {
log.Fields{
log.ErrorKey: err,
}.Errorf(c, "New configuration did not validate.")
return nil, grpcutil.Errf(codes.InvalidArgument, "config did not validate: %v", err)
}
if err := se.Store(c, "setConfig endpoint"); err != nil {
log.Fields{
log.ErrorKey: err,
}.Errorf(c, "Failed to store new configuration.")
return nil, grpcutil.Internal
}
return &empty.Empty{}, nil
} | [
"func",
"(",
"s",
"*",
"server",
")",
"SetConfig",
"(",
"c",
"context",
".",
"Context",
",",
"req",
"*",
"logdog",
".",
"SetConfigRequest",
")",
"(",
"*",
"empty",
".",
"Empty",
",",
"error",
")",
"{",
"se",
":=",
"config",
".",
"Settings",
"{",
"BigTableServiceAccountJSON",
":",
"req",
".",
"StorageServiceAccountJson",
",",
"}",
"\n",
"if",
"err",
":=",
"se",
".",
"Validate",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Fields",
"{",
"log",
".",
"ErrorKey",
":",
"err",
",",
"}",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"grpcutil",
".",
"Errf",
"(",
"codes",
".",
"InvalidArgument",
",",
"\"",
"\"",
",",
"err",
")",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"se",
".",
"Store",
"(",
"c",
",",
"\"",
"\"",
")",
";",
"err",
"!=",
"nil",
"{",
"log",
".",
"Fields",
"{",
"log",
".",
"ErrorKey",
":",
"err",
",",
"}",
".",
"Errorf",
"(",
"c",
",",
"\"",
"\"",
")",
"\n",
"return",
"nil",
",",
"grpcutil",
".",
"Internal",
"\n",
"}",
"\n",
"return",
"&",
"empty",
".",
"Empty",
"{",
"}",
",",
"nil",
"\n",
"}"
] | // SetConfig loads the supplied configuration into a config.GlobalConfig
// instance. | [
"SetConfig",
"loads",
"the",
"supplied",
"configuration",
"into",
"a",
"config",
".",
"GlobalConfig",
"instance",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/logdog/appengine/coordinator/endpoints/admin/setConfig.go#L31-L49 |
6,898 | luci/luci-go | grpc/cmd/cproto/transform.go | transformGoFile | func (t *transformer) transformGoFile(filename string) error {
t.fset = token.NewFileSet()
file, err := parser.ParseFile(t.fset, filename, nil, parser.ParseComments)
if err != nil {
return err
}
t.PackageName = file.Name.Name
t.services, err = getServices(file)
if err != nil {
return err
}
if len(t.services) == 0 {
return nil
}
t.inPRPCPackage, err = isInPackage(filename, prpcPackagePath)
if err != nil {
return err
}
if err := t.transformFile(file); err != nil {
return err
}
var buf bytes.Buffer
if err := printer.Fprint(&buf, t.fset, file); err != nil {
return err
}
formatted, err := gofmt(buf.Bytes())
if err != nil {
return err
}
return ioutil.WriteFile(filename, formatted, 0666)
} | go | func (t *transformer) transformGoFile(filename string) error {
t.fset = token.NewFileSet()
file, err := parser.ParseFile(t.fset, filename, nil, parser.ParseComments)
if err != nil {
return err
}
t.PackageName = file.Name.Name
t.services, err = getServices(file)
if err != nil {
return err
}
if len(t.services) == 0 {
return nil
}
t.inPRPCPackage, err = isInPackage(filename, prpcPackagePath)
if err != nil {
return err
}
if err := t.transformFile(file); err != nil {
return err
}
var buf bytes.Buffer
if err := printer.Fprint(&buf, t.fset, file); err != nil {
return err
}
formatted, err := gofmt(buf.Bytes())
if err != nil {
return err
}
return ioutil.WriteFile(filename, formatted, 0666)
} | [
"func",
"(",
"t",
"*",
"transformer",
")",
"transformGoFile",
"(",
"filename",
"string",
")",
"error",
"{",
"t",
".",
"fset",
"=",
"token",
".",
"NewFileSet",
"(",
")",
"\n",
"file",
",",
"err",
":=",
"parser",
".",
"ParseFile",
"(",
"t",
".",
"fset",
",",
"filename",
",",
"nil",
",",
"parser",
".",
"ParseComments",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"t",
".",
"PackageName",
"=",
"file",
".",
"Name",
".",
"Name",
"\n",
"t",
".",
"services",
",",
"err",
"=",
"getServices",
"(",
"file",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"if",
"len",
"(",
"t",
".",
"services",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"t",
".",
"inPRPCPackage",
",",
"err",
"=",
"isInPackage",
"(",
"filename",
",",
"prpcPackagePath",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"if",
"err",
":=",
"t",
".",
"transformFile",
"(",
"file",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"var",
"buf",
"bytes",
".",
"Buffer",
"\n",
"if",
"err",
":=",
"printer",
".",
"Fprint",
"(",
"&",
"buf",
",",
"t",
".",
"fset",
",",
"file",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"formatted",
",",
"err",
":=",
"gofmt",
"(",
"buf",
".",
"Bytes",
"(",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"return",
"ioutil",
".",
"WriteFile",
"(",
"filename",
",",
"formatted",
",",
"0666",
")",
"\n",
"}"
] | // transformGoFile rewrites a .go file to work with prpc. | [
"transformGoFile",
"rewrites",
"a",
".",
"go",
"file",
"to",
"work",
"with",
"prpc",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/grpc/cmd/cproto/transform.go#L50-L85 |
6,899 | luci/luci-go | grpc/cmd/cproto/transform.go | transformRegisterServerFuncs | func (t *transformer) transformRegisterServerFuncs(s *service) {
registrarName := ast.NewIdent("Registrar")
var registrarType ast.Expr = registrarName
if !t.inPRPCPackage {
registrarType = &ast.SelectorExpr{serverPrpcPkg, registrarName}
}
s.registerServerFunc.Params.List[0].Type = registrarType
} | go | func (t *transformer) transformRegisterServerFuncs(s *service) {
registrarName := ast.NewIdent("Registrar")
var registrarType ast.Expr = registrarName
if !t.inPRPCPackage {
registrarType = &ast.SelectorExpr{serverPrpcPkg, registrarName}
}
s.registerServerFunc.Params.List[0].Type = registrarType
} | [
"func",
"(",
"t",
"*",
"transformer",
")",
"transformRegisterServerFuncs",
"(",
"s",
"*",
"service",
")",
"{",
"registrarName",
":=",
"ast",
".",
"NewIdent",
"(",
"\"",
"\"",
")",
"\n",
"var",
"registrarType",
"ast",
".",
"Expr",
"=",
"registrarName",
"\n",
"if",
"!",
"t",
".",
"inPRPCPackage",
"{",
"registrarType",
"=",
"&",
"ast",
".",
"SelectorExpr",
"{",
"serverPrpcPkg",
",",
"registrarName",
"}",
"\n",
"}",
"\n",
"s",
".",
"registerServerFunc",
".",
"Params",
".",
"List",
"[",
"0",
"]",
".",
"Type",
"=",
"registrarType",
"\n",
"}"
] | // transformRegisterServerFuncs finds RegisterXXXServer functions and
// checks its first parameter type to prpc.Registrar.
// Returns true if modified ast. | [
"transformRegisterServerFuncs",
"finds",
"RegisterXXXServer",
"functions",
"and",
"checks",
"its",
"first",
"parameter",
"type",
"to",
"prpc",
".",
"Registrar",
".",
"Returns",
"true",
"if",
"modified",
"ast",
"."
] | f6cef429871eee3be7c6903af88d3ee884eaf683 | https://github.com/luci/luci-go/blob/f6cef429871eee3be7c6903af88d3ee884eaf683/grpc/cmd/cproto/transform.go#L112-L119 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.