model

package
v1.0.27 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Endpoint []Endpoint `yaml:"endpoint" json:"endpoint"`
}

App type

func (*App) ConvertToJSON

func (a *App) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*App) LoadFromJSON

func (a *App) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type AuthMethod

type AuthMethod struct {
	ID int `json:"id"`

	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
	Endpoints   string `json:"endpoints"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

AuthMethod struct

func (*AuthMethod) ConvertToJSON

func (a *AuthMethod) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*AuthMethod) GetEndpoints

func (a *AuthMethod) GetEndpoints() ([]string, error)

GetEndpoints gets a list of endpoints names

func (*AuthMethod) LoadFromJSON

func (a *AuthMethod) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*AuthMethod) Validate

func (a *AuthMethod) Validate() error

Validate validates a request payload

type AuthMethods

type AuthMethods struct {
	AuthMethods []AuthMethod `json:"authMethods"`
}

AuthMethods struct

func (*AuthMethods) ConvertToJSON

func (a *AuthMethods) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*AuthMethods) LoadFromJSON

func (a *AuthMethods) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type Authentication

type Authentication struct {
	Status bool `yaml:"status" json:"status"`
}

Authentication type

type BasicAuthData

type BasicAuthData struct {
	ID int `json:"id"`

	Name         string `json:"name"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	Meta         string `json:"meta"`
	AuthMethodID int    `json:"authMethodID"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

BasicAuthData struct

func (*BasicAuthData) ConvertToJSON

func (b *BasicAuthData) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*BasicAuthData) LoadFromJSON

func (b *BasicAuthData) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*BasicAuthData) Validate

func (b *BasicAuthData) Validate() error

Validate validates a request payload

type BasicAuthDataItems

type BasicAuthDataItems struct {
	BasicAuthDataItems []BasicAuthData `json:"items"`
}

BasicAuthDataItems struct

func (*BasicAuthDataItems) ConvertToJSON

func (b *BasicAuthDataItems) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*BasicAuthDataItems) LoadFromJSON

func (b *BasicAuthDataItems) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type CircuitBreaker

type CircuitBreaker struct {
	Status bool `yaml:"status" json:"status"`
}

CircuitBreaker type

type Configs

type Configs struct {
	App App `yaml:"app" json:"app"`
}

Configs type

func (*Configs) ConvertToJSON

func (c *Configs) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Configs) LoadFromJSON

func (c *Configs) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*Configs) LoadFromYAML

func (c *Configs) LoadFromYAML(data []byte) error

LoadFromYAML update instance from YAML

type DSN

type DSN struct {
	Driver   string `json:"driver"`
	Username string `json:"username"`
	Password string `json:"password"`
	Hostname string `json:"hostname"`
	Port     int    `json:"port"`
	Name     string `json:"name"`
}

DSN struct

func (*DSN) ConvertToJSON

func (d *DSN) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*DSN) LoadFromJSON

func (d *DSN) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*DSN) ToString

func (d *DSN) ToString() string

ToString gets the dsn string

type Endpoint

type Endpoint struct {
	Name   string `yaml:"name" json:"name"`
	Active bool   `yaml:"active" json:"active"`
	Proxy  Proxy  `yaml:"proxy" json:"proxy"`
}

Endpoint type

type KeyBasedAuthData

type KeyBasedAuthData struct {
	ID int `json:"id"`

	Name         string `json:"name"`
	APIKey       string `json:"apiKey"`
	Meta         string `json:"meta"`
	AuthMethodID int    `json:"authMethodID"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

KeyBasedAuthData struct

func (*KeyBasedAuthData) ConvertToJSON

func (k *KeyBasedAuthData) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*KeyBasedAuthData) LoadFromJSON

func (k *KeyBasedAuthData) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*KeyBasedAuthData) Validate

func (k *KeyBasedAuthData) Validate() error

Validate validates a request payload

type KeyBasedAuthDataItems

type KeyBasedAuthDataItems struct {
	KeyBasedAuthDataItems []KeyBasedAuthData `json:"items"`
}

KeyBasedAuthDataItems struct

func (*KeyBasedAuthDataItems) ConvertToJSON

func (k *KeyBasedAuthDataItems) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*KeyBasedAuthDataItems) LoadFromJSON

func (k *KeyBasedAuthDataItems) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type OAuthAccessData

type OAuthAccessData struct {
	ID int `json:"id"`

	AccessToken string `json:"accessToken"`
	Meta        string `json:"meta"`
	OAuthDataID int    `json:"oauthDataID"`

	ExpireAt  time.Time `json:"expireAt"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

OAuthAccessData struct

func (*OAuthAccessData) ConvertToJSON

func (o *OAuthAccessData) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*OAuthAccessData) LoadFromJSON

func (o *OAuthAccessData) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*OAuthAccessData) Validate

func (o *OAuthAccessData) Validate() error

Validate validates a request payload

type OAuthAccessDataItems

type OAuthAccessDataItems struct {
	OAuthAccessDataItems []OAuthAccessData `json:"items"`
}

OAuthAccessDataItems struct

func (*OAuthAccessDataItems) ConvertToJSON

func (o *OAuthAccessDataItems) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*OAuthAccessDataItems) LoadFromJSON

func (o *OAuthAccessDataItems) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type OAuthData

type OAuthData struct {
	ID int `json:"id"`

	Name         string `json:"name"`
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	Meta         string `json:"meta"`
	AuthMethodID int    `json:"authMethodID"`

	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

OAuthData struct

func (*OAuthData) ConvertToJSON

func (o *OAuthData) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*OAuthData) LoadFromJSON

func (o *OAuthData) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

func (*OAuthData) Validate

func (o *OAuthData) Validate() error

Validate validates a request payload

type OAuthDataItems

type OAuthDataItems struct {
	OAuthDataItems []OAuthData `json:"items"`
}

OAuthDataItems struct

func (*OAuthDataItems) ConvertToJSON

func (o *OAuthDataItems) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*OAuthDataItems) LoadFromJSON

func (o *OAuthDataItems) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type Option

type Option struct {
	ID        int       `json:"id"`
	Key       string    `json:"key"`
	Value     string    `json:"value"`
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

Option struct

func (*Option) ConvertToJSON

func (o *Option) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Option) LoadFromJSON

func (o *Option) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type Options

type Options struct {
	Options []Option `json:"options"`
}

Options struct

func (*Options) ConvertToJSON

func (o *Options) ConvertToJSON() (string, error)

ConvertToJSON convert object to json

func (*Options) LoadFromJSON

func (o *Options) LoadFromJSON(data []byte) error

LoadFromJSON update object from json

type Proxy

type Proxy struct {
	Upstreams      Upstreams      `yaml:"upstreams" json:"upstreams"`
	HTTPMethods    []string       `yaml:"http_methods" json:"httpMethods"`
	Authentication Authentication `yaml:"authentication" json:"authentication"`
	RateLimit      RateLimit      `yaml:"rate_limit" json:"rateLimit"`
	CircuitBreaker CircuitBreaker `yaml:"circuit_breaker" json:"circuitBreaker"`
	ListenPath     string         `yaml:"listen_path" json:"listenPath"`
}

Proxy type

type RateLimit

type RateLimit struct {
	Status bool `yaml:"status" json:"status"`
}

RateLimit type

type Targets

type Targets struct {
	Target string `yaml:"target" json:"target"`
}

Targets type

type Upstreams

type Upstreams struct {
	Balancing string    `yaml:"balancing" json:"balancing"`
	Targets   []Targets `yaml:"targets" json:"targets"`
}

Upstreams type

Jump to

Keyboard shortcuts

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