github.com/alloyzeus/go-azfl@v0.0.0-20231220071816-9740126a2d07/azcore/terminal.go (about) 1 package azcore 2 3 import "github.com/alloyzeus/go-azfl/azid" 4 5 // A Terminal is an object which could act within the system, i.e., an agent. 6 type Terminal[ 7 TerminalIDNumT TerminalIDNum, TerminalIDT TerminalID[TerminalIDNumT], 8 UserIDNumT UserIDNum, UserIDT UserID[UserIDNumT], 9 ] interface { 10 // ID returns the identifier of this Terminal instance. 11 ID() TerminalIDT 12 13 // PrincipalUser returns the ref-key of the User, if any, who authorized 14 // this instance of Terminal. 15 PrincipalUser() UserIDT 16 } 17 18 type TerminalIDNumMethods interface { 19 AZTerminalIDNum() 20 } 21 22 // TerminalIDNum abstracts the identifiers of Terminal entity instances. 23 type TerminalIDNum interface { 24 azid.IDNum 25 26 TerminalIDNumMethods 27 } 28 29 // TerminalID is used to refer to a Terminal entity instance. 30 type TerminalID[IDNumT TerminalIDNum] interface { 31 azid.ID[IDNumT] 32 33 // TerminalIDNum returns only the ID part of this ref-key. 34 TerminalIDNum() IDNumT 35 }