Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[golang] struct #25

Open
cherishman2005 opened this issue Apr 28, 2022 · 1 comment
Open

[golang] struct #25

cherishman2005 opened this issue Apr 28, 2022 · 1 comment

Comments

@cherishman2005
Copy link
Owner

cherishman2005 commented Apr 28, 2022

type ExpireConf struct {
    Expire               uint32  `xml:"expire"`
    NormalExpire         uint32  `xml:"normal_expire"`
    ExpireCnt            uint32  `xml:"expire_cnt"`
    ExpireIncr           uint32  `xml:"expire_incr"`
	MaxTryInterval       uint32  `xml:"expire_max_try_interval"`
}
@cherishman2005
Copy link
Owner Author

cherishman2005 commented Apr 28, 2022

func (this *ExpireConf) GetExpire() uint32 {
	if this.Expire == 0 {
		this.Expire = 900
	}
	return this.Expire
}

func (this *ExpireConf) GetNormalExpire() uint32 {
	if this.NormalExpire == 0 {
		this.NormalExpire = 60
	}
	return this.NormalExpire
}

func (this *ExpireConf) GetExpireCnt() uint32 {
	if this.ExpireCnt == 0 {
		this.ExpireCnt = 10
	}
	return this.ExpireCnt
}

func (this *ExpireConf) GetExpireIncr() uint32 {
	if this.ExpireIncr == 0 {
		this.ExpireIncr = 10
	}
	return this.ExpireIncr
}

func (this *ExpireConf) GetMaxTryInterval() uint32 {
	if this.MaxTryInterval == 0 {
		this.MaxTryInterval = 60
	}
	return this.MaxTryInterval
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant