當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Offer.Interface方法代碼示例

本文整理匯總了Golang中github.com/willfaught/company/prototype/company/offer.Offer.Interface方法的典型用法代碼示例。如果您正苦於以下問題:Golang Offer.Interface方法的具體用法?Golang Offer.Interface怎麽用?Golang Offer.Interface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在github.com/willfaught/company/prototype/company/offer.Offer的用法示例。


在下文中一共展示了Offer.Interface方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: New

// New creates m.
func (c Client) New(m offer.Offer) (offer.Offer, error) {
	m.Interface = nil
	var argument = struct {
		Arguments struct {
			M offer.Offer
		}
		Context Context
	}{
		Arguments: struct {
			M offer.Offer
		}{
			M: m,
		},
		Context: c.Context,
	}
	var result struct {
		Offer offer.Offer
	}
	c.Configuration.OnCall("New", argument.Context, argument.Arguments)
	var err = c.Client.Call(c.Name+".New", argument, &result)
	c.Configuration.OnReturn("New", argument.Context, result, err)
	result.Offer.Interface = c
	return result.Offer, err
}
開發者ID:willfaught,項目名稱:services,代碼行數:25,代碼來源:client.go

示例2: Delete

// Delete deletes m.
func (c Client) Delete(m offer.Offer) (offer.Offer, error) {
	m.Interface = nil // Avoid encoding the Service or Client
	var argument = struct {
		Arguments struct { // Method arguments
			M offer.Offer // m
		}
		Context Context // Call context
	}{
		Arguments: struct { // Method arguments
			M offer.Offer // m
		}{
			M: m, // m
		},
		Context: c.Context, // Call context
	}
	var result struct { // Method result
		Offer offer.Offer // Only one non-error result
	}
	c.Configuration.OnCall("Delete", argument.Context, argument.Arguments) // Called because Configuration implements it
	var err = c.Client.Call(c.Name+".Delete", argument, &result)
	c.Configuration.OnReturn("Delete", argument.Context, result, err) // Called because Configuration implements it
	result.Offer.Interface = c                                        // Enable method calls like m.Delete(). See offer.Offer.Delete.
	return result.Offer, err
}
開發者ID:willfaught,項目名稱:services,代碼行數:25,代碼來源:client.go

示例3: simplify

func simplify(o offer.Offer) offer.Offer {
	o.Interface = nil
	return o
}
開發者ID:willfaught,項目名稱:services,代碼行數:4,代碼來源:main.go


注:本文中的github.com/willfaught/company/prototype/company/offer.Offer.Interface方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。