e2

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 16 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppID

type AppID string

AppID is an application identifier

type AppOptions

type AppOptions struct {
	// AppID is the application identifier
	AppID AppID
	// InstanceID is the application instance identifier
	InstanceID InstanceID
}

AppOptions are the options for the application

type Client

type Client interface {
	// Node returns a Node with the given NodeID
	Node(nodeID NodeID) Node
}

Client is an E2 client

func NewClient

func NewClient(opts ...Option) Client

NewClient creates a new E2 client

type EmptyOption

type EmptyOption struct{}

EmptyOption is an empty client option

type Encoding

type Encoding int

Encoding :

const (
	// ProtoEncoding protobuf
	ProtoEncoding Encoding = iota

	// ASN1Encoding asn1
	ASN1Encoding
)

type InstanceID

type InstanceID string

InstanceID is an app instance identifier

type Node

type Node interface {
	// ID is the node identifier
	ID() NodeID

	// Subscribe creates a subscription from the given SubscriptionDetails
	// The Subscribe method will block until the subscription is successfully registered.
	// The context.Context represents the lifecycle of this initial subscription process.
	// Once the subscription has been created and the method returns, indications will be written
	// to the given channel.
	// If the subscription is successful, a subscription.Context will be returned. The subscription
	// context can be used to cancel the subscription by calling Close() on the subscription.Context.
	Subscribe(ctx context.Context, name string, sub e2api.SubscriptionSpec, indCh chan<- e2api.Indication, opts ...SubscribeOption) (e2api.ChannelID, error)

	// Unsubscribe unsubscribes from the given subscription
	Unsubscribe(ctx context.Context, name string) error

	// Control creates and sends a E2 control message and awaits the outcome
	Control(ctx context.Context, message *e2api.ControlMessage) (*e2api.ControlOutcome, error)
}

Node is an E2 node

func NewNode

func NewNode(nodeID NodeID, opts ...Option) Node

NewNode creates a new E2 Node with the given ID

type NodeID

type NodeID string

NodeID is an E2 node identifier

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an E2 client option

func WithASN1Encoding

func WithASN1Encoding() Option

WithASN1Encoding sets the client encoding to ASN1Encoding

func WithAppID

func WithAppID(appID AppID) Option

WithAppID sets the client application identifier

func WithE2TAddress

func WithE2TAddress(host string, port int) Option

WithE2TAddress sets the address for the E2T service

func WithE2THost

func WithE2THost(host string) Option

WithE2THost sets the host for the E2T service

func WithE2TPort

func WithE2TPort(port int) Option

WithE2TPort sets the port for the E2T service

func WithEncoding

func WithEncoding(encoding Encoding) Option

WithEncoding sets the client encoding

func WithInstanceID

func WithInstanceID(instanceID InstanceID) Option

WithInstanceID sets the client instance identifier

func WithOptions

func WithOptions(opts Options) Option

WithOptions sets the client options

func WithProtoEncoding

func WithProtoEncoding() Option

WithProtoEncoding sets the client encoding to ProtoEncoding

func WithServiceModel

func WithServiceModel(name ServiceModelName, version ServiceModelVersion) Option

WithServiceModel sets the client service model

type Options

type Options struct {
	// AppOptions are the options for the application
	App AppOptions
	// ServiceMode is service model options
	ServiceModel ServiceModelOptions
	// Service is the E2 termination service configuration
	Service ServiceOptions
	// Topo is the topology service configuration
	Topo ServiceOptions
	// Encoding is the default encoding
	Encoding Encoding
}

Options is a set of E2 client options

type ServiceModelName

type ServiceModelName string

ServiceModelName is a service model identifier

type ServiceModelOptions

type ServiceModelOptions struct {
	// Name is the service model identifier
	Name ServiceModelName

	// Version is the service model version
	Version ServiceModelVersion
}

ServiceModelOptions is options for defining a service model

type ServiceModelVersion

type ServiceModelVersion string

ServiceModelVersion string

type ServiceOptions

type ServiceOptions struct {
	// Host is the service host
	Host string
	// Port is the service port
	Port int
}

ServiceOptions are the options for a service

func (ServiceOptions) GetAddress

func (o ServiceOptions) GetAddress() string

GetAddress gets the service address

func (ServiceOptions) GetHost

func (o ServiceOptions) GetHost() string

GetHost gets the service host

func (ServiceOptions) GetPort

func (o ServiceOptions) GetPort() int

GetPort gets the service port

type SubscribeOption added in v0.7.26

type SubscribeOption interface {
	// contains filtered or unexported methods
}

SubscribeOption is an option for subscribe request

func WithTransactionTimeout added in v0.7.26

func WithTransactionTimeout(transactionTimeout time.Duration) SubscribeOption

WithTransactionTimeout sets a timeout value for subscriptions

type SubscribeOptions added in v0.7.26

type SubscribeOptions struct {
	// Port is the service port
	TransactionTimeout time.Duration
}

SubscribeOptions are the options for a subscription

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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