Documentation
¶
Index ¶
- func MarshalRoute(route Route) (string, error)
- type LogSession
- type MemoryStorage
- func (ms *MemoryStorage) AddRoute(route Route) error
- func (ms *MemoryStorage) AddRoutes(routes []Route) error
- func (ms *MemoryStorage) GetRouteById(Id string) (*Route, error)
- func (ms *MemoryStorage) GetRoutes() ([]Route, error)
- func (ms *MemoryStorage) GetSession(key string) (value LogSession, err error)
- func (ms *MemoryStorage) HealthCheck() error
- func (ms *MemoryStorage) Init(url string) error
- func (ms *MemoryStorage) RemoveRoute(route Route) error
- func (ms *MemoryStorage) SetSession(key string, value LogSession, duration time.Duration) error
- type PostgresStorage
- func (rs *PostgresStorage) AddRoute(route Route) error
- func (rs *PostgresStorage) AddRoutes(routes []Route) (err error)
- func (rs *PostgresStorage) Close()
- func (rs *PostgresStorage) GetRouteById(Id string) (*Route, error)
- func (rs *PostgresStorage) GetRoutes() ([]Route, error)
- func (rs *PostgresStorage) GetSession(key string) (value LogSession, err error)
- func (rs *PostgresStorage) HealthCheck() error
- func (rs *PostgresStorage) Init(url string) error
- func (rs *PostgresStorage) RemoveRoute(route Route) error
- func (rs *PostgresStorage) SetSession(key string, value LogSession, duration time.Duration) error
- type RedisStorage
- func (rs *RedisStorage) AddRoute(route Route) error
- func (rs *RedisStorage) AddRoutes(routes []Route) error
- func (rs *RedisStorage) GetRouteById(Id string) (*Route, error)
- func (rs *RedisStorage) GetRoutes() ([]Route, error)
- func (rs *RedisStorage) GetSession(key string) (value LogSession, err error)
- func (rs *RedisStorage) HealthCheck() error
- func (rs *RedisStorage) Init(url string) error
- func (rs *RedisStorage) RemoveRoute(route Route) error
- func (rs *RedisStorage) SetSession(key string, value LogSession, duration time.Duration) error
- type Route
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalRoute ¶
Types ¶
type LogSession ¶
type MemoryStorage ¶
type MemoryStorage struct { Storage // contains filtered or unexported fields }
func (*MemoryStorage) AddRoute ¶
func (ms *MemoryStorage) AddRoute(route Route) error
func (*MemoryStorage) AddRoutes ¶
func (ms *MemoryStorage) AddRoutes(routes []Route) error
func (*MemoryStorage) GetRouteById ¶
func (ms *MemoryStorage) GetRouteById(Id string) (*Route, error)
func (*MemoryStorage) GetRoutes ¶
func (ms *MemoryStorage) GetRoutes() ([]Route, error)
func (*MemoryStorage) GetSession ¶
func (ms *MemoryStorage) GetSession(key string) (value LogSession, err error)
func (*MemoryStorage) HealthCheck ¶
func (ms *MemoryStorage) HealthCheck() error
func (*MemoryStorage) Init ¶
func (ms *MemoryStorage) Init(url string) error
Url is just a dummy interface.
func (*MemoryStorage) RemoveRoute ¶
func (ms *MemoryStorage) RemoveRoute(route Route) error
func (*MemoryStorage) SetSession ¶
func (ms *MemoryStorage) SetSession(key string, value LogSession, duration time.Duration) error
type PostgresStorage ¶
type PostgresStorage struct { Storage // contains filtered or unexported fields }
func (*PostgresStorage) AddRoute ¶
func (rs *PostgresStorage) AddRoute(route Route) error
func (*PostgresStorage) AddRoutes ¶
func (rs *PostgresStorage) AddRoutes(routes []Route) (err error)
func (*PostgresStorage) Close ¶
func (rs *PostgresStorage) Close()
func (*PostgresStorage) GetRouteById ¶
func (rs *PostgresStorage) GetRouteById(Id string) (*Route, error)
func (*PostgresStorage) GetRoutes ¶
func (rs *PostgresStorage) GetRoutes() ([]Route, error)
func (*PostgresStorage) GetSession ¶
func (rs *PostgresStorage) GetSession(key string) (value LogSession, err error)
func (*PostgresStorage) HealthCheck ¶
func (rs *PostgresStorage) HealthCheck() error
func (*PostgresStorage) Init ¶
func (rs *PostgresStorage) Init(url string) error
func (*PostgresStorage) RemoveRoute ¶
func (rs *PostgresStorage) RemoveRoute(route Route) error
func (*PostgresStorage) SetSession ¶
func (rs *PostgresStorage) SetSession(key string, value LogSession, duration time.Duration) error
type RedisStorage ¶
type RedisStorage struct { Storage // contains filtered or unexported fields }
func (*RedisStorage) AddRoute ¶
func (rs *RedisStorage) AddRoute(route Route) error
func (*RedisStorage) AddRoutes ¶
func (rs *RedisStorage) AddRoutes(routes []Route) error
func (*RedisStorage) GetRouteById ¶
func (rs *RedisStorage) GetRouteById(Id string) (*Route, error)
func (*RedisStorage) GetRoutes ¶
func (rs *RedisStorage) GetRoutes() ([]Route, error)
func (*RedisStorage) GetSession ¶
func (rs *RedisStorage) GetSession(key string) (value LogSession, err error)
func (*RedisStorage) HealthCheck ¶
func (rs *RedisStorage) HealthCheck() error
func (*RedisStorage) Init ¶
func (rs *RedisStorage) Init(url string) error
func (*RedisStorage) RemoveRoute ¶
func (rs *RedisStorage) RemoveRoute(route Route) error
func (*RedisStorage) SetSession ¶
func (rs *RedisStorage) SetSession(key string, value LogSession, duration time.Duration) error
type Route ¶
type Route struct { Id string `json:"id"` Space string `json:"space,omitempty"` App string `json:"app,omitempty"` Site string `json:"site,omitempty"` Created time.Time `json:"created"` Updated time.Time `json:"updated"` DestinationUrl string `json:"url"` }
func UnmarshalRoute ¶
func (*Route) GetRouteKey ¶
func (*Route) GetRouteString ¶
type Storage ¶
type Storage interface { HealthCheck() error Init(url string) error SetSession(key string, value LogSession, duration time.Duration) error GetSession(key string) (LogSession, error) GetRoutes() ([]Route, error) GetRouteById(id string) (*Route, error) RemoveRoute(route Route) error AddRoute(route Route) error AddRoutes([]Route) error Close() }
Click to show internal directories.
Click to hide internal directories.