Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRestriction ¶
func GetRestriction(w http.ResponseWriter, r *http.Request)
func LoadConfig ¶
LoadConfig init config package and export `config.Conf`
Types ¶
type Config ¶
type Config struct {
Listen string `yaml:"listen"`
OIDC []*OIDC `yaml:"oidc"`
State StateConfig `yaml:"state"`
Model ModelConfig `yaml:"model"`
Admins []string `yaml:"admins"`
}
var (
Conf *Config
)
type EtcdConfig ¶
type ModelConfig ¶
type ModelConfig struct {
Status StatusConfig `yaml:"status"`
Keywords []string `yaml:"keywords"`
}
type OIDC ¶
type OIDC struct {
Provider string `yaml:"provider"`
Issuer string `yaml:"issuer"`
AuthURL string `yaml:"authURL"`
TokenURL string `yaml:"tokenURL"`
UserInfoURL string `yaml:"userInfoURL"`
ClientID string `yaml:"clientID"`
ClientSecret string `yaml:"clientSecret"`
Redirect string `yaml:"redirect"`
Scopes []string `yaml:"scopes"`
TrustEmail bool `yaml:"trustEmail"`
UserMeta UserMeta `yaml:"userMeta"`
}
type OIDCProvider ¶
type OIDCProvider struct {
Provider *oidc.Provider
Config *oauth2.Config
TrustEmail bool
UserMeta *UserMeta
}
func GetOIDCProvider ¶
func GetOIDCProvider(provider string) *OIDCProvider
type Restriction ¶
type Restriction struct {
Status StatusConfig `json:"status"`
}
type StateConfig ¶
type StateConfig struct {
Etcd *EtcdConfig `yaml:"etcd"`
}
type StatusConfig ¶
type StatusConfig struct {
ContentListLimit int `yaml:"contentListLimit" json:"contentListLimit"`
ContentLimit int `yaml:"contentLimit" json:"contentLimit"`
OverviewLimit int `yaml:"overviewLimit" json:"overviewLimit"`
}
func (*StatusConfig) RestrictContent ¶
func (c *StatusConfig) RestrictContent(content string) error
func (*StatusConfig) RestrictContentList ¶
func (c *StatusConfig) RestrictContentList(contentListSize int) error
func (*StatusConfig) RestrictOverview ¶
func (c *StatusConfig) RestrictOverview(content string) error
Click to show internal directories.
Click to hide internal directories.