package push

type Options struct {
	AppId           string
	AppKey          string
	AppSecret       string
	AppMasterSecret string
	ClientId        string
	ClientIds       []string

	MsgType  int //消息类型
	PushType int //推送类型

	Title               string
	Content             string
	Extra               interface{} //扩展数据
	TransmissionContent string      //透传内容

	DebugModule bool
}
type Option func(o *Options)

//个推appId
func AppId(id string) Option {
	return func(o *Options) {
		o.AppId = id
	}
}

//个推appKey
func AppKey(key string) Option {
	return func(o *Options) {
		o.AppKey = key
	}
}

//个推appSecret
func AppSecret(secret string) Option {
	return func(o *Options) {
		o.AppSecret = secret
	}
}

//个推appMasterSecret
func AppMasterSecret(secret string) Option {
	return func(o *Options) {
		o.AppMasterSecret = secret
	}
}

//个推 app clientId
func ClientId(clientId string) Option {
	return func(o *Options) {
		o.ClientId = clientId
	}
}
func ClientIds(clientId []string) Option {
	return func(o *Options) {
		o.ClientIds = clientId
	}
}

//消息类型
func MsgType(msgType int) Option {
	return func(o *Options) {
		o.MsgType = msgType
	}
}

//推送类型
func PushType(pushType int) Option {
	return func(o *Options) {
		o.PushType = pushType
	}
}

//消息内容
func Title(title string) Option {
	return func(o *Options) {
		o.Title = title
	}
}
func Content(content string) Option {
	return func(o *Options) {
		o.Content = content
	}
}
func Extra(extra interface{}) Option {
	return func(o *Options) {
		o.Extra = extra
	}
}
func TransmissionContent(content string) Option {
	return func(o *Options) {
		o.TransmissionContent = content
	}
}
func DebugModule(module bool) Option {
	return func(o *Options) {
		o.DebugModule = module
	}
}

const (
	Message = iota + 1
	Notification
)