forked from Ilhasoft/goflow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
296 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package assets | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/nyaruka/gocommon/uuids" | ||
) | ||
|
||
//type MsgCatalogUUID uuids.UUID | ||
|
||
type MsgCatalog interface { | ||
ChannelUUID() uuids.UUID | ||
Name() string | ||
Type() string | ||
} | ||
|
||
type MsgCatalogReference struct { | ||
UUID uuids.UUID `json:"uuid" validate:"required,uuid"` | ||
Name string `json:"name"` | ||
} | ||
|
||
type MsgCatalogCallAction struct { | ||
Name string `json:"name"` | ||
Value string `json:"value"` | ||
} | ||
|
||
func NewMsgCatalogReference(uuid uuids.UUID, name string) *MsgCatalogReference { | ||
return &MsgCatalogReference{UUID: uuid, Name: name} | ||
} | ||
|
||
func (r *MsgCatalogReference) Type() string { | ||
return "msg_catalog" | ||
} | ||
|
||
func (r *MsgCatalogReference) GenericUUID() uuids.UUID { | ||
return uuids.UUID(r.UUID) | ||
} | ||
|
||
func (r *MsgCatalogReference) Identity() string { | ||
return string(r.UUID) | ||
} | ||
|
||
func (r *MsgCatalogReference) Variable() bool { | ||
return false | ||
} | ||
|
||
func (r *MsgCatalogReference) String() string { | ||
return fmt.Sprintf("%s[uuid=%s,name=%s]", r.Type(), r.Identity(), r.Name) | ||
} | ||
|
||
var _ UUIDReference = (*MsgCatalogReference)(nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package static | ||
|
||
import ( | ||
"github.com/nyaruka/gocommon/uuids" | ||
"github.com/nyaruka/goflow/assets" | ||
) | ||
|
||
type MsgCatalog struct { | ||
ChannelUUID_ uuids.UUID `json:"uuid" validate:"required,uuid` | ||
Name_ string `json:"name"` | ||
Type_ string `json:"type"` | ||
} | ||
|
||
func NewMsgCatalog(uuid uuids.UUID, name string, type_ string) assets.MsgCatalog { | ||
return &MsgCatalog{ | ||
ChannelUUID_: uuid, | ||
Name_: name, | ||
Type_: type_, | ||
} | ||
} | ||
|
||
func (mc *MsgCatalog) ChannelUUID() uuids.UUID { return mc.ChannelUUID_ } | ||
|
||
func (mc *MsgCatalog) Name() string { return mc.Name_ } | ||
|
||
func (mc *MsgCatalog) Type() string { return mc.Type_ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.