server

package
v0.0.0-...-f5bcdd4 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedConfig

type CompletedConfig struct {
	*Config
}

CompletedConfig is the completed configuration for GenericAPIServer.

func (CompletedConfig) New

New returns a new instance of GenericAPIServer from the given configs.

type Config

type Config struct {
	SecureServing *SecureServingInfo
	Mode          string
	Id            int64
}

Config is a structure used to configure a GenericAPIServer. Its members are sorted roughly in order of importance for composers.

func NewConfig

func NewConfig() *Config

NewConfig returns a Config struct with the default values.

func (*Config) Complete

func (c *Config) Complete() CompletedConfig

Complete fills in any fields not set that are required to have valid data and can be derived from other fields. If you're going to `ApplyOptions`, do that first. It's mutating the receiver.

type GenericAPIServer

type GenericAPIServer struct {
	// SecureServingInfo holds configuration of the TLS server.
	SecureServingInfo *SecureServingInfo

	// ShutdownTimeout is the timeout used for server shutdown. This specifies the timeout before server
	// gracefully shutdown returns.
	ShutdownTimeout time.Duration

	*gin.Engine
	// contains filtered or unexported fields
}

APIServer contains state for an iam api server.

func (*GenericAPIServer) Run

func (s *GenericAPIServer) Run() error

Run spawns the http server. It only returns when the port cannot be listened on initially.

func (GenericAPIServer) Setup

func (s GenericAPIServer) Setup()

type SecureServingInfo

type SecureServingInfo struct {
	BindAddress string
	BindPort    int
}

SecureServingInfo holds configuration of the TLS server.

func (*SecureServingInfo) Address

func (s *SecureServingInfo) Address() string

Address join host IP address and host port number into a address string, like: 0.0.0.0:8443.

type Snowflake

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

Snowflake represents a distributed unique ID generator.

var SnowflakeSrv *Snowflake

func NewSnowflake

func NewSnowflake(machineID int64) (*Snowflake, error)

New creates a new Snowflake instance with the given machine ID.

func (*Snowflake) NextID

func (s *Snowflake) NextID() int64

NextID generates the next unique ID.

Jump to

Keyboard shortcuts

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