apns

package
v0.0.0-...-29c6822 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHTTPHandler

func MakeHTTPHandler(e Endpoints, logger log.Logger) *mux.Router

func MakePushEndpoint

func MakePushEndpoint(svc Service) endpoint.Endpoint

func MarshalPushInfo

func MarshalPushInfo(p *PushInfo) ([]byte, error)

func NewPushService

func NewPushService(provider PushCertificateProvider) (*push.Service, error)

func UnmarshalPushInfo

func UnmarshalPushInfo(data []byte, p *PushInfo) error

Types

type Endpoints

type Endpoints struct {
	PushEndpoint endpoint.Endpoint
}

func MakeServerEndpoints

func MakeServerEndpoints(s Service) Endpoints

type Middleware

type Middleware func(Service) Service

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

type Option

type Option func(*PushService)

func WithPushService

func WithPushService(svc *push.Service) Option

type PushCertificateProvider

type PushCertificateProvider interface {
	PushCertificate() (*tls.Certificate, error)
}

type PushInfo

type PushInfo struct {
	UDID      string
	PushMagic string
	Token     string
	MDMTopic  string
}

type PushService

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

func New

func New(db Store, provider PushCertificateProvider, sub pubsub.Subscriber, opts ...Option) (*PushService, error)

func (*PushService) Push

func (svc *PushService) Push(ctx context.Context, deviceUDID string) (string, error)

type Service

type Service interface {
	Push(ctx context.Context, udid string) (string, error)
}

type Store

type Store interface {
	PushInfo(udid string) (*PushInfo, error)
}

Directories

Path Synopsis
internal
pushproto
Package pushproto is a generated protocol buffer package.
Package pushproto is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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