view

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultInfoDelay = 4 * time.Second

Functions

This section is empty.

Types

type Grpc

type Grpc struct {
	Name string `cfg:"name" json:"name,omitempty"`
	Addr string `cfg:"addr" json:"addr,omitempty"`
}

type GrpcUI

type GrpcUI struct {
	// contains filtered or unexported fields
}

func (*GrpcUI) Get

func (m *GrpcUI) Get(name, addr string) *grpcui.GrpcUI

func (*GrpcUI) Set

func (m *GrpcUI) Set(name, addr, prefixPath string) *grpcui.GrpcUI

type GrpcUIMWrap

type GrpcUIMWrap struct {
	Name string
	Addr string

	GrpcUI *grpcui.GrpcUI
}
type Header struct {
	SetHeader    map[string]string `cfg:"set_header"`
	AddHeader    map[string]string `cfg:"add_header"`
	RemoveHeader []string          `cfg:"remove_header"`
}

type HeaderHolder added in v0.7.1

type HeaderHolder struct {
	Request  Header `cfg:"request"`
	Response Header `cfg:"response"`
}

type Home added in v0.7.3

type Home struct {
	// Type can be HTML or MARKDOWN
	Type    string `cfg:"type"    json:"type,omitempty"`
	Content string `cfg:"content" json:"content,omitempty"`
}

type Iframe added in v0.7.1

type Iframe struct {
	Name string `cfg:"name" json:"name,omitempty"`
	Path string `cfg:"path" json:"path,omitempty"`
	URL  string `cfg:"url"  json:"url,omitempty"`
}

type Info

type Info struct {
	Home            Home            `cfg:"home"             json:"home"`
	Iframe          []Iframe        `cfg:"iframe"           json:"iframe"`
	Page            []Page          `cfg:"page"             json:"page"`
	Grpc            []Grpc          `cfg:"grpc"             json:"grpc"`
	Swagger         []Swagger       `cfg:"swagger"          json:"swagger"`
	SwaggerSettings SwaggerSettings `cfg:"swagger_settings" json:"swagger_settings"`
}

type Page added in v0.7.1

type Page struct {
	Name   string       `cfg:"name"   json:"name,omitempty"`
	Path   string       `cfg:"path"   json:"path,omitempty"`
	URL    string       `cfg:"url"    json:"-"`
	Header HeaderHolder `cfg:"header" json:"-"`
	Host   bool         `cfg:"host"   json:"-"`
}

Page for iframe view.

type PageUI added in v0.7.1

type PageUI struct {
	Handlers map[string]*httputil.ReverseProxy
}

type Swagger

type Swagger struct {
	Name                   string   `cfg:"name"                     json:"name,omitempty"`
	Link                   string   `cfg:"link"                     json:"link,omitempty"`
	Schemes                []string `cfg:"schemes"                  json:"schemes,omitempty"`
	Host                   string   `cfg:"host"                     json:"host,omitempty"`
	BasePath               string   `cfg:"base_path"                json:"base_path,omitempty"`
	BasePathPrefix         string   `cfg:"base_path_prefix"         json:"base_path_prefix,omitempty"`
	DisableAuthorizeButton *bool    `cfg:"disable_authorize_button" json:"disable_authorize_button,omitempty"`
}

type SwaggerSettings

type SwaggerSettings struct {
	Schemes                []string `cfg:"schemes"                  json:"schemes,omitempty"`
	Host                   string   `cfg:"host"                     json:"host,omitempty"`
	BasePath               string   `cfg:"base_path"                json:"base_path,omitempty"`
	BasePathPrefix         string   `cfg:"base_path_prefix"         json:"base_path_prefix,omitempty"`
	DisableAuthorizeButton bool     `cfg:"disable_authorize_button" json:"disable_authorize_button,omitempty"`
}

type View

type View struct {
	PrefixPath         string `cfg:"prefix_path"`
	Info               Info   `cfg:"info"`
	InfoURL            string `cfg:"info_url"`
	InfoURLType        string `cfg:"info_url_type"`
	InsecureSkipVerify bool   `cfg:"insecure_skip_verify"`
	// contains filtered or unexported fields
}

func (*View) GetInfo

func (m *View) GetInfo(ctx context.Context) (Info, error)

func (*View) GrpcUI

func (m *View) GrpcUI(w http.ResponseWriter, r *http.Request, name string)

func (*View) InformationUI

func (m *View) InformationUI(w http.ResponseWriter, r *http.Request)

func (*View) Middleware

func (m *View) Middleware(_ context.Context, _ string) (func(http.Handler) http.Handler, error)

func (*View) Page added in v0.7.1

func (m *View) Page(w http.ResponseWriter, r *http.Request, name string)

func (*View) SetPageUI added in v0.7.1

func (m *View) SetPageUI(pages []Page) error

func (*View) SetView

func (m *View) SetView() (func(http.Handler) http.Handler, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL