orisano/go-adal

View on GitHub
option.go

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
package adal

type options struct {
    AuthorityHost     string
    ValidateAuthority bool
}

type Option func(*options)

func defaultOption() options {
    return options{
        AuthorityHost:     WorldWideAuthority,
        ValidateAuthority: false,
    }
}

func SetAuthorityHost(authorityHost string) Option {
    return func(options *options) {
        options.AuthorityHost = authorityHost
    }
}

func ValidateAuthority() Option {
    return func(options *options) {
        options.ValidateAuthority = true
    }
}