server

package
v0.0.1-dev Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: Apache-2.0 Imports: 29 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"`
}

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"`
}

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

type GlobalConfig

type GlobalConfig struct {
	TempDir                   string        `yaml:"temp_dir,omitempty"`
	KeepAliveMaxConnectionAge time.Duration `yaml:"keep_alive_max_connection_age,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) Key

func (h *Handler) Key() string

Key is the access key for the remote service

func (*Handler) ManagementAPI

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

ManagementAPI is the management base

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 TenantConfig

type TenantConfig struct {
	ManagementAPI          string        `yaml:"management_api,omitempty"`
	RemoteServiceAPI       string        `yaml:"remote_service_api"`
	FluentdConfigFile      string        `yaml:"fluentd_config_file,omitempty"`
	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