Documentation ¶
Index ¶
- Constants
- Variables
- func Marshal(v any) (template.JS, error)
- func Raw(v any) (template.HTML, error)
- func ResolvePropVal(val any) (any, error)
- type Inertia
- func (i *Inertia) Back(w http.ResponseWriter, r *http.Request)
- func (i *Inertia) DisableSsr()
- func (i *Inertia) EnableSsr(ssrURL string)
- func (i *Inertia) EnableSsrWithDefault()
- func (i *Inertia) IsSsrEnabled() bool
- func (i *Inertia) Location(w http.ResponseWriter, r *http.Request, url string)
- func (i *Inertia) Middleware(next http.Handler) http.Handler
- func (i *Inertia) PrepareProps(r *http.Request, component string, props Props) (Props, error)
- func (i *Inertia) Render(w http.ResponseWriter, r *http.Request, component string, props Props) error
- func (i *Inertia) Share(key string, value any)
- func (i *Inertia) ShareFunc(key string, value any)
- func (i *Inertia) WithProp(ctx context.Context, key string, value any) context.Context
- func (i *Inertia) WithProps(ctx context.Context, props Props) context.Context
- func (i *Inertia) WithViewData(ctx context.Context, key string, value any) context.Context
- type LazyProp
- type Page
- type Props
- type Ssr
Constants ¶
View Source
const ContextKeyProps contextKey = "props"
ContextKeyProps key.
View Source
const ContextKeyViewData contextKey = "viewData"
ContextKeyViewData key.
Variables ¶
View Source
var ( // ErrInvalidContextProps error. ErrInvalidContextProps = errors.New("inertia: could not convert context props to map") // ErrInvalidContextViewData error. ErrInvalidContextViewData = errors.New("inertia: could not convert context view data to map") // ErrBadSsrStatusCode error. ErrBadSsrStatusCode = errors.New("inertia: bad ssr status code >= 400") // ErrBadSsrStatusCode error. ErrRawTemplateFunc = errors.New("inertia: error with raw template func") )
Functions ¶
func ResolvePropVal ¶
Types ¶
type Inertia ¶
type Inertia struct { Url string SsrURL string SsrClient *http.Client // contains filtered or unexported fields }
Inertia type.
func (*Inertia) EnableSsrWithDefault ¶
func (i *Inertia) EnableSsrWithDefault()
EnableSsrWithDefault function.
func (*Inertia) Middleware ¶
Middleware function.
func (*Inertia) PrepareProps ¶
func (*Inertia) Render ¶
func (i *Inertia) Render(w http.ResponseWriter, r *http.Request, component string, props Props) error
Render function.
Click to show internal directories.
Click to hide internal directories.