Documentation
¶
Index ¶
- Constants
- Variables
- type AuthenticateReply
- type AuthenticateRequest
- type Client
- func (client *Client) Connect(host string, options *Options) error
- func (client *Client) Disconnect()
- func (client *Client) GetConnection() *nats.Conn
- func (client *Client) GetJetStream() (nats.JetStreamContext, error)
- func (client *Client) IsAuthenticationRequired() bool
- func (client *Client) Request(apiPath string, payload []byte, timeout time.Duration) (*nats.Msg, error)
- func (client *Client) RequestMsg(msg *nats.Msg, timeout time.Duration) (*nats.Msg, error)
- type Error
- type ErrorReply
- type EventBus
- type EventBusHandler
- type EventBusOptions
- type Options
- type Permissions
Constants ¶
View Source
const (
CoreAPI = "$GVT.%s.API.CORE"
)
Variables ¶
View Source
var AvailablePermissions = Permissions{
"ADMIN": "Administrator",
"PRODUCT.LIST": "List available products",
"PRODUCT.CREATE": "Create product",
"PRODUCT.DELETE": "Delete specific product",
"PRODUCT.UPDATE": "Update specific product",
"PRODUCT.PURGE": "Purge specific product",
"PRODUCT.INFO": "Get specific product information",
"PRODUCT.SUBSCRIPTION": "Subscribe to specific product",
"PRODUCT.SNAPSHOT.READ": "Read snapshot of specific product",
"PRODUCT.ACL": "Update ACL of specific product",
"TOKEN.LIST": "List available tokens",
"TOKEN.CREATE": "Create token",
"TOKEN.DELETE": "Delete specific token",
"TOKEN.UPDATE": "Update specific token",
"TOKEN.INFO": "Get specific token information",
}
Functions ¶
This section is empty.
Types ¶
type AuthenticateReply ¶
type AuthenticateReply struct { ErrorReply Durable string `json:"durable"` Permissions []string `json:"permissions"` }
type AuthenticateRequest ¶
type AuthenticateRequest struct {
Token string `json:"token"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Disconnect ¶
func (client *Client) Disconnect()
func (*Client) GetConnection ¶
func (client *Client) GetConnection() *nats.Conn
func (*Client) GetJetStream ¶
func (*Client) IsAuthenticationRequired ¶
type ErrorReply ¶
type ErrorReply struct {
Error *Error `json:"error,omitempty"`
}
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus(host string, handler EventBusHandler, options EventBusOptions) *EventBus
func (*EventBus) GetConnection ¶
func (*EventBus) GetJetStream ¶
func (eb *EventBus) GetJetStream() (nats.JetStreamContext, error)
func (*EventBus) ReconnectHandler ¶
type EventBusHandler ¶
type EventBusOptions ¶
type Options ¶
type Options struct { Token string PingInterval time.Duration MaxPingsOutstanding int MaxReconnects int ReconnectHandler func() DisconnectHandler func() }
func NewOptions ¶
func NewOptions() *Options
type Permissions ¶
Click to show internal directories.
Click to hide internal directories.