config

package
v0.0.0-...-6e61812 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Collection     string       `yaml:"collection"`
	GitPath        string       `yaml:"git_path"`
	FileNameFormat string       `yaml:"file_name_format"`
	MetadataSchema []SchemaItem `yaml:"metadata_schema"`
}

func (*Collection) ToYAMLString

func (c *Collection) ToYAMLString() (string, error)

type CollectionConfig

type CollectionConfig []Collection

func (*CollectionConfig) GetCollectionConfig

func (c *CollectionConfig) GetCollectionConfig(collection string) *Collection

type CollectionPermission

type CollectionPermission struct {
	Name            string                  `yaml:"name"`
	Permission      string                  `yaml:"permission"`
	DefaultMetadata map[string]MetadataItem `yaml:"default_metadata,omitempty"`
}

func (*CollectionPermission) ToYAMLString

func (c *CollectionPermission) ToYAMLString() (string, error)

type Config

type Config struct {
	PublicHost              string
	Port                    string
	CookiesAuthSecret       string
	CookiesAuthAgeInSeconds int
	CookiesAuthIsSecure     bool
	CookiesAuthIsHttpOnly   bool
	AzureADClientID         string
	AzureADClientSecret     string
	AzureADTenantID         string
	GitHubToken             string
	CollectionConfig        *CollectionConfig
	UserConfig              *UserConfig
}
var Envs Config

type MetadataItem

type MetadataItem struct {
	Value  interface{} `yaml:"value"`
	Strict bool        `yaml:"strict"`
}

type SchemaItem

type SchemaItem struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
	Type        string `yaml:"type"`
	Required    bool   `yaml:"required"`
	Filter      bool   `yaml:"filter"`
	ItemsType   string `yaml:"items_type,omitempty"`
}

type User

type User struct {
	Email                 string                 `yaml:"email"`
	IsAdmin               bool                   `yaml:"is_admin"`
	CollectionPermissions []CollectionPermission `yaml:"collection_permissions"`
}

func (*User) GetCollectionPermission

func (u *User) GetCollectionPermission(collection string) *CollectionPermission

type UserConfig

type UserConfig []User

func (*UserConfig) GetUserConfig

func (u *UserConfig) GetUserConfig(email string) *User

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL