Documentation
¶
Index ¶
- Constants
- Variables
- func New(url string, opts ...client.Option) *connectorSvc
- type ActionLookup
- type AuthType
- type Connection
- type ConnectionInput
- type ConnectionMethod
- type ConnectionMethodInput
- type Connector
- type ConnectorAction
- type ConnectorActionDefinition
- type ConnectorActionDefinitionInput
- type ConnectorActionInput
- type ConnectorCategory
- type ConnectorInput
- type ConnectorInterface
- type ConnectorInterfaceInput
- type ConnectorUpdateInput
- type Context
- type GetConnectionsInput
- type GetConnectorsInput
- type Service
- type Subscription
Constants ¶
const GlobalNamespace = "global"
Variables ¶
var AllAuthType = []AuthType{ AuthTypeNone, AuthTypePlatform, AuthTypeRaw, AuthTypeBasic, AuthTypeAPIKey, AuthTypeClientCerts, AuthTypeOAuthClientCreds, AuthTypeOAuthOwnerPasswordCreds, AuthTypeOAuthAuthCodeCreds, }
var OAuthType = []AuthType{ AuthTypeOAuthClientCreds, AuthTypeOAuthOwnerPasswordCreds, AuthTypeOAuthAuthCodeCreds, AuthTypePlatform, }
Functions ¶
Types ¶
type ActionLookup ¶
type AuthType ¶
type AuthType string
Enumeration of supported auth types
const ( AuthTypeNone AuthType = "None" AuthTypePlatform AuthType = "Platform" AuthTypeRaw AuthType = "Raw" AuthTypeBasic AuthType = "Basic" AuthTypeAPIKey AuthType = "APIKey" AuthTypeClientCerts AuthType = "ClientCerts" AuthTypeOAuthClientCreds AuthType = "OAuthClientCreds" AuthTypeOAuthOwnerPasswordCreds AuthType = "OAuthPassword" AuthTypeOAuthAuthCodeCreds AuthType = "OAuthAuthCode" )
func (AuthType) IsOAuthType ¶
func (AuthType) MarshalGQL ¶
func (AuthType) MarshalJSON ¶
func (*AuthType) UnmarshalGQL ¶
func (*AuthType) UnmarshalJSON ¶
type Connection ¶
type Connection struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` Connector *Connector `json:"connector,omitempty"` Actions []*ConnectorAction `json:"actions,omitempty"` AuthType AuthType `json:"authType"` AuthURL *string `json:"authUrl,omitempty"` Config common.Object `json:"config,omitempty"` Credentials common.Object `json:"credentials,omitempty"` Sequence *int64 `json:"sequence,omitempty"` }
Connection is a per-tenant configuration of a connector
type ConnectionInput ¶
type ConnectionInput struct { Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags"` Config common.Object `json:"config"` Credentials common.Object `json:"credentials"` AuthType AuthType `json:"authType"` AuthURL *string `json:"authUrl"` Actions []string `json:"actions"` }
ConnectionInput defines the mutable fields of a connection
type ConnectionMethod ¶
type ConnectionMethod struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` Parameters common.Object `json:"parameters,omitempty"` GraphQLURL string `json:"graphqlUrl"` Connectors []*Connector `json:"connectors"` }
ConnectionMethod references a service that implements connectors of a specific connection method (e.g. http, grpc, graphql)
type ConnectionMethodInput ¶
type ConnectionMethodInput struct { common.ObjectMetaInput URL string // contains filtered or unexported fields }
type Connector ¶
type Connector struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` Docs *string `json:"documentation,omitempty"` Method *ConnectionMethod `json:"method,omitempty"` Implements []*ConnectorInterface `json:"implements,omitempty"` Actions []*ConnectorActionDefinition `json:"actions,omitempty"` Connections []*Connection `json:"connections,omitempty"` Parameters common.Object `json:"parameters,omitempty"` AuthTypes []AuthType `json:"authTypes"` Sequence *int64 `json:"sequence,omitempty"` Title *string `json:"title"` TenantID *string `json:"tenant,omitempty"` }
Connector is an entry in catalog of available connectors (e.g. service now connector based on generic http connector)
func (*Connector) LookupAction ¶
func (c *Connector) LookupAction(name string) *ConnectorAction
type ConnectorAction ¶
type ConnectorAction struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` Interface *ConnectorInterface `json:"interface"` Inputs common.Object `json:"inputs,omitempty"` Outputs common.Object `json:"outputs,omitempty"` }
ConnectorAction defines a method or activity that can be called on a connector and its corresponding input and output
type ConnectorActionDefinition ¶
type ConnectorActionDefinition struct { ID string `json:"id"` Name string `json:"name"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Action *ConnectorAction `json:"action"` Config common.Object `json:"config"` }
ConnectorActionDefinition defines the configuration of a connector action implementation"
type ConnectorActionDefinitionInput ¶
type ConnectorActionDefinitionInput struct { Action common.ID `json:"action"` Config common.Object `json:"config"` }
ConnectorActionInput defines the mutable fields of a connector action
type ConnectorActionInput ¶
type ConnectorActionInput struct { common.ObjectMetaInput Inputs common.Object `json:"inputs"` Outputs common.Object `json:"outputs"` }
ConnectorActionInput defines the mutable fields of a connector action
type ConnectorCategory ¶
type ConnectorCategory struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` }
ConnectorCategory is a grouping/categorization of available connectors (e.g. IP reputation services, DNS lookup, etc)
type ConnectorInput ¶
type ConnectorInput struct { common.ObjectMetaInput Implements common.IDs `json:"implements"` Parameters common.Object `json:"parameters"` AuthTypes []AuthType `json:"authTypes"` AllTenants *bool `json:"allTenants"` Actions []*ConnectorActionDefinitionInput `json:"actions"` Documentation *string `json:"documentation"` Categories common.IDs `json:"categories"` Title *string `json:"title"` }
ConnectorInput defines the mutable fields of a connector
type ConnectorInterface ¶
type ConnectorInterface struct { ID string `json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Name string `json:"name"` Description string `json:"description"` Tags common.Tags `json:"tags,omitempty"` Categories []*ConnectorCategory `json:"categories,omitempty"` Actions []*ConnectorAction `json:"actions,omitempty"` TenantID *string `json:"tenantId,omitempty"` }
ConnectorInterface defines an abstract type (set of actions) that could be implemented by multiple connectors
func (*ConnectorInterface) LookupAction ¶
func (c *ConnectorInterface) LookupAction(name string) *ConnectorAction
type ConnectorInterfaceInput ¶
type ConnectorInterfaceInput struct { common.ObjectMetaInput Categories common.IDs `json:"categories"` Actions []*ConnectorActionInput `json:"actions"` AllTenants *bool `json:"all_tenants"` }
type ConnectorUpdateInput ¶
type ConnectorUpdateInput struct { Name string `json:"name"` Description string `json:"description"` Implements common.IDs `json:"implements"` AuthTypes []AuthType `json:"authTypes"` Documentation string `json:"documentation"` Actions []ConnectorActionDefinitionInput `json:"actions"` Categories common.IDs `json:"categories"` Tags common.Tags `json:"tags"` Title *string `json:"title"` // contains filtered or unexported fields }
type Context ¶
type Context struct { TenantID string UserID string Connections []*Connection }
Context is the execution context for the current playbook
func (*Context) LookupAction ¶
func (ctx *Context) LookupAction(actionLookup *ActionLookup) (*Connection, *ConnectorAction)
type GetConnectionsInput ¶
type GetConnectorsInput ¶
type Service ¶
type Service interface { GetConnectionMethod(name string, opts ...graphql.RequestOption) (*ConnectionMethod, error) GetConnectors(input *GetConnectorsInput, opts ...graphql.RequestOption) ([]*Connector, error) GetConnections(input *GetConnectionsInput, opts ...graphql.RequestOption) ([]*Connection, error) GetContext(input *GetConnectionsInput, opts ...graphql.RequestOption) (*Context, error) DefineConnectionMethod(input *ConnectionMethodInput, opts ...graphql.RequestOption) (*ConnectionMethod, error) RemoveConnectionMethod(connectionID string, opts ...graphql.RequestOption) (*ConnectionMethod, error) CreateConnectorInterface(input *ConnectorInterfaceInput, opts ...graphql.RequestOption) (*ConnectorInterface, error) UpdateConnectorInterface(connectorID string, input *ConnectorInterfaceInput, opts ...graphql.RequestOption) (*ConnectorInterface, error) DeleteConnectorInterface(connectorID string, opts ...graphql.RequestOption) (*ConnectorInterface, error) CreateConnector(connectionMethodID string, input *ConnectorInput, opts ...graphql.RequestOption) (*Connector, error) UpdateConnector(connectorID string, input *ConnectorUpdateInput, opts ...graphql.RequestOption) (*Connector, error) DeleteConnector(connectorID string, opts ...graphql.RequestOption) (*Connector, error) CreateConnection(connectorID string, input *ConnectionInput, opts ...graphql.RequestOption) (*Connection, error) UpdateConnection(connectionID string, input *ConnectionInput, opts ...graphql.RequestOption) (*Connection, error) DeleteConnection(connectionID string, opts ...graphql.RequestOption) (*Connection, error) ExecuteConnectionAction(connectionID string, actionName string, inputs interface{}, opts ...graphql.RequestOption) (*interface{}, error) GetConnectorCategory(connectorCategoryID string, opts ...graphql.RequestOption) (*ConnectorCategory, error) GetConnectorInterface(connectorInterfaceID string, opts ...graphql.RequestOption) (*ConnectorInterface, error) GetConnector(connectorID string, opts ...graphql.RequestOption) (*Connector, error) GetConnection(connectionID string, opts ...graphql.RequestOption) (*Connection, error) ConnectorCreated(ctx context.Context, connectorMethods common.IDs, allTenants bool, options ...graphql.SubscriptionOption) (Subscription, error) ConnectorDeleted(ctx context.Context, connectorMethods common.IDs, allTenants bool, options ...graphql.SubscriptionOption) (Subscription, error) ConnectorUpdated(ctx context.Context, connectorMethods common.IDs, allTenants bool, options ...graphql.SubscriptionOption) (Subscription, error) }