server

package
v0.0.0-...-b4cc8dc Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusCode_name = map[int32]string{
	0: "OK",
	1: "OPERATION_FAILED",
}
View Source
var StatusCode_value = map[string]int32{
	"OK":               0,
	"OPERATION_FAILED": 1,
}

Functions

func RegisterVScreenServer

func RegisterVScreenServer(s *grpc.Server, srv VScreenServer)

Types

type Credential

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

func (*Credential) Descriptor

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

func (*Credential) GetPassword

func (m *Credential) GetPassword() string

func (*Credential) ProtoMessage

func (*Credential) ProtoMessage()

func (*Credential) Reset

func (m *Credential) Reset()

func (*Credential) String

func (m *Credential) String() string

func (*Credential) XXX_DiscardUnknown

func (m *Credential) XXX_DiscardUnknown()

func (*Credential) XXX_Marshal

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

func (*Credential) XXX_Merge

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

func (*Credential) XXX_Size

func (m *Credential) XXX_Size() int

func (*Credential) XXX_Unmarshal

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

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 Info

type Info struct {
	Title                string   `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Thumbnail            string   `protobuf:"bytes,2,opt,name=thumbnail,proto3" json:"thumbnail,omitempty"`
	Volume               float64  `protobuf:"fixed64,3,opt,name=volume,proto3" json:"volume,omitempty"`
	Position             float64  `protobuf:"fixed64,4,opt,name=position,proto3" json:"position,omitempty"`
	Playing              bool     `protobuf:"varint,5,opt,name=playing,proto3" json:"playing,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Info) Descriptor

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

func (*Info) GetPlaying

func (m *Info) GetPlaying() bool

func (*Info) GetPosition

func (m *Info) GetPosition() float64

func (*Info) GetThumbnail

func (m *Info) GetThumbnail() string

func (*Info) GetTitle

func (m *Info) GetTitle() string

func (*Info) GetVolume

func (m *Info) GetVolume() float64

func (*Info) ProtoMessage

func (*Info) ProtoMessage()

func (*Info) Reset

func (m *Info) Reset()

func (*Info) String

func (m *Info) String() string

func (*Info) XXX_DiscardUnknown

func (m *Info) XXX_DiscardUnknown()

func (*Info) XXX_Marshal

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

func (*Info) XXX_Merge

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

func (*Info) XXX_Size

func (m *Info) XXX_Size() int

func (*Info) XXX_Unmarshal

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

type Position

type Position struct {
	Value                float64  `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Position) Descriptor

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

func (*Position) GetValue

func (m *Position) GetValue() float64

func (*Position) ProtoMessage

func (*Position) ProtoMessage()

func (*Position) Reset

func (m *Position) Reset()

func (*Position) String

func (m *Position) String() string

func (*Position) XXX_DiscardUnknown

func (m *Position) XXX_DiscardUnknown()

func (*Position) XXX_Marshal

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

func (*Position) XXX_Merge

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

func (*Position) XXX_Size

func (m *Position) XXX_Size() int

func (*Position) XXX_Unmarshal

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

type Server

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

func New

func New(player *vplayer.Player) (*Server, error)

func (*Server) Add

func (s *Server) Add(ctx context.Context, src *Source) (*Status, error)

func (*Server) Auth

func (s *Server) Auth(ctx context.Context, c *Credential) (*Status, error)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe(addr string) error

func (*Server) Next

func (s *Server) Next(ctx context.Context, _ *Empty) (*Status, error)

func (*Server) Pause

func (s *Server) Pause(ctx context.Context, _ *Empty) (*Status, error)

func (*Server) Play

func (s *Server) Play(ctx context.Context, _ *Empty) (*Status, error)

func (*Server) Seek

func (s *Server) Seek(ctx context.Context, pos *Position) (*Status, error)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context, _ *Empty) (*Status, error)

func (*Server) Subscribe

func (s *Server) Subscribe(user *User, stream VScreen_SubscribeServer) error

func (*Server) Unsubscribe

func (s *Server) Unsubscribe(ctx context.Context, user *User) (*Status, error)

type Source

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

func (*Source) Descriptor

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

func (*Source) GetUrl

func (m *Source) GetUrl() string

func (*Source) ProtoMessage

func (*Source) ProtoMessage()

func (*Source) Reset

func (m *Source) Reset()

func (*Source) String

func (m *Source) String() string

func (*Source) XXX_DiscardUnknown

func (m *Source) XXX_DiscardUnknown()

func (*Source) XXX_Marshal

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

func (*Source) XXX_Merge

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

func (*Source) XXX_Size

func (m *Source) XXX_Size() int

func (*Source) XXX_Unmarshal

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

type Status

type Status struct {
	Code                 StatusCode `protobuf:"varint,1,opt,name=code,proto3,enum=StatusCode" json:"code,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (*Status) Descriptor

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

func (*Status) GetCode

func (m *Status) GetCode() StatusCode

func (*Status) ProtoMessage

func (*Status) ProtoMessage()

func (*Status) Reset

func (m *Status) Reset()

func (*Status) String

func (m *Status) String() string

func (*Status) XXX_DiscardUnknown

func (m *Status) XXX_DiscardUnknown()

func (*Status) XXX_Marshal

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

func (*Status) XXX_Merge

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

func (*Status) XXX_Size

func (m *Status) XXX_Size() int

func (*Status) XXX_Unmarshal

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

type StatusCode

type StatusCode int32
const (
	StatusCode_OK               StatusCode = 0
	StatusCode_OPERATION_FAILED StatusCode = 1
)

func (StatusCode) EnumDescriptor

func (StatusCode) EnumDescriptor() ([]byte, []int)

func (StatusCode) String

func (x StatusCode) String() string

type User

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

func (*User) Descriptor

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

func (*User) GetId

func (m *User) GetId() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) Reset

func (m *User) Reset()

func (*User) String

func (m *User) String() string

func (*User) XXX_DiscardUnknown

func (m *User) XXX_DiscardUnknown()

func (*User) XXX_Marshal

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

func (*User) XXX_Merge

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

func (*User) XXX_Size

func (m *User) XXX_Size() int

func (*User) XXX_Unmarshal

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

type VScreenClient

type VScreenClient interface {
	Auth(ctx context.Context, in *Credential, opts ...grpc.CallOption) (*Status, error)
	Play(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Status, error)
	Pause(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Status, error)
	Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Status, error)
	Next(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Status, error)
	Add(ctx context.Context, in *Source, opts ...grpc.CallOption) (*Status, error)
	Seek(ctx context.Context, in *Position, opts ...grpc.CallOption) (*Status, error)
	Subscribe(ctx context.Context, in *User, opts ...grpc.CallOption) (VScreen_SubscribeClient, error)
	Unsubscribe(ctx context.Context, in *User, opts ...grpc.CallOption) (*Status, error)
}

VScreenClient is the client API for VScreen service.

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

func NewVScreenClient

func NewVScreenClient(cc *grpc.ClientConn) VScreenClient

type VScreenServer

type VScreenServer interface {
	Auth(context.Context, *Credential) (*Status, error)
	Play(context.Context, *Empty) (*Status, error)
	Pause(context.Context, *Empty) (*Status, error)
	Stop(context.Context, *Empty) (*Status, error)
	Next(context.Context, *Empty) (*Status, error)
	Add(context.Context, *Source) (*Status, error)
	Seek(context.Context, *Position) (*Status, error)
	Subscribe(*User, VScreen_SubscribeServer) error
	Unsubscribe(context.Context, *User) (*Status, error)
}

VScreenServer is the server API for VScreen service.

type VScreen_SubscribeClient

type VScreen_SubscribeClient interface {
	Recv() (*Info, error)
	grpc.ClientStream
}

type VScreen_SubscribeServer

type VScreen_SubscribeServer interface {
	Send(*Info) error
	grpc.ServerStream
}

Jump to

Keyboard shortcuts

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