server

package
v0.0.4-dev Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 28 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeToMap

func DecodeToMap(s *pb.Struct) map[string]interface{}

DecodeToMap converts a pb.Struct to a map from strings to Go types. DecodeToMap panics if s is invalid.

Types

type AccessLogServer

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

AccessLogServer server

func (*AccessLogServer) Register

func (a *AccessLogServer) Register(s *grpc.Server, handler *Handler)

Register registers

func (*AccessLogServer) StreamAccessLogs

StreamAccessLogs streams

type AnalyticsConfig

type AnalyticsConfig struct {
	LegacyEndpoint     bool          `yaml:"legacy_endpoint,omitempty"`
	FileLimit          int           `yaml:"file_limit,omitempty"`
	SendChannelSize    int           `yaml:"send_channel_size,omitempty"`
	CollectionInterval time.Duration `yaml:"collection_interval,omitempty"`
	FluentdEndpoint    string        `yaml:"fluentd_endpoint,omitempty"`
	TLS                TLSConfig     `yaml:"tls,omitempty"`
}

AnalyticsConfig is analytics-related config

type AuthConfig

type AuthConfig struct {
	APIKeyClaim         string        `yaml:"api_key_claim,omitempty"`
	APIKeyCacheDuration time.Duration `yaml:"api_key_cache_duration,omitempty"`
	JWKSPollInterval    time.Duration `yaml:"jwks_poll_interval,omitempty"`
	APIKeyHeader        string        `yaml:"api_key_header,omitempty"`
	TargetHeader        string        `yaml:"target_header,omitempty"`
	RejectUnauthorized  bool          `yaml:"reject_unauthorized,omitempty"`
}

AuthConfig is auth-related config

type AuthorizationServer

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

AuthorizationServer server

func (*AuthorizationServer) Check

Check does check

func (*AuthorizationServer) Register

func (a *AuthorizationServer) Register(s *grpc.Server, handler *Handler)

Register registers

type Config

type Config struct {
	Global    GlobalConfig    `yaml:"global,omitempty"`
	Tenant    TenantConfig    `yaml:"tenant,omitempty"`
	Products  ProductsConfig  `yaml:"products,omitempty"`
	Analytics AnalyticsConfig `yaml:"analytics,omitempty"`
	Auth      AuthConfig      `yaml:"auth,omitempty"`
}

Config is all config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with defaults set

func (*Config) Load

func (c *Config) Load(file string) error

Load config

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config

type GlobalConfig

type GlobalConfig struct {
	APIAddress                string        `yaml:"api_address,omitempty"`
	MetricsAddress            string        `yaml:"metrics_address,omitempty"`
	TempDir                   string        `yaml:"temp_dir,omitempty"`
	KeepAliveMaxConnectionAge time.Duration `yaml:"keep_alive_max_connection_age,omitempty"`
	TLS                       TLSConfig     `yaml:"tls,omitempty"`
}

GlobalConfig is global configuration for the server

type Handler

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

A Handler is the main entry

func NewHandler

func NewHandler(config *Config) (*Handler, error)

NewHandler creates a handler

func (*Handler) Environment

func (h *Handler) Environment() string

Environment is the tenant environment

func (*Handler) InternalAPI

func (h *Handler) InternalAPI() *url.URL

InternalAPI is the internal api base (legacy)

func (*Handler) Key

func (h *Handler) Key() string

Key is the access key for the remote service

func (*Handler) Organization

func (h *Handler) Organization() string

Organization is the tenant organization

func (*Handler) RemoteServiceAPI

func (h *Handler) RemoteServiceAPI() *url.URL

RemoteServiceAPI is the remote service base

func (*Handler) Secret

func (h *Handler) Secret() string

Secret is the access secret for the remote service

type ProductsConfig

type ProductsConfig struct {
	RefreshRate time.Duration `yaml:"refresh_rate,omitempty"`
}

ProductsConfig is products-related config

type TLSConfig

type TLSConfig struct {
	CAFile   string `yaml:"ca_file,omitempty"`
	KeyFile  string `yaml:"key_file,omitempty"`
	CertFile string `yaml:"cert_file,omitempty"`
}

TLSConfig is tls configuration

type TenantConfig

type TenantConfig struct {
	InternalAPI            string        `yaml:"internal_api,omitempty"`
	RemoteServiceAPI       string        `yaml:"remote_service_api"`
	OrgName                string        `yaml:"org_name"`
	EnvName                string        `yaml:"env_name"`
	Key                    string        `yaml:"key"`
	Secret                 string        `yaml:"secret"`
	ClientTimeout          time.Duration `yaml:"client_timeout,omitempty"`
	AllowUnverifiedSSLCert bool          `yaml:"allow_unverified_ssl_cert,omitempty"`
}

TenantConfig is config relating to an Apigee tentant

Jump to

Keyboard shortcuts

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