client

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIToken added in v0.2.0

type APIToken struct {
	ID     int    `json:"id"`
	Name   string `json:"name"`
	Expiry string `json:"expiry,omitempty"` // ISO 8601 format, optional
}

type AuditLog added in v0.2.0

type AuditLog struct {
	ID        int    `json:"id"`
	Timestamp string `json:"timestamp"`
	Level     string `json:"level"`
	Actor     string `json:"actor"`
	Action    string `json:"action"`
	IP        string `json:"ip"`
	Details   string `json:"details"`
}

type Client

type Client struct {
	Requester Requester
	// contains filtered or unexported fields
}

A Client knows how to talk to the the Ella Core API.

func New

func New(config *Config) (*Client, error)

func (*Client) CreateDataNetwork added in v0.1.0

func (c *Client) CreateDataNetwork(ctx context.Context, opts *CreateDataNetworkOptions) error

func (*Client) CreateMyAPIToken added in v0.2.0

func (c *Client) CreateMyAPIToken(ctx context.Context, opts *CreateAPITokenOptions) (*CreateAPITokenResponse, error)

func (*Client) CreatePolicy added in v0.1.0

func (c *Client) CreatePolicy(ctx context.Context, opts *CreatePolicyOptions) error

func (*Client) CreateRoute

func (c *Client) CreateRoute(ctx context.Context, opts *CreateRouteOptions) error

func (*Client) CreateSubscriber

func (c *Client) CreateSubscriber(ctx context.Context, opts *CreateSubscriberOptions) error

func (*Client) CreateUser

func (c *Client) CreateUser(ctx context.Context, opts *CreateUserOptions) error

func (*Client) DeleteDataNetwork added in v0.1.0

func (c *Client) DeleteDataNetwork(ctx context.Context, opts *DeleteDataNetworkOptions) error

func (*Client) DeleteMyAPIToken added in v0.2.0

func (c *Client) DeleteMyAPIToken(ctx context.Context, tokenID string) error

func (*Client) DeletePolicy added in v0.1.0

func (c *Client) DeletePolicy(ctx context.Context, opts *DeletePolicyOptions) error

func (*Client) DeleteRoute

func (c *Client) DeleteRoute(ctx context.Context, opts *DeleteRouteOptions) error

func (*Client) DeleteSubscriber

func (c *Client) DeleteSubscriber(ctx context.Context, opts *DeleteSubscriberOptions) error

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, opts *DeleteUserOptions) error

func (*Client) GetAuditLogRetentionPolicy added in v0.2.0

func (c *Client) GetAuditLogRetentionPolicy(ctx context.Context) (*GetAuditLogsRetentionPolicy, error)

func (*Client) GetDataNetwork added in v0.1.0

func (c *Client) GetDataNetwork(ctx context.Context, opts *GetDataNetworkOptions) (*DataNetwork, error)

func (*Client) GetMetrics

func (c *Client) GetMetrics(ctx context.Context) (map[string]float64, error)

GetMetrics retrieves the metrics from the server and returns a map where keys are metric names and values are their corresponding float values.

func (*Client) GetNATInfo added in v0.3.0

func (c *Client) GetNATInfo(ctx context.Context) (*GetNATInfoResponse, error)

func (*Client) GetOperator

func (c *Client) GetOperator(ctx context.Context) (*Operator, error)

func (*Client) GetPolicy added in v0.1.0

func (c *Client) GetPolicy(ctx context.Context, opts *GetPolicyOptions) (*Policy, error)

func (*Client) GetRadio

func (c *Client) GetRadio(ctx context.Context, opts *GetRadioOptions) (*Radio, error)

func (*Client) GetRadioLogRetentionPolicy added in v0.3.0

func (c *Client) GetRadioLogRetentionPolicy(ctx context.Context) (*GetRadioLogsRetentionPolicy, error)

func (*Client) GetRoute

func (c *Client) GetRoute(ctx context.Context, opts *GetRouteOptions) (*Route, error)

func (*Client) GetStatus

func (c *Client) GetStatus(ctx context.Context) (*Status, error)

func (*Client) GetSubscriber

func (c *Client) GetSubscriber(ctx context.Context, opts *GetSubscriberOptions) (*Subscriber, error)

func (*Client) GetSubscriberLogRetentionPolicy added in v0.3.0

func (c *Client) GetSubscriberLogRetentionPolicy(ctx context.Context) (*GetSubscriberLogsRetentionPolicy, error)

func (*Client) GetToken

func (c *Client) GetToken() string

func (*Client) ListAuditLogs added in v0.2.0

func (c *Client) ListAuditLogs(ctx context.Context, p *ListParams) (*ListAuditLogsResponse, error)

func (*Client) ListDataNetworks added in v0.1.0

func (c *Client) ListDataNetworks(ctx context.Context, p *ListParams) (*ListDataNetworksResponse, error)

func (*Client) ListMyAPITokens added in v0.2.0

func (c *Client) ListMyAPITokens(ctx context.Context, p *ListParams) (*ListAPITokensResponse, error)

func (*Client) ListPolicies added in v0.1.0

func (c *Client) ListPolicies(ctx context.Context, p *ListParams) (*ListPoliciesResponse, error)

func (*Client) ListRadioLogs added in v0.3.0

func (c *Client) ListRadioLogs(ctx context.Context, p *ListParams) (*ListRadioLogsResponse, error)

func (*Client) ListRadios

func (c *Client) ListRadios(ctx context.Context, p *ListParams) (*ListRadiosResponse, error)

func (*Client) ListRoutes

func (c *Client) ListRoutes(ctx context.Context, p *ListParams) (*ListRoutesResponse, error)

func (*Client) ListSubscriberLogs added in v0.3.0

func (c *Client) ListSubscriberLogs(ctx context.Context, p *ListParams) (*ListSubscriberLogsResponse, error)

func (*Client) ListSubscribers

func (c *Client) ListSubscribers(ctx context.Context, p *ListParams) (*ListSubscribersResponse, error)

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context, p *ListParams) (*ListUsersResponse, error)

func (*Client) Login

func (c *Client) Login(ctx context.Context, opts *LoginOptions) error

Login authenticates the user with the provided email and password. It stores the token in the client for future requests.

func (*Client) Refresh added in v0.3.0

func (c *Client) Refresh(ctx context.Context) error

func (*Client) SetToken added in v0.2.0

func (c *Client) SetToken(token string)

func (*Client) UpdateAuditLogRetentionPolicy added in v0.2.0

func (c *Client) UpdateAuditLogRetentionPolicy(ctx context.Context, opts *UpdateAuditLogsRetentionPolicyOptions) error

func (*Client) UpdateNATInfo added in v0.3.0

func (c *Client) UpdateNATInfo(ctx context.Context, opts *UpdateNATInfoOptions) error

func (*Client) UpdateOperatorID

func (c *Client) UpdateOperatorID(ctx context.Context, opts *UpdateOperatorIDOptions) error

func (*Client) UpdateOperatorSlice

func (c *Client) UpdateOperatorSlice(ctx context.Context, opts *UpdateOperatorSliceOptions) error

func (*Client) UpdateOperatorTracking

func (c *Client) UpdateOperatorTracking(ctx context.Context, opts *UpdateOperatorTrackingOptions) error

func (*Client) UpdateRadioLogRetentionPolicy added in v0.3.0

func (c *Client) UpdateRadioLogRetentionPolicy(ctx context.Context, opts *UpdateRadioLogsRetentionPolicyOptions) error

func (*Client) UpdateSubscriberLogRetentionPolicy added in v0.3.0

func (c *Client) UpdateSubscriberLogRetentionPolicy(ctx context.Context, opts *UpdateSubscriberLogsRetentionPolicyOptions) error

type Config

type Config struct {
	// BaseURL contains the base URL where Ella Core is expected to be.
	BaseURL string
	// APIToken is the API token used for authentication.
	APIToken string
	// TLSConfig is an optional TLS configuration.
	TLSConfig *tls.Config
}

Config allows the user to customize client behavior.

type ConnectionError

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

ConnectionError represents a connection or communication error.

func (ConnectionError) Error

func (e ConnectionError) Error() string

func (ConnectionError) Unwrap

func (e ConnectionError) Unwrap() error

type CreateAPITokenOptions added in v0.2.0

type CreateAPITokenOptions struct {
	Name   string `json:"name"`
	Expiry string `json:"expiry,omitempty"` // ISO 8601 format, optional
}

type CreateAPITokenResponse added in v0.2.0

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

type CreateDataNetworkOptions added in v0.1.0

type CreateDataNetworkOptions struct {
	Name   string `json:"name"`
	IPPool string `json:"ip_pool"`
	DNS    string `json:"dns"`
	Mtu    int32  `json:"mtu"`
}

type CreatePolicyOptions added in v0.1.0

type CreatePolicyOptions struct {
	Name            string `json:"name"`
	BitrateUplink   string `json:"bitrate_uplink"`
	BitrateDownlink string `json:"bitrate_downlink"`
	Var5qi          int32  `json:"var5qi"`
	PriorityLevel   int32  `json:"priority_level"`
	DataNetworkName string `json:"data_network_name"`
}

type CreateRouteOptions

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

type CreateSubscriberOptions

type CreateSubscriberOptions struct {
	Imsi           string `json:"imsi"`
	Key            string `json:"key"`
	SequenceNumber string `json:"sequenceNumber"`
	PolicyName     string `json:"policyName"`
	OPc            string `json:"opc,omitempty"`
}

type CreateUserOptions

type CreateUserOptions struct {
	Email    string `json:"email"`
	RoleID   RoleID `json:"role_id"`
	Password string `json:"password"`
}

type DataNetwork added in v0.1.0

type DataNetwork struct {
	Name   string `json:"name"`
	IPPool string `json:"ip_pool"`
	DNS    string `json:"dns"`
	Mtu    int32  `json:"mtu"`
}

type DeleteDataNetworkOptions added in v0.1.0

type DeleteDataNetworkOptions struct {
	Name string `json:"name"`
}

type DeletePolicyOptions added in v0.1.0

type DeletePolicyOptions struct {
	Name string `json:"name"`
}

type DeleteRouteOptions

type DeleteRouteOptions struct {
	ID int64 `json:"id"`
}

type DeleteSubscriberOptions

type DeleteSubscriberOptions struct {
	ID string `json:"id"`
}

type DeleteUserOptions

type DeleteUserOptions struct {
	Email string `json:"email"`
}

type GetAuditLogsRetentionPolicy added in v0.2.0

type GetAuditLogsRetentionPolicy struct {
	Days int `json:"days"`
}

type GetDataNetworkOptions added in v0.1.0

type GetDataNetworkOptions struct {
	Name string `json:"name"`
}

type GetNATInfoResponse added in v0.3.0

type GetNATInfoResponse struct {
	Enabled bool `json:"enabled,omitempty"`
}

type GetOperatorHomeNetworkResponse

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

type GetOperatorIDResponse

type GetOperatorIDResponse struct {
	Mcc string `json:"mcc,omitempty"`
	Mnc string `json:"mnc,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 GetPolicyOptions added in v0.1.0

type GetPolicyOptions struct {
	Name string `json:"name"`
}

type GetRadioLogsRetentionPolicy added in v0.3.0

type GetRadioLogsRetentionPolicy struct {
	Days int `json:"days"`
}

type GetRadioOptions

type GetRadioOptions struct {
	Name string `json:"name"`
}

type GetRouteOptions

type GetRouteOptions struct {
	ID int64 `json:"id"`
}

type GetSubscriberLogsRetentionPolicy added in v0.3.0

type GetSubscriberLogsRetentionPolicy struct {
	Days int `json:"days"`
}

type GetSubscriberOptions

type GetSubscriberOptions struct {
	ID string `json:"id"`
}

type ListAPITokensResponse added in v0.3.0

type ListAPITokensResponse struct {
	Items      []APIToken `json:"items"`
	Page       int        `json:"page"`
	PerPage    int        `json:"per_page"`
	TotalCount int        `json:"total_count"`
}

type ListAuditLogsResponse added in v0.3.0

type ListAuditLogsResponse struct {
	Items      []AuditLog `json:"items"`
	Page       int        `json:"page"`
	PerPage    int        `json:"per_page"`
	TotalCount int        `json:"total_count"`
}

type ListDataNetworksResponse added in v0.3.0

type ListDataNetworksResponse struct {
	Items      []DataNetwork `json:"items"`
	Page       int           `json:"page"`
	PerPage    int           `json:"per_page"`
	TotalCount int           `json:"total_count"`
}

type ListParams added in v0.3.0

type ListParams struct {
	Page    int `json:"page"`
	PerPage int `json:"per_page"`
}

type ListPoliciesResponse added in v0.3.0

type ListPoliciesResponse struct {
	Items      []Policy `json:"items"`
	Page       int      `json:"page"`
	PerPage    int      `json:"per_page"`
	TotalCount int      `json:"total_count"`
}

type ListRadioLogsResponse added in v0.3.0

type ListRadioLogsResponse struct {
	Items      []RadioLog `json:"items"`
	Page       int        `json:"page"`
	PerPage    int        `json:"per_page"`
	TotalCount int        `json:"total_count"`
}

type ListRadiosResponse added in v0.3.0

type ListRadiosResponse struct {
	Items      []Radio `json:"items"`
	Page       int     `json:"page"`
	PerPage    int     `json:"per_page"`
	TotalCount int     `json:"total_count"`
}

type ListRoutesResponse added in v0.3.0

type ListRoutesResponse struct {
	Items      []Route `json:"items"`
	Page       int     `json:"page"`
	PerPage    int     `json:"per_page"`
	TotalCount int     `json:"total_count"`
}

type ListSubscriberLogsResponse added in v0.3.0

type ListSubscriberLogsResponse struct {
	Items      []SubscriberLog `json:"items"`
	Page       int             `json:"page"`
	PerPage    int             `json:"per_page"`
	TotalCount int             `json:"total_count"`
}

type ListSubscribersResponse added in v0.3.0

type ListSubscribersResponse struct {
	Items      []Subscriber `json:"items"`
	Page       int          `json:"page"`
	PerPage    int          `json:"per_page"`
	TotalCount int          `json:"total_count"`
}

type ListUsersResponse added in v0.3.0

type ListUsersResponse struct {
	Items      []User `json:"items"`
	Page       int    `json:"page"`
	PerPage    int    `json:"per_page"`
	TotalCount int    `json:"total_count"`
}

type LoginOptions

type LoginOptions struct {
	Email    string
	Password string
}

type Operator

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

type PlmnID

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

type Policy added in v0.1.0

type Policy struct {
	Name            string `json:"name"`
	BitrateUplink   string `json:"bitrate_uplink"`
	BitrateDownlink string `json:"bitrate_downlink"`
	Var5qi          int32  `json:"var5qi"`
	PriorityLevel   int32  `json:"priority_level"`
	DataNetworkName string `json:"data_network_name"`
}

type Radio

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

type RadioLog added in v0.3.0

type RadioLog struct {
	ID        int    `json:"id"`
	Timestamp string `json:"timestamp"`
	Level     string `json:"level"`
	RanID     string `json:"ran_id"`
	Event     string `json:"event"`
	Details   string `json:"details"`
}

type RefreshResponseResult added in v0.3.0

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

type RequestError

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

RequestError is returned when there's an error processing the request.

func (RequestError) Error

func (e RequestError) Error() string

type RequestOptions

type RequestOptions struct {
	Type    RequestType
	Method  string
	Path    string
	Query   url.Values
	Headers map[string]string
	Body    io.Reader
}

type RequestResponse

type RequestResponse struct {
	StatusCode int
	Headers    http.Header
	// Result can contain request specific JSON data. The result can be
	// unmarshalled into the expected type using the DecodeResult method.
	Result []byte
	// Body is only set for request type RawRequest.
	Body io.ReadCloser
}

func (*RequestResponse) DecodeResult

func (resp *RequestResponse) DecodeResult(result any) error

DecodeResult decodes the endpoint-specific result payload that is included as part of sync and async request responses.

type RequestType

type RequestType int
const (
	RawRequest RequestType = iota
	SyncRequest
)

type Requester

type Requester interface {
	// Do performs the HTTP transaction using the provided options.
	Do(ctx context.Context, opts *RequestOptions) (*RequestResponse, error)
}

type RoleID added in v0.0.20

type RoleID int
const (
	RoleAdmin          RoleID = 1
	RoleReadOnly       RoleID = 2
	RoleNetworkManager RoleID = 3
)

type Route

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

type Snssai

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

type Status

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

type Subscriber

type Subscriber struct {
	Imsi           string           `json:"imsi"`
	Opc            string           `json:"opc"`
	SequenceNumber string           `json:"sequenceNumber"`
	Key            string           `json:"key"`
	PolicyName     string           `json:"policyName"`
	Status         SubscriberStatus `json:"status"`
}

type SubscriberLog added in v0.3.0

type SubscriberLog struct {
	ID        int    `json:"id"`
	Timestamp string `json:"timestamp"`
	Level     string `json:"level"`
	IMSI      string `json:"imsi"`
	Event     string `json:"event"`
	Details   string `json:"details"`
}

type SubscriberSession added in v0.1.0

type SubscriberSession struct {
	IPAddress string `json:"ipAddress"`
}

type SubscriberStatus added in v0.1.0

type SubscriberStatus struct {
	Registered bool                `json:"registered"`
	Sessions   []SubscriberSession `json:"sessions"`
}

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 UpdateAuditLogsRetentionPolicyOptions added in v0.2.0

type UpdateAuditLogsRetentionPolicyOptions struct {
	Days int `json:"days"`
}

type UpdateNATInfoOptions added in v0.3.0

type UpdateNATInfoOptions struct {
	Enabled bool `json:"enabled"`
}

type UpdateOperatorIDOptions

type UpdateOperatorIDOptions struct {
	Mcc string
	Mnc string
}

type UpdateOperatorSliceOptions

type UpdateOperatorSliceOptions struct {
	Sst int
	Sd  int
}

type UpdateOperatorTrackingOptions

type UpdateOperatorTrackingOptions struct {
	SupportedTacs []string
}

type UpdateRadioLogsRetentionPolicyOptions added in v0.3.0

type UpdateRadioLogsRetentionPolicyOptions struct {
	Days int `json:"days"`
}

type UpdateSubscriberLogsRetentionPolicyOptions added in v0.3.0

type UpdateSubscriberLogsRetentionPolicyOptions struct {
	Days int `json:"days"`
}

type User

type User struct {
	Email  string `json:"email"`
	RoleID RoleID `json:"role_id"`
}

Jump to

Keyboard shortcuts

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