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 WithHiddenClients(hiddenClients []string) func(*Options)
- func WithHideDownloadButton() func(*Options)
- func WithHideModels() func(*Options)
- func WithLayout(layout Layout) func(*Options)
- func WithMetaData(metaData string) 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 WithSidebarVisibility(visible bool) func(*Options)
- func WithSpecModifier(handler SpecModifier) func(*Options)
- func WithTheme(theme Theme) func(*Options)
- type Layout
- type Option
- type Options
- type SpecModifier
- type Theme
Constants ¶
const DefaultCDN = "https://cdn.jsdelivr.net/npm/@scalar/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 WithHiddenClients ¶
WithHiddenClients sets the hidden clients for the Scalar UI
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 WithLayout ¶
WithLayout sets the layout for the Scalar UI
func WithMetaData ¶
WithMetaData sets the metadata for the Scalar UI
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 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 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"` SearchHotKey string `json:"searchHotKey,omitempty"` MetaData string `json:"metaData,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"` 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 = "" )