shared

package module
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: AGPL-3.0 Imports: 6 Imported by: 3

README

ogbcommon

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadYAMLConfig

func ReadYAMLConfig(filePath string, config interface{}) error

ReadYAMLConfig reads a YAML configuration file and unmarshals it into the provided interface config parameter should be a pointer to a struct that matches the YAML structure

func SetLogLevel

func SetLogLevel(level string) error

SetLogLevel sets the global logging level

Types

type Endpoint added in v0.10.0

type Endpoint interface {
	Init(EndpointConfig) error
	GetUri() string
	GetHttpMethod() string
	IsSkipAuth() bool
	HandleRequest(*proto.Packet) (*proto.Response, error)
}

type EndpointConfig added in v0.10.0

type EndpointConfig struct {
	Uri        string `yaml:"uri"`
	HttpMethod string `yaml:"http_method"`
	SkipAuth   string `yaml:"skip_auth"`
}

type Service added in v0.10.0

type Service interface {
	Init(ServiceConfig) error
	RegisterEndpoint(*Endpoint) error
	Start() error
}

type ServiceConfig added in v0.10.0

type ServiceConfig struct {
	Hostname string `yaml:"hostname"` // Listening RPC hostname
	Port     uint16 `yaml:"port"`     // Listening RPC port
}

Directories

Path Synopsis
proto module

Jump to

Keyboard shortcuts

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