github.com/alloyzeus/go-azfl@v0.0.0-20231220071816-9740126a2d07/azcore/entity_service.go (about)

     1  package azcore
     2  
     3  //region Method
     4  
     5  // EntityMethodMessage abstracts the messages, i.e., requests and responses.
     6  type EntityMethodMessage interface {
     7  	ServiceMethodMessage
     8  
     9  	EntityMethodContext() EntityMethodContext
    10  }
    11  
    12  //endregion
    13  
    14  //region Context
    15  
    16  // EntityMethodContext provides an abstraction for all operations which
    17  // apply to entity instances.
    18  type EntityMethodContext interface {
    19  	ServiceMethodContext
    20  }
    21  
    22  // EntityMethodCallInputContext is an abstraction for all method call
    23  // input contexts.
    24  type EntityMethodCallInputContext[
    25  	SessionIDNumT SessionIDNum, SessionIDT SessionID[SessionIDNumT],
    26  	TerminalIDNumT TerminalIDNum, TerminalIDT TerminalID[TerminalIDNumT],
    27  	UserIDNumT UserIDNum, UserIDT UserID[UserIDNumT],
    28  	SessionSubjectT SessionSubject[
    29  		TerminalIDNumT, TerminalIDT,
    30  		UserIDNumT, UserIDT],
    31  	SessionT Session[
    32  		SessionIDNumT, SessionIDT,
    33  		TerminalIDNumT, TerminalIDT,
    34  		UserIDNumT, UserIDT,
    35  		SessionSubjectT, SessionT],
    36  	ServiceMethodIdempotencyKeyT ServiceMethodIdempotencyKey,
    37  ] interface {
    38  	EntityMethodContext
    39  	ServiceMethodCallInputContext[
    40  		SessionIDNumT, SessionIDT,
    41  		TerminalIDNumT, TerminalIDT,
    42  		UserIDNumT, UserIDT,
    43  		SessionSubjectT,
    44  		SessionT, ServiceMethodIdempotencyKeyT,
    45  	]
    46  }
    47  
    48  // EntityMethodCallOutputContext is an abstraction for all method call
    49  // output contexts.
    50  type EntityMethodCallOutputContext interface {
    51  	EntityMethodContext
    52  	ServiceMethodCallOutputContext
    53  }
    54  
    55  //endregion
    56  
    57  //region MutatingContext
    58  
    59  // EntityMutatingContext is a specialization of EntityOperationContext which
    60  // is used for operations which make any change to the entity.
    61  type EntityMutatingContext interface {
    62  	EntityMethodContext
    63  	ServiceMutatingMethodContext
    64  }
    65  
    66  // EntityMutatingMethodCallContext provides an abstraction for input contexts
    67  // for mutating method calls.
    68  type EntityMutatingMethodCallContext[
    69  	SessionIDNumT SessionIDNum, SessionIDT SessionID[SessionIDNumT],
    70  	TerminalIDNumT TerminalIDNum, TerminalIDT TerminalID[TerminalIDNumT],
    71  	UserIDNumT UserIDNum, UserIDT UserID[UserIDNumT],
    72  	SessionSubjectT SessionSubject[
    73  		TerminalIDNumT, TerminalIDT,
    74  		UserIDNumT, UserIDT],
    75  	SessionT Session[
    76  		SessionIDNumT, SessionIDT,
    77  		TerminalIDNumT, TerminalIDT,
    78  		UserIDNumT, UserIDT,
    79  		SessionSubjectT, SessionT],
    80  	ServiceMethodCallInputContextT ServiceMethodCallInputContext[
    81  		SessionIDNumT, SessionIDT,
    82  		TerminalIDNumT, TerminalIDT,
    83  		UserIDNumT, UserIDT,
    84  		SessionSubjectT,
    85  		SessionT, ServiceMethodIdempotencyKeyT],
    86  	ServiceMethodIdempotencyKeyT ServiceMethodIdempotencyKey,
    87  ] interface {
    88  	EntityMutatingContext
    89  	EntityMethodCallInputContext[
    90  		SessionIDNumT, SessionIDT, TerminalIDNumT, TerminalIDT,
    91  		UserIDNumT, UserIDT, SessionSubjectT, SessionT,
    92  		ServiceMethodIdempotencyKeyT]
    93  	ServiceMutatingMethodCallInputContext[
    94  		SessionIDNumT, SessionIDT, TerminalIDNumT, TerminalIDT,
    95  		UserIDNumT, UserIDT, SessionSubjectT, SessionT,
    96  		ServiceMethodCallInputContextT, ServiceMethodIdempotencyKeyT]
    97  }
    98  
    99  // EntityMutatingMethodCallOutputContext provides an abstraction for output contexts
   100  // for mutating method calls.
   101  type EntityMutatingMethodCallOutputContext interface {
   102  	EntityMutatingContext
   103  	EntityMethodCallOutputContext
   104  	ServiceMutatingMethodCallOutputContext
   105  }
   106  
   107  // EntityMutatingMessage abstracts entity mutating method requests and responses.
   108  type EntityMutatingMessage interface {
   109  	EntityMethodMessage
   110  	ServiceMutatingMethodMessage
   111  
   112  	EntityMutatingContext() EntityMutatingContext
   113  }
   114  
   115  //endregion
   116  
   117  //region Service
   118  
   119  // EntityService provides an abstraction for all entity services. This
   120  // abstraction is used by both client and server.
   121  type EntityService interface {
   122  	AZEntityService()
   123  }
   124  
   125  //endregion
   126  
   127  //region ServiceBase
   128  
   129  // EntityServiceBase provides a basic implementation for EntityService.
   130  type EntityServiceBase struct{}
   131  
   132  var _ EntityService = &EntityServiceBase{}
   133  
   134  // AZEntityService is required for conformance with EntityService.
   135  func (*EntityServiceBase) AZEntityService() {}
   136  
   137  //endregion
   138  
   139  //region ServiceClient
   140  
   141  // EntityServiceClient provides an abstraction for all entity service clients.
   142  type EntityServiceClient interface {
   143  	EntityService
   144  
   145  	AZEntityServiceClient()
   146  }
   147  
   148  //endregion
   149  
   150  //region ServiceServer
   151  
   152  // EntityServiceServer provides an abstraction for all entity service servers.
   153  type EntityServiceServer interface {
   154  	EntityService
   155  
   156  	AZEntityServiceServer()
   157  }
   158  
   159  //endregion