2019-06-21 18:43:25 +02:00
|
|
|
package router
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
func ExampleParty_StaticWeb() {
|
|
|
|
api := NewAPIBuilder()
|
|
|
|
api.StaticWeb("/static", "./assets")
|
|
|
|
|
|
|
|
err := api.GetReport()
|
|
|
|
if err == nil {
|
|
|
|
panic("expected report for deprecation")
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(err)
|
|
|
|
// Output: StaticWeb is DEPRECATED and it will be removed eventually.
|
2019-07-15 06:49:04 +02:00
|
|
|
// Source: ./deprecated_example_test.go:9
|
2019-06-21 18:43:25 +02:00
|
|
|
// Use .HandleDir("/static", "./assets") instead.
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleParty_StaticHandler() {
|
|
|
|
api := NewAPIBuilder()
|
|
|
|
api.StaticHandler("./assets", false, true)
|
|
|
|
|
|
|
|
err := api.GetReport()
|
|
|
|
if err == nil {
|
|
|
|
panic("expected report for deprecation")
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(err)
|
|
|
|
// Output: StaticHandler is DEPRECATED and it will be removed eventually.
|
2019-07-15 06:49:04 +02:00
|
|
|
// Source: ./deprecated_example_test.go:24
|
2019-06-21 18:43:25 +02:00
|
|
|
// Use iris.FileServer("./assets", iris.DirOptions{ShowList: false, Gzip: true}) instead.
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleParty_StaticEmbedded() {
|
|
|
|
api := NewAPIBuilder()
|
|
|
|
api.StaticEmbedded("/static", "./assets", nil, nil)
|
|
|
|
|
|
|
|
err := api.GetReport()
|
|
|
|
if err == nil {
|
|
|
|
panic("expected report for deprecation")
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(err)
|
|
|
|
// Output: StaticEmbedded is DEPRECATED and it will be removed eventually.
|
|
|
|
// It is also miss the AssetInfo bindata function, which is required now.
|
2019-07-15 06:49:04 +02:00
|
|
|
// Source: ./deprecated_example_test.go:39
|
2019-06-21 18:43:25 +02:00
|
|
|
// Use .HandleDir("/static", "./assets", iris.DirOptions{Asset: Asset, AssetInfo: AssetInfo, AssetNames: AssetNames}) instead.
|
|
|
|
}
|
|
|
|
|
|
|
|
func ExampleParty_StaticEmbeddedGzip() {
|
|
|
|
api := NewAPIBuilder()
|
|
|
|
api.StaticEmbeddedGzip("/static", "./assets", nil, nil)
|
|
|
|
|
|
|
|
err := api.GetReport()
|
|
|
|
if err == nil {
|
|
|
|
panic("expected report for deprecation")
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Print(err)
|
|
|
|
// Output: StaticEmbeddedGzip is DEPRECATED and it will be removed eventually.
|
|
|
|
// It is also miss the AssetInfo bindata function, which is required now.
|
2019-07-15 06:49:04 +02:00
|
|
|
// Source: ./deprecated_example_test.go:55
|
2019-06-21 18:43:25 +02:00
|
|
|
// Use .HandleDir("/static", "./assets", iris.DirOptions{Gzip: true, Asset: Asset, AssetInfo: AssetInfo, AssetNames: AssetNames}) instead.
|
|
|
|
}
|