bbsim

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package bbsim is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterBBSimHandler

func RegisterBBSimHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterBBSimHandler registers the http handlers for service BBSim to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterBBSimHandlerClient

func RegisterBBSimHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BBSimClient) error

RegisterBBSimHandlerClient registers the http handlers for service BBSim to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "BBSimClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "BBSimClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "BBSimClient" to call the correct interceptors.

func RegisterBBSimHandlerFromEndpoint

func RegisterBBSimHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterBBSimHandlerFromEndpoint is same as RegisterBBSimHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterBBSimHandlerServer

func RegisterBBSimHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BBSimServer) error

RegisterBBSimHandlerServer registers the http handlers for service BBSim to "mux". UnaryRPC :call BBSimServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterBBSimServer

func RegisterBBSimServer(s *grpc.Server, srv BBSimServer)

Types

type BBSimClient

type BBSimClient interface {
	Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionNumber, error)
	GetOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Olt, error)
	PoweronOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
	ShutdownOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
	RebootOlt(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Response, error)
	GetONUs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ONUs, error)
	GetONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*ONU, error)
	SetLogLevel(ctx context.Context, in *LogLevel, opts ...grpc.CallOption) (*LogLevel, error)
	ShutdownONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
	PoweronONU(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
	RestartEapol(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
	RestartDhcp(ctx context.Context, in *ONURequest, opts ...grpc.CallOption) (*Response, error)
}

BBSimClient is the client API for BBSim service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewBBSimClient

func NewBBSimClient(cc *grpc.ClientConn) BBSimClient

type BBSimServer

type BBSimServer interface {
	Version(context.Context, *Empty) (*VersionNumber, error)
	GetOlt(context.Context, *Empty) (*Olt, error)
	PoweronOlt(context.Context, *Empty) (*Response, error)
	ShutdownOlt(context.Context, *Empty) (*Response, error)
	RebootOlt(context.Context, *Empty) (*Response, error)
	GetONUs(context.Context, *Empty) (*ONUs, error)
	GetONU(context.Context, *ONURequest) (*ONU, error)
	SetLogLevel(context.Context, *LogLevel) (*LogLevel, error)
	ShutdownONU(context.Context, *ONURequest) (*Response, error)
	PoweronONU(context.Context, *ONURequest) (*Response, error)
	RestartEapol(context.Context, *ONURequest) (*Response, error)
	RestartDhcp(context.Context, *ONURequest) (*Response, error)
}

BBSimServer is the server API for BBSim service.

type Empty

type Empty struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Empty) Descriptor

func (*Empty) Descriptor() ([]byte, []int)

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

func (*Empty) XXX_DiscardUnknown

func (m *Empty) XXX_DiscardUnknown()

func (*Empty) XXX_Marshal

func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Empty) XXX_Merge

func (m *Empty) XXX_Merge(src proto.Message)

func (*Empty) XXX_Size

func (m *Empty) XXX_Size() int

func (*Empty) XXX_Unmarshal

func (m *Empty) XXX_Unmarshal(b []byte) error

type LogLevel

type LogLevel struct {
	Level                string   `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"`
	Caller               bool     `protobuf:"varint,2,opt,name=caller,proto3" json:"caller,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LogLevel) Descriptor

func (*LogLevel) Descriptor() ([]byte, []int)

func (*LogLevel) GetCaller

func (m *LogLevel) GetCaller() bool

func (*LogLevel) GetLevel

func (m *LogLevel) GetLevel() string

func (*LogLevel) ProtoMessage

func (*LogLevel) ProtoMessage()

func (*LogLevel) Reset

func (m *LogLevel) Reset()

func (*LogLevel) String

func (m *LogLevel) String() string

func (*LogLevel) XXX_DiscardUnknown

func (m *LogLevel) XXX_DiscardUnknown()

func (*LogLevel) XXX_Marshal

func (m *LogLevel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LogLevel) XXX_Merge

func (m *LogLevel) XXX_Merge(src proto.Message)

func (*LogLevel) XXX_Size

func (m *LogLevel) XXX_Size() int

func (*LogLevel) XXX_Unmarshal

func (m *LogLevel) XXX_Unmarshal(b []byte) error

type NNIPort

type NNIPort struct {
	ID                   int32    `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	OperState            string   `protobuf:"bytes,2,opt,name=OperState,proto3" json:"OperState,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*NNIPort) Descriptor

func (*NNIPort) Descriptor() ([]byte, []int)

func (*NNIPort) GetID

func (m *NNIPort) GetID() int32

func (*NNIPort) GetOperState

func (m *NNIPort) GetOperState() string

func (*NNIPort) ProtoMessage

func (*NNIPort) ProtoMessage()

func (*NNIPort) Reset

func (m *NNIPort) Reset()

func (*NNIPort) String

func (m *NNIPort) String() string

func (*NNIPort) XXX_DiscardUnknown

func (m *NNIPort) XXX_DiscardUnknown()

func (*NNIPort) XXX_Marshal

func (m *NNIPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NNIPort) XXX_Merge

func (m *NNIPort) XXX_Merge(src proto.Message)

func (*NNIPort) XXX_Size

func (m *NNIPort) XXX_Size() int

func (*NNIPort) XXX_Unmarshal

func (m *NNIPort) XXX_Unmarshal(b []byte) error

type ONU

type ONU struct {
	ID                   int32    `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	SerialNumber         string   `protobuf:"bytes,2,opt,name=SerialNumber,proto3" json:"SerialNumber,omitempty"`
	OperState            string   `protobuf:"bytes,3,opt,name=OperState,proto3" json:"OperState,omitempty"`
	InternalState        string   `protobuf:"bytes,4,opt,name=InternalState,proto3" json:"InternalState,omitempty"`
	PonPortID            int32    `protobuf:"varint,5,opt,name=PonPortID,proto3" json:"PonPortID,omitempty"`
	STag                 int32    `protobuf:"varint,6,opt,name=STag,proto3" json:"STag,omitempty"`
	CTag                 int32    `protobuf:"varint,7,opt,name=CTag,proto3" json:"CTag,omitempty"`
	HwAddress            string   `protobuf:"bytes,8,opt,name=HwAddress,proto3" json:"HwAddress,omitempty"`
	PortNo               int32    `protobuf:"varint,9,opt,name=PortNo,proto3" json:"PortNo,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ONU) Descriptor

func (*ONU) Descriptor() ([]byte, []int)

func (*ONU) GetCTag

func (m *ONU) GetCTag() int32

func (*ONU) GetHwAddress

func (m *ONU) GetHwAddress() string

func (*ONU) GetID

func (m *ONU) GetID() int32

func (*ONU) GetInternalState

func (m *ONU) GetInternalState() string

func (*ONU) GetOperState

func (m *ONU) GetOperState() string

func (*ONU) GetPonPortID

func (m *ONU) GetPonPortID() int32

func (*ONU) GetPortNo

func (m *ONU) GetPortNo() int32

func (*ONU) GetSTag

func (m *ONU) GetSTag() int32

func (*ONU) GetSerialNumber

func (m *ONU) GetSerialNumber() string

func (*ONU) ProtoMessage

func (*ONU) ProtoMessage()

func (*ONU) Reset

func (m *ONU) Reset()

func (*ONU) String

func (m *ONU) String() string

func (*ONU) XXX_DiscardUnknown

func (m *ONU) XXX_DiscardUnknown()

func (*ONU) XXX_Marshal

func (m *ONU) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ONU) XXX_Merge

func (m *ONU) XXX_Merge(src proto.Message)

func (*ONU) XXX_Size

func (m *ONU) XXX_Size() int

func (*ONU) XXX_Unmarshal

func (m *ONU) XXX_Unmarshal(b []byte) error

type ONURequest

type ONURequest struct {
	SerialNumber         string   `protobuf:"bytes,1,opt,name=SerialNumber,proto3" json:"SerialNumber,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ONURequest) Descriptor

func (*ONURequest) Descriptor() ([]byte, []int)

func (*ONURequest) GetSerialNumber

func (m *ONURequest) GetSerialNumber() string

func (*ONURequest) ProtoMessage

func (*ONURequest) ProtoMessage()

func (*ONURequest) Reset

func (m *ONURequest) Reset()

func (*ONURequest) String

func (m *ONURequest) String() string

func (*ONURequest) XXX_DiscardUnknown

func (m *ONURequest) XXX_DiscardUnknown()

func (*ONURequest) XXX_Marshal

func (m *ONURequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ONURequest) XXX_Merge

func (m *ONURequest) XXX_Merge(src proto.Message)

func (*ONURequest) XXX_Size

func (m *ONURequest) XXX_Size() int

func (*ONURequest) XXX_Unmarshal

func (m *ONURequest) XXX_Unmarshal(b []byte) error

type ONUs

type ONUs struct {
	Items                []*ONU   `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ONUs) Descriptor

func (*ONUs) Descriptor() ([]byte, []int)

func (*ONUs) GetItems

func (m *ONUs) GetItems() []*ONU

func (*ONUs) ProtoMessage

func (*ONUs) ProtoMessage()

func (*ONUs) Reset

func (m *ONUs) Reset()

func (*ONUs) String

func (m *ONUs) String() string

func (*ONUs) XXX_DiscardUnknown

func (m *ONUs) XXX_DiscardUnknown()

func (*ONUs) XXX_Marshal

func (m *ONUs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ONUs) XXX_Merge

func (m *ONUs) XXX_Merge(src proto.Message)

func (*ONUs) XXX_Size

func (m *ONUs) XXX_Size() int

func (*ONUs) XXX_Unmarshal

func (m *ONUs) XXX_Unmarshal(b []byte) error

type Olt

type Olt struct {
	ID                   int32      `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	SerialNumber         string     `protobuf:"bytes,2,opt,name=SerialNumber,proto3" json:"SerialNumber,omitempty"`
	OperState            string     `protobuf:"bytes,3,opt,name=OperState,proto3" json:"OperState,omitempty"`
	InternalState        string     `protobuf:"bytes,4,opt,name=InternalState,proto3" json:"InternalState,omitempty"`
	NNIPorts             []*NNIPort `protobuf:"bytes,5,rep,name=NNIPorts,proto3" json:"NNIPorts,omitempty"`
	PONPorts             []*PONPort `protobuf:"bytes,6,rep,name=PONPorts,proto3" json:"PONPorts,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Olt) Descriptor

func (*Olt) Descriptor() ([]byte, []int)

func (*Olt) GetID

func (m *Olt) GetID() int32

func (*Olt) GetInternalState

func (m *Olt) GetInternalState() string

func (*Olt) GetNNIPorts

func (m *Olt) GetNNIPorts() []*NNIPort

func (*Olt) GetOperState

func (m *Olt) GetOperState() string

func (*Olt) GetPONPorts

func (m *Olt) GetPONPorts() []*PONPort

func (*Olt) GetSerialNumber

func (m *Olt) GetSerialNumber() string

func (*Olt) ProtoMessage

func (*Olt) ProtoMessage()

func (*Olt) Reset

func (m *Olt) Reset()

func (*Olt) String

func (m *Olt) String() string

func (*Olt) XXX_DiscardUnknown

func (m *Olt) XXX_DiscardUnknown()

func (*Olt) XXX_Marshal

func (m *Olt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Olt) XXX_Merge

func (m *Olt) XXX_Merge(src proto.Message)

func (*Olt) XXX_Size

func (m *Olt) XXX_Size() int

func (*Olt) XXX_Unmarshal

func (m *Olt) XXX_Unmarshal(b []byte) error

type PONPort

type PONPort struct {
	ID                   int32    `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
	OperState            string   `protobuf:"bytes,2,opt,name=OperState,proto3" json:"OperState,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PONPort) Descriptor

func (*PONPort) Descriptor() ([]byte, []int)

func (*PONPort) GetID

func (m *PONPort) GetID() int32

func (*PONPort) GetOperState

func (m *PONPort) GetOperState() string

func (*PONPort) ProtoMessage

func (*PONPort) ProtoMessage()

func (*PONPort) Reset

func (m *PONPort) Reset()

func (*PONPort) String

func (m *PONPort) String() string

func (*PONPort) XXX_DiscardUnknown

func (m *PONPort) XXX_DiscardUnknown()

func (*PONPort) XXX_Marshal

func (m *PONPort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PONPort) XXX_Merge

func (m *PONPort) XXX_Merge(src proto.Message)

func (*PONPort) XXX_Size

func (m *PONPort) XXX_Size() int

func (*PONPort) XXX_Unmarshal

func (m *PONPort) XXX_Unmarshal(b []byte) error

type Response

type Response struct {
	StatusCode           int32    `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Message              string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Response) Descriptor

func (*Response) Descriptor() ([]byte, []int)

func (*Response) GetMessage

func (m *Response) GetMessage() string

func (*Response) GetStatusCode

func (m *Response) GetStatusCode() int32

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

func (*Response) XXX_DiscardUnknown

func (m *Response) XXX_DiscardUnknown()

func (*Response) XXX_Marshal

func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Response) XXX_Merge

func (m *Response) XXX_Merge(src proto.Message)

func (*Response) XXX_Size

func (m *Response) XXX_Size() int

func (*Response) XXX_Unmarshal

func (m *Response) XXX_Unmarshal(b []byte) error

type UnimplementedBBSimServer

type UnimplementedBBSimServer struct {
}

UnimplementedBBSimServer can be embedded to have forward compatible implementations.

func (*UnimplementedBBSimServer) GetONU

func (*UnimplementedBBSimServer) GetONUs

func (*UnimplementedBBSimServer) GetONUs(ctx context.Context, req *Empty) (*ONUs, error)

func (*UnimplementedBBSimServer) GetOlt

func (*UnimplementedBBSimServer) GetOlt(ctx context.Context, req *Empty) (*Olt, error)

func (*UnimplementedBBSimServer) PoweronONU

func (*UnimplementedBBSimServer) PoweronONU(ctx context.Context, req *ONURequest) (*Response, error)

func (*UnimplementedBBSimServer) PoweronOlt

func (*UnimplementedBBSimServer) PoweronOlt(ctx context.Context, req *Empty) (*Response, error)

func (*UnimplementedBBSimServer) RebootOlt

func (*UnimplementedBBSimServer) RebootOlt(ctx context.Context, req *Empty) (*Response, error)

func (*UnimplementedBBSimServer) RestartDhcp

func (*UnimplementedBBSimServer) RestartDhcp(ctx context.Context, req *ONURequest) (*Response, error)

func (*UnimplementedBBSimServer) RestartEapol

func (*UnimplementedBBSimServer) RestartEapol(ctx context.Context, req *ONURequest) (*Response, error)

func (*UnimplementedBBSimServer) SetLogLevel

func (*UnimplementedBBSimServer) SetLogLevel(ctx context.Context, req *LogLevel) (*LogLevel, error)

func (*UnimplementedBBSimServer) ShutdownONU

func (*UnimplementedBBSimServer) ShutdownONU(ctx context.Context, req *ONURequest) (*Response, error)

func (*UnimplementedBBSimServer) ShutdownOlt

func (*UnimplementedBBSimServer) ShutdownOlt(ctx context.Context, req *Empty) (*Response, error)

func (*UnimplementedBBSimServer) Version

type VersionNumber

type VersionNumber struct {
	Version              string   `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	BuildTime            string   `protobuf:"bytes,2,opt,name=buildTime,proto3" json:"buildTime,omitempty"`
	CommitHash           string   `protobuf:"bytes,3,opt,name=commitHash,proto3" json:"commitHash,omitempty"`
	GitStatus            string   `protobuf:"bytes,4,opt,name=gitStatus,proto3" json:"gitStatus,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*VersionNumber) Descriptor

func (*VersionNumber) Descriptor() ([]byte, []int)

func (*VersionNumber) GetBuildTime

func (m *VersionNumber) GetBuildTime() string

func (*VersionNumber) GetCommitHash

func (m *VersionNumber) GetCommitHash() string

func (*VersionNumber) GetGitStatus

func (m *VersionNumber) GetGitStatus() string

func (*VersionNumber) GetVersion

func (m *VersionNumber) GetVersion() string

func (*VersionNumber) ProtoMessage

func (*VersionNumber) ProtoMessage()

func (*VersionNumber) Reset

func (m *VersionNumber) Reset()

func (*VersionNumber) String

func (m *VersionNumber) String() string

func (*VersionNumber) XXX_DiscardUnknown

func (m *VersionNumber) XXX_DiscardUnknown()

func (*VersionNumber) XXX_Marshal

func (m *VersionNumber) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*VersionNumber) XXX_Merge

func (m *VersionNumber) XXX_Merge(src proto.Message)

func (*VersionNumber) XXX_Size

func (m *VersionNumber) XXX_Size() int

func (*VersionNumber) XXX_Unmarshal

func (m *VersionNumber) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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