server

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoginAction       = "auth_login"
	LookupTokenAction = "auth_lookup_token" // #nosec G101
)
View Source
const (
	GetOperatorAction               = "get_operator"
	GetOperatorSliceAction          = "get_operator_slice"
	GetOperatorTrackingAction       = "get_operator_tracking"
	GetOperatorIDAction             = "get_operator_id"
	GetOperatorHomeNetworkAction    = "get_operator_home_network"
	UpdateOperatorSliceAction       = "update_operator_slice"
	UpdateOperatorTrackingAction    = "update_operator_tracking"
	UpdateOperatorIDAction          = "update_operator_id"
	UpdateOperatorCodeAction        = "update_operator_code"
	UpdateOperatorHomeNetworkAction = "update_operator_home_network"
)
View Source
const (
	ListProfilesAction  = "list_profiles"
	GetProfileAction    = "get_profile"
	CreateProfileAction = "create_profile"
	UpdateProfileAction = "update_profile"
	DeleteProfileAction = "delete_profile"
)
View Source
const (
	ListRadiosAction = "list_radios"
	GetRadioAction   = "get_radio"
)
View Source
const (
	ListRoutesAction  = "list_routes"
	GetRouteAction    = "get_route"
	CreateRouteAction = "create_route"
	DeleteRouteAction = "delete_route"
)
View Source
const (
	ListSubscribersAction  = "list_subscribers"
	GetSubscriberAction    = "get_subscriber"
	CreateSubscriberAction = "create_subscriber"
	UpdateSubscriberAction = "update_subscriber"
	DeleteSubscriberAction = "delete_subscriber"
)
View Source
const (
	ListUsersAction          = "list_users"
	GetUserAction            = "get_user"
	GetLoggedInUserAction    = "get_logged_in_user"
	CreateUserAction         = "create_user"
	UpdateUserAction         = "update_user"
	DeleteUserAction         = "delete_user"
	UpdateUserPasswordAction = "update_user_password"
)
View Source
const (
	NumRequests     = 100
	RequestsPerTime = time.Second
)
View Source
const AuthenticationAction = "user_authentication"
View Source
const BackupAction = "backup_database"
View Source
const GetStatusAction = "get_status"
View Source
const RestoreAction = "restore_database"
View Source
const TokenExpirationTime = time.Hour * 1

Variables

This section is empty.

Functions

func AddUIService added in v0.0.12

func AddUIService(engine *gin.Engine)

func Authenticate

func Authenticate(jwtSecret []byte) gin.HandlerFunc

func Backup

func Backup(dbInstance *db.Database) gin.HandlerFunc

func CreateProfile

func CreateProfile(dbInstance *db.Database) gin.HandlerFunc

func CreateRoute added in v0.0.9

func CreateRoute(dbInstance *db.Database, kernelInt kernel.Kernel) gin.HandlerFunc

func CreateSubscriber

func CreateSubscriber(dbInstance *db.Database) gin.HandlerFunc

func CreateUser

func CreateUser(dbInstance *db.Database) gin.HandlerFunc

func DeleteProfile

func DeleteProfile(dbInstance *db.Database) gin.HandlerFunc

func DeleteRoute added in v0.0.9

func DeleteRoute(dbInstance *db.Database, kernelInt kernel.Kernel) gin.HandlerFunc

func DeleteSubscriber

func DeleteSubscriber(dbInstance *db.Database) gin.HandlerFunc

func DeleteUser

func DeleteUser(dbInstance *db.Database) gin.HandlerFunc

func GenerateJWTSecret

func GenerateJWTSecret() ([]byte, error)

func GetLoggedInUser

func GetLoggedInUser(dbInstance *db.Database) gin.HandlerFunc

func GetMetrics

func GetMetrics() gin.HandlerFunc

func GetOperator

func GetOperator(dbInstance *db.Database) gin.HandlerFunc

func GetOperatorID added in v0.0.12

func GetOperatorID(dbInstance *db.Database) gin.HandlerFunc

func GetOperatorSlice

func GetOperatorSlice(dbInstance *db.Database) gin.HandlerFunc

func GetOperatorTracking

func GetOperatorTracking(dbInstance *db.Database) gin.HandlerFunc

func GetProfile

func GetProfile(dbInstance *db.Database) gin.HandlerFunc

func GetRadio

func GetRadio() gin.HandlerFunc

func GetRoute added in v0.0.9

func GetRoute(dbInstance *db.Database) gin.HandlerFunc

func GetStatus

func GetStatus(dbInstance *db.Database) gin.HandlerFunc

func GetSubscriber

func GetSubscriber(dbInstance *db.Database) gin.HandlerFunc

func GetUser

func GetUser(dbInstance *db.Database) gin.HandlerFunc

func ListProfiles

func ListProfiles(dbInstance *db.Database) gin.HandlerFunc

func ListRadios

func ListRadios() gin.HandlerFunc

func ListRoutes added in v0.0.9

func ListRoutes(dbInstance *db.Database) gin.HandlerFunc

func ListSubscribers

func ListSubscribers(dbInstance *db.Database) gin.HandlerFunc

func ListUsers

func ListUsers(dbInstance *db.Database) gin.HandlerFunc

func Login

func Login(dbInstance *db.Database, jwtSecret []byte) gin.HandlerFunc

func LookupToken

func LookupToken(dbInstance *db.Database, jwtSecret []byte) gin.HandlerFunc

func NewHandler

func NewHandler(dbInstance *db.Database, kernel kernel.Kernel, jwtSecret []byte, mode string, tracingEnabled bool) http.Handler

func RateLimitMiddleware added in v0.0.11

func RateLimitMiddleware() gin.HandlerFunc

RateLimitMiddleware is a Gin middleware that rate limits incoming requests based on the client IP.

func Require added in v0.0.10

func Require(allowedRoles ...Role) gin.HandlerFunc

Require checks if the user has the required role to access the resource The user will be allowed to access the resource if their role is in the allowedRoles list

func RequireAdminOrFirstUser

func RequireAdminOrFirstUser(db *db.Database, jwtSecret []byte) gin.HandlerFunc

func ResetVisitors added in v0.0.11

func ResetVisitors()

func Restore

func Restore(dbInstance *db.Database) gin.HandlerFunc

func Tracing added in v0.0.18

func Tracing(serviceName string) gin.HandlerFunc

func UpdateOperatorCode

func UpdateOperatorCode(dbInstance *db.Database) gin.HandlerFunc

func UpdateOperatorHomeNetwork

func UpdateOperatorHomeNetwork(dbInstance *db.Database) gin.HandlerFunc

func UpdateOperatorID added in v0.0.12

func UpdateOperatorID(dbInstance *db.Database) gin.HandlerFunc

func UpdateOperatorSlice

func UpdateOperatorSlice(dbInstance *db.Database) gin.HandlerFunc

func UpdateOperatorTracking

func UpdateOperatorTracking(dbInstance *db.Database) gin.HandlerFunc

func UpdateProfile

func UpdateProfile(dbInstance *db.Database) gin.HandlerFunc

func UpdateSubscriber

func UpdateSubscriber(dbInstance *db.Database) gin.HandlerFunc

func UpdateUser

func UpdateUser(dbInstance *db.Database) gin.HandlerFunc

func UpdateUserPassword

func UpdateUserPassword(dbInstance *db.Database) gin.HandlerFunc

Types

type CreateProfileParams

type CreateProfileParams struct {
	Name string `json:"name"`

	UeIPPool        string `json:"ue-ip-pool,omitempty"`
	DNS             string `json:"dns,omitempty"`
	Mtu             int32  `json:"mtu,omitempty"`
	BitrateUplink   string `json:"bitrate-uplink,omitempty"`
	BitrateDownlink string `json:"bitrate-downlink,omitempty"`
	Var5qi          int32  `json:"var5qi,omitempty"`
	PriorityLevel   int32  `json:"priority-level,omitempty"`
}

type CreateRouteParams added in v0.0.9

type CreateRouteParams struct {
	Destination string `json:"destination"`
	Gateway     string `json:"gateway"`
	Interface   string `json:"interface"`
	Metric      int    `json:"metric"`
}

type CreateSubscriberParams

type CreateSubscriberParams struct {
	Imsi           string `json:"imsi"`
	Key            string `json:"key"`
	Opc            string `json:"opc,omitempty"`
	SequenceNumber string `json:"sequenceNumber"`
	ProfileName    string `json:"profileName"`
}

type CreateSuccessResponse added in v0.0.9

type CreateSuccessResponse struct {
	Message string `json:"message"`
	ID      int64  `json:"id"`
}

type CreateUserParams

type CreateUserParams struct {
	Email    string `json:"email"`
	Password string `json:"password"`
	Role     string `json:"role"`
}

type GetOperatorHomeNetworkResponse

type GetOperatorHomeNetworkResponse struct {
	PublicKey string `json:"publicKey,omitempty"`
}

type GetOperatorIDResponse added in v0.0.12

type GetOperatorIDResponse struct {
	Mcc string `json:"mcc,omitempty"`
	Mnc string `json:"mnc,omitempty"`
}

type GetOperatorResponse

type GetOperatorResponse struct {
	ID          GetOperatorIDResponse          `json:"id,omitempty"`
	Slice       GetOperatorSliceResponse       `json:"slice,omitempty"`
	Tracking    GetOperatorTrackingResponse    `json:"tracking,omitempty"`
	HomeNetwork GetOperatorHomeNetworkResponse `json:"homeNetwork,omitempty"`
}

type GetOperatorSliceResponse

type GetOperatorSliceResponse struct {
	Sst int `json:"sst,omitempty"`
	Sd  int `json:"sd,omitempty"`
}

type GetOperatorTrackingResponse

type GetOperatorTrackingResponse struct {
	SupportedTacs []string `json:"supportedTacs,omitempty"`
}

type GetProfileResponse

type GetProfileResponse struct {
	Name string `json:"name"`

	UeIPPool        string `json:"ue-ip-pool,omitempty"`
	DNS             string `json:"dns,omitempty"`
	Mtu             int32  `json:"mtu,omitempty"`
	BitrateUplink   string `json:"bitrate-uplink,omitempty"`
	BitrateDownlink string `json:"bitrate-downlink,omitempty"`
	Var5qi          int32  `json:"var5qi,omitempty"`
	PriorityLevel   int32  `json:"priority-level,omitempty"`
}

type GetRadioParams

type GetRadioParams struct {
	Name          string         `json:"name"`
	ID            string         `json:"id"`
	Address       string         `json:"address"`
	SupportedTAIs []SupportedTAI `json:"supported_tais"`
}

type GetRouteResponse added in v0.0.9

type GetRouteResponse struct {
	ID          int64  `json:"id"`
	Destination string `json:"destination"`
	Gateway     string `json:"gateway"`
	Interface   string `json:"interface"`
	Metric      int    `json:"metric"`
}

type GetSubscriberResponse

type GetSubscriberResponse struct {
	Imsi           string `json:"imsi"`
	IPAddress      string `json:"ipAddress"`
	Opc            string `json:"opc"`
	SequenceNumber string `json:"sequenceNumber"`
	Key            string `json:"key"`
	ProfileName    string `json:"profileName"`
}

type GetUserParams

type GetUserParams struct {
	Email string `json:"email"`
	Role  string `json:"role"`
}

type LoginParams

type LoginParams struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginResponse

type LoginResponse struct {
	Token string `json:"token"`
}

type LookupTokenResponse

type LookupTokenResponse struct {
	Valid bool `json:"valid"`
}

type PlmnID added in v0.0.12

type PlmnID struct {
	Mcc string `json:"mcc"`
	Mnc string `json:"mnc"`
}

type Role

type Role string
const (
	AdminRole          Role = "admin"
	ReadOnlyRole       Role = "readonly"
	NetworkManagerRole Role = "network-manager"
)

type Snssai

type Snssai struct {
	Sst int32  `json:"sst"`
	Sd  string `json:"sd"`
}

type StatusResponse

type StatusResponse struct {
	Version     string `json:"version"`
	Initialized bool   `json:"initialized"`
}

type SuccessResponse

type SuccessResponse struct {
	Message string `json:"message"`
}

type SupportedTAI

type SupportedTAI struct {
	Tai     Tai      `json:"tai"`
	SNssais []Snssai `json:"snssais"`
}

type Tai

type Tai struct {
	PlmnID PlmnID `json:"plmnID"`
	Tac    string `json:"tac"`
}

type UpdateOperatorCodeParams

type UpdateOperatorCodeParams struct {
	OperatorCode string `json:"operatorCode,omitempty"`
}

type UpdateOperatorHomeNetworkParams

type UpdateOperatorHomeNetworkParams struct {
	PrivateKey string `json:"privateKey,omitempty"`
}

type UpdateOperatorIDParams added in v0.0.12

type UpdateOperatorIDParams struct {
	Mcc string `json:"mcc,omitempty"`
	Mnc string `json:"mnc,omitempty"`
}

type UpdateOperatorSliceParams

type UpdateOperatorSliceParams struct {
	Sst int `json:"sst,omitempty"`
	Sd  int `json:"sd,omitempty"`
}

type UpdateOperatorTrackingParams

type UpdateOperatorTrackingParams struct {
	SupportedTacs []string `json:"supportedTacs,omitempty"`
}

type UpdateSubscriberParams

type UpdateSubscriberParams struct {
	Imsi        string `json:"imsi"`
	ProfileName string `json:"profileName"`
}

type UpdateUserParams

type UpdateUserParams struct {
	Email string `json:"email"`
	Role  string `json:"role"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type Visitor added in v0.0.11

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

Jump to

Keyboard shortcuts

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