options.go 359 字节
Newer Older
J
Jeff 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
package notification

type NotificationOptions struct {
	Endpoint string
}

func NewNotificationOptions() *NotificationOptions {
	return &NotificationOptions{
		Endpoint: "",
	}
}

func (s *NotificationOptions) ApplyTo(options *NotificationOptions) {
J
Jeff 已提交
14 15 16 17 18
	if options == nil {
		options = s
		return
	}

J
Jeff 已提交
19 20 21 22
	if s.Endpoint != "" {
		options.Endpoint = s.Endpoint
	}
}