mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-11-21 18:36:25 +00:00
service: WithReact: use fs.FS instead of embed.FS
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
parent
9baceef381
commit
36f3c5bc81
@ -4,8 +4,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
"embed"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"io/fs"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
@ -326,7 +326,7 @@ func WithGatewayOpts(opts ...runtime.ServeMuxOption) Option {
|
|||||||
// WithReactUI add static single page app serving to the http server
|
// WithReactUI add static single page app serving to the http server
|
||||||
// subpath is the path in the read-only file embed.FS to use as root to serve
|
// subpath is the path in the read-only file embed.FS to use as root to serve
|
||||||
// static content
|
// static content
|
||||||
func WithReactUI(fs embed.FS, subpath string) Option {
|
func WithReactUI(fs fs.FS, subpath string) Option {
|
||||||
return func(o *options) {
|
return func(o *options) {
|
||||||
o.reactUI = fs
|
o.reactUI = fs
|
||||||
o.reactUISubPath = subpath
|
o.reactUISubPath = subpath
|
||||||
@ -375,7 +375,7 @@ type options struct {
|
|||||||
gatewayOpts []runtime.ServeMuxOption
|
gatewayOpts []runtime.ServeMuxOption
|
||||||
cors cors.Options
|
cors cors.Options
|
||||||
|
|
||||||
reactUI embed.FS
|
reactUI fs.FS
|
||||||
reactUISubPath string
|
reactUISubPath string
|
||||||
hasReactUI bool
|
hasReactUI bool
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user