Documentation ¶
Index ¶
- Variables
- type Service
- func (s *Service) CRUDType() protocol.CRUD
- func (s *Service) ID() uint64
- func (s *Service) MediaType() protocol.MediaType
- func (s *Service) Priority() protocol.Priority
- func (s *Service) ServeHTTP(st protocol.Stream, httpReq protocol.HTTPRequest, ...) (err protocol.Error)
- func (s *Service) ServeSRPC(st protocol.Stream) (err protocol.Error)
- func (s *Service) ServeSRPCDirect(conn protocol.Connection, request []byte) (response []byte, err protocol.Error)
- func (s *Service) SetAuthorization(crud protocol.CRUD, userType protocol.UserType) *Service
- func (s *Service) SetPriority(priority protocol.Priority, weight protocol.Weight) *Service
- func (s *Service) URI() string
- func (s *Service) UserType() protocol.UserType
- func (s *Service) Weight() protocol.Weight
- type Services
- func (ss *Services) DeleteService(s protocol.Service)
- func (ss *Services) GetServiceByID(serviceID uint64) protocol.Service
- func (ss *Services) GetServiceByMediaType(mt string) protocol.Service
- func (ss *Services) GetServiceByURI(uri string) protocol.Service
- func (ss *Services) Init()
- func (ss *Services) RegisterService(s protocol.Service)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = er.New(mediatype.New("domain/service.protocol.error; name=not-found").SetDetail(protocol.LanguageEnglish, domainEnglish, "Not Found", "Requested service by given identifier not found in this application", "", "", nil). Expired(0, nil)) ErrServiceNotAcceptSRPC = er.New(mediatype.New("domain/service.protocol.error; name=service-not-accept-srpc").SetDetail(protocol.LanguageEnglish, domainEnglish, "Service Not Accept sRPC", "Requested service by given ID not accept sRPC protocol in this server", "Try other server or contact support of the software", "It is so easy to implement sRPC handler for a service! Take a time and do it!", nil). SetDetail(protocol.LanguagePersian, domainPersian, "سرویس پروتکل sRPC را پشتیبانی نمی کند", "درخواست برای سرویس با شماره داده شده بدلیل عدم پشتیبانی پروتکل مدنظر قابلیت انجام روی سرور فعلی را ندارد", "سرور دیگر را امتحان کنید یا با پشتیبانی پلتفرم تماس بگیرید", "پیاده سازی این پروتکل برای پاسخ گویی به سرویس ها به شدت ساده است، وقتی برای پیاده سازی اختصاص دهید", nil). Expired(0, nil)) ErrServiceNotAcceptSRPCDirect = er.New(mediatype.New("domain/service.protocol.error; name=service-not-accept-direct-srpc").SetDetail(protocol.LanguageEnglish, domainEnglish, "Service Not Accept Direct sRPC", "Requested service by given ID not accept direct sRPC protocol in this server", "Try other server or contact support of the software", "", nil). SetDetail(protocol.LanguagePersian, domainPersian, "پرسش مستقیم پشتیبانی نمی شود", "درخواست برای سرویس با شماره داده شده بدلیل عدم پشتیبانی پروتکل مدنظر قابلیت انجام روی سرور فعلی را ندارد", "سرور دیگر را امتحان کنید یا با پشتیبانی پلتفرم تماس بگیرید", "پیاده سازی این پروتکل برای پاسخ گویی به سرویس ها به شدت ساده است، در صورت تمایل به پشتیبانی وقتی برای پیاده سازی اختصاص دهید", nil). Expired(0, nil)) ErrServiceNotAcceptHTTP = er.New(mediatype.New("domain/service.protocol.error; name=service-not-accept-http").SetDetail(protocol.LanguageEnglish, domainEnglish, "Service Not Accept HTTP", "Requested service by given ID not accept HTTP protocol in this server", "Try other server or contact support of the software", "It is so easy to implement HTTP handler for a service! Take a time and do it!", nil). SetDetail(protocol.LanguagePersian, domainPersian, "پروتکل HTTP پشتیبانی نمی شود", "درخواست برای سرویس با شماره داده شده بدلیل عدم پشتیبانی پروتکل مدنظر قابلیت انجام روی سرور فعلی را ندارد", "سرور دیگر را امتحان کنید یا با پشتیبانی پلتفرم تماس بگیرید", "پیاده سازی این پروتکل برای پاسخ گویی به سرویس ها به شدت ساده است، وقتی برای پیاده سازی اختصاص دهید", nil). Expired(0, nil)) )
Declare Errors Details
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service store needed data for a service to implement protocol.Service when embed to other struct that implements other methods!
func (*Service) ServeHTTP ¶
func (s *Service) ServeHTTP(st protocol.Stream, httpReq protocol.HTTPRequest, httpRes protocol.HTTPResponse) (err protocol.Error)
func (*Service) ServeSRPCDirect ¶
func (*Service) SetAuthorization ¶
func (*Service) SetPriority ¶
type Services ¶
type Services struct {
// contains filtered or unexported fields
}
Services store all application service
func (*Services) DeleteService ¶
DeleteService use to delete specific service in services list.
func (*Services) GetServiceByID ¶
GetServiceByID use to get specific service handler by service ID
func (*Services) GetServiceByMediaType ¶
GetServiceByMediaType use to get specific service handler by service URI
func (*Services) GetServiceByURI ¶
GetServiceByURI use to get specific service handler by service URI path
func (*Services) RegisterService ¶
RegisterService use to set or change specific service detail!
Click to show internal directories.
Click to hide internal directories.