Documentation
¶
Index ¶
- Constants
- func New(apiFilesDir string, opts ...Option) (string, error)
- func WithAuthentication(authentication string) func(*Options)
- func WithBaseFileName(baseFileName string) func(*Options)
- func WithBaseServerURL(baseServerURL string) func(*Options)
- func WithCDN(cdn string) func(*Options)
- func WithDarkMode() func(*Options)
- func WithDefaultFonts() func(*Options)
- func WithEditable() func(*Options)
- func WithForceDarkMode() func(*Options)
- func WithHiddenClients(hiddenClients []string) func(*Options)
- func WithHideDarkModeToggle() func(*Options)
- func WithHideDownloadButton() func(*Options)
- func WithHideModels() func(*Options)
- func WithKeyValue(key string, value any) func(MetaData)
- func WithLayout(layout Layout) func(*Options)
- func WithMetaDataOpts(metadataOpts ...MetaOption) func(*Options)
- func WithOverrideCSS(overrideCSS string) func(*Options)
- func WithPathRouting(pathRouting string) func(*Options)
- func WithProxy(proxy string) func(*Options)
- func WithSearchHotKey(searchHotKey string) func(*Options)
- func WithServers(servers ...Server) func(*Options)
- func WithSidebarVisibility(visible bool) func(*Options)
- func WithSpecModifier(handler SpecModifier) func(*Options)
- func WithTheme(theme Theme) func(*Options)
- func WithTitle(title string) func(MetaData)
- type Layout
- type MetaData
- type MetaOption
- type Option
- type Options
- type Server
- type SpecModifier
- type Theme
Constants ¶
const DefaultCDN = "https://cdn.jsdelivr.net/npm/@scalar/api-reference"
DefaultCDN default CDN for api-reference
Variables ¶
This section is empty.
Functions ¶
func WithAuthentication ¶
WithAuthentication sets the authentication method for the Scalar UI
func WithBaseFileName ¶
WithBaseFileName sets the base file name for the Scalar UI
func WithBaseServerURL ¶
WithBaseServerURL sets the base server URL for the Scalar UI
func WithDarkMode ¶
func WithDarkMode() func(*Options)
WithDarkMode sets the dark mode for the Scalar UI
func WithDefaultFonts ¶
func WithDefaultFonts() func(*Options)
WithDefaultFonts sets the default fonts usage for the Scalar UI
func WithEditable ¶
func WithEditable() func(*Options)
WithEditable sets the editable state for the Scalar UI
func WithForceDarkMode ¶ added in v0.5.0
func WithForceDarkMode() func(*Options)
WithForceDarkMode makes it always this state no matter what
func WithHiddenClients ¶
WithHiddenClients sets the hidden clients for the Scalar UI
func WithHideDarkModeToggle ¶ added in v0.5.0
func WithHideDarkModeToggle() func(*Options)
WithHideDarkModeToggle hides the dark mode toggle button
func WithHideDownloadButton ¶
func WithHideDownloadButton() func(*Options)
WithHideDownloadButton sets the download button visibility for the Scalar UI
func WithHideModels ¶
func WithHideModels() func(*Options)
WithHideModels sets the models visibility for the Scalar UI
func WithKeyValue ¶ added in v0.5.0
WithKeyValue add metadata with key and value
func WithLayout ¶
WithLayout sets the layout for the Scalar UI
func WithMetaDataOpts ¶ added in v0.5.0
func WithMetaDataOpts(metadataOpts ...MetaOption) func(*Options)
WithMetaDataOpts add metadata
func WithOverrideCSS ¶
WithOverrideCSS sets the override CSS for the Scalar UI
func WithPathRouting ¶
WithPathRouting sets the path routing for the Scalar UI
func WithSearchHotKey ¶
WithSearchHotKey sets the search hot key for the Scalar UI
func WithServers ¶ added in v0.5.0
WithServers servers to override the openapi spec servers
func WithSidebarVisibility ¶
WithSidebarVisibility sets the sidebar visibility for the Scalar UI
func WithSpecModifier ¶ added in v0.0.6
func WithSpecModifier(handler SpecModifier) func(*Options)
WithSpecModifier allows to modify the spec before rendering
Types ¶
type MetaOption ¶ added in v0.5.0
type MetaOption func(MetaData)
type Options ¶
type Options struct { Theme Theme `json:"theme,omitempty"` Layout Layout `json:"layout,omitempty"` Proxy string `json:"proxy,omitempty"` IsEditable bool `json:"isEditable,omitempty"` ShowSidebar bool `json:"showSidebar,omitempty"` HideModels bool `json:"hideModels,omitempty"` HideDownloadButton bool `json:"hideDownloadButton,omitempty"` DarkMode bool `json:"darkMode,omitempty"` FroceDarkMode bool `json:"forceDarkModeState,omitempty"` HideDarkModeToggle bool `json:"hideDarkModeToggle,omitempty"` SearchHotKey string `json:"searchHotKey,omitempty"` HiddenClients []string `json:"hiddenClients,omitempty"` Authentication string `json:"authentication,omitempty"` PathRouting string `json:"pathRouting,omitempty"` BaseServerURL string `json:"baseServerUrl,omitempty"` WithDefaultFonts bool `json:"withDefaultFonts,omitempty"` Servers []Server `json:"servers,omitempty"` MetaData MetaData `json:"metadata,omitempty"` OverrideCSS string `json:"-"` BaseFileName string `json:"-"` CDN string `json:"-"` OverrideHandler SpecModifier `json:"-"` }
type SpecModifier ¶ added in v0.0.6
SpecModifier is a function that can be used to override the spec
type Theme ¶
type Theme string
Theme as a type based on string for theme identification
const ( ThemeDefault Theme = "default" ThemeAlternate Theme = "alternate" ThemeMoon Theme = "moon" ThemePurple Theme = "purple" ThemeSolarized Theme = "solarized" ThemeBluePlanet Theme = "bluePlanet" ThemeDeepSpace Theme = "deepSpace" ThemeSaturn Theme = "saturn" ThemeKepler Theme = "kepler" ThemeMars Theme = "mars" ThemeNone Theme = "none" ThemeNil Theme = "" )